Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
genie::PDGLibrary Class Reference

Singleton class to load & serve a TDatabasePDG. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Framework/ParticleData/PDGLibrary.h"

Classes

struct  Cleaner
 

Public Member Functions

TDatabasePDG * DBase (void)
 
TParticlePDG * Find (int pdgc)
 
void ReloadDBase (void)
 
void AddDarkMatter (double mass, double med_ratio)
 

Static Public Member Functions

static PDGLibraryInstance (void)
 

Private Member Functions

 PDGLibrary ()
 
 PDGLibrary (const PDGLibrary &config_pool)
 
virtual ~PDGLibrary ()
 
bool LoadDBase (void)
 

Private Attributes

TDatabasePDG * fDatabasePDG
 

Static Private Attributes

static PDGLibraryfInstance = 0
 

Friends

struct Cleaner
 

Detailed Description

Singleton class to load & serve a TDatabasePDG.

Author
Costas Andreopoulos <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

Changes required to implement the GENIE Boosted Dark Matter module were installed by Josh Berger (Univ. of Wisconsin)

May 06, 2004

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 30 of file PDGLibrary.h.

Constructor & Destructor Documentation

PDGLibrary::PDGLibrary ( )
private

Definition at line 31 of file PDGLibrary.cxx.

References fInstance, LoadDBase(), LOG, and pERROR.

Referenced by Instance().

32 {
33  if( ! LoadDBase() ) LOG("PDG", pERROR) << "Could not load PDG data";
34 
35  fInstance = 0;
36 }
#define pERROR
Definition: Messenger.h:60
static PDGLibrary * fInstance
Definition: PDGLibrary.h:53
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool LoadDBase(void)
Definition: PDGLibrary.cxx:69
genie::PDGLibrary::PDGLibrary ( const PDGLibrary config_pool)
private
PDGLibrary::~PDGLibrary ( )
privatevirtual

Definition at line 38 of file PDGLibrary.cxx.

References fInstance.

39 {
40  fInstance = 0;
41 }
static PDGLibrary * fInstance
Definition: PDGLibrary.h:53

Member Function Documentation

void PDGLibrary::AddDarkMatter ( double  mass,
double  med_ratio 
)

Definition at line 113 of file PDGLibrary.cxx.

References ana::assert(), fDatabasePDG, genie::kPdgDarkMatter, and genie::kPdgMediator.

Referenced by main().

114 {
115 // Add dark matter particle to PDG database
116 
117  double med_mass = mass*med_ratio;
118  TParticlePDG * dm_particle = fDatabasePDG->GetParticle(kPdgDarkMatter);
119  TParticlePDG * med_particle = fDatabasePDG->GetParticle(kPdgMediator);
120  if (!dm_particle) {
121  // Name Title Mass Stable Width Charge Class PDG
122  fDatabasePDG->AddParticle("chi_dm","chi_dm",mass,true,0.,0,"DarkMatter",kPdgDarkMatter);
123  }
124  else {
125  assert(dm_particle->Mass() == mass);
126  }
127  if (!med_particle) {
128  // Name Title Mass Stable Width Charge Class PDG
129  fDatabasePDG->AddParticle("Z_prime","Z_prime",med_mass,true,0.,0,"DarkMatter",kPdgMediator);
130  }
131  else {
132  assert(med_particle->Mass() == med_mass);
133  }
134 }
const int kPdgMediator
Definition: PDGCodes.h:196
const int kPdgDarkMatter
Definition: PDGCodes.h:195
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:54
assert(nhit_max >=nhit_nbins)
TDatabasePDG * PDGLibrary::DBase ( void  )

Definition at line 56 of file PDGLibrary.cxx.

References fDatabasePDG.

57 {
58  return fDatabasePDG;
59 }
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:54
TParticlePDG * PDGLibrary::Find ( int  pdgc)

Definition at line 61 of file PDGLibrary.cxx.

References fDatabasePDG.

Referenced by genie::HNIntranuke2018::AbsorbHN(), genie::NucleonDecayPrimaryVtxGenerator::AddInitialState(), genie::NNBarOscPrimaryVtxGenerator::AddInitialState(), genie::InitialStateAppender::AddNucleus(), genie::AMNuGammaGenerator::AddRecoilNucleon(), genie::InitialStateAppender::AddStruckParticle(), genie::NuETargetRemnantGenerator::AddTargetNucleusRemnant(), genie::HadronicSystemGenerator::AddTargetNucleusRemnant(), genie::FermiMover::AddTargetNucleusRemnant(), genie::QELEventGenerator::AddTargetNucleusRemnant(), genie::QELEventGeneratorSM::AddTargetNucleusRemnant(), genie::AMNuGammaGenerator::AddTargetRemnant(), genie::alvarezruso::ARConstants::ARConstants(), genie::GHepParticle::AssertIsKnownParticle(), INukeNucleonCorr::AvgCorrection(), genie::utils::BindHitNucleon(), genie::SKHadronicSystemGenerator::CalculateHadronicSystem_AtharSingleKaon(), genie::COHHadronicSystemGenerator::CalculateHadronicSystem_BergerSehgalFM(), genie::COHHadronicSystemGenerator::CalculateHadronicSystem_ReinSehgal(), genie::SKKinematicsGenerator::CalculateKin_AtharSingleKaon(), genie::Target::Charge(), genie::GHepParticle::Charge(), CheckDecayerConsistency(), genie::SKKinematicsGenerator::ComputeMaxXSec(), ConvertToGRooTracker(), genie::SmithMonizQELCCPXSec::d2sQES_dQ2dv_SM(), Decay(), genie::BaryonResonanceDecayer::DecayExclusive(), genie::KNOHadronization::DecayMethod2(), genie::MECGenerator::DecayNucleonCluster(), genie::HAIntranuke::ElasHA(), genie::HAIntranuke2018::ElasHA(), genie::FermiMover::Emit2ndNucleonFromSRC(), genie::utils::intranuke::Equilibrium(), genie::PDGCodeList::ExistsInPDGLibrary(), genie::BaryonResonanceDecayer::FinalStateMass(), genie::Interaction::FSPrimLepton(), genie::NucleonDecayPrimaryVtxGenerator::GenerateDecayProducts(), genie::NNBarOscPrimaryVtxGenerator::GenerateDecayProducts(), genie::NucleonDecayPrimaryVtxGenerator::GenerateFermiMomentum(), genie::MECGenerator::GenerateFermiMomentum(), genie::KNOHadronization::GenerateHadronCodes(), genie::MECGenerator::GenerateNSVInitialHadrons(), get_mass(), GetCommandLineArgs(), genie::CharmHadronization::Hadronize(), genie::HadronicSystemGenerator::HadronShowerCharge(), genie::KNOHadronization::HadronShowerCharge(), genie::Target::HitNucMass(), genie::HAIntranuke::Inelastic(), genie::HAIntranuke2018::Inelastic(), genie::HAIntranuke2018::InelasticHA(), genie::InitialState::Init(), genie::GLRESPXSec::Integral(), genie::LwlynSmithQELCCPXSec::Integral(), genie::AlamSimoAtharVacasSKXSec::Integrate(), genie::GHepParticle::IsOnMassShell(), genie::Target::IsParticle(), genie::Target::IsValidNucleus(), genie::FermiMover::KickHitNucleon(), genie::Decayer::LoadConfig(), genie::AlamSimoAtharVacasSKPXSec2014::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::flux::GAtmoFlux::LoadFluxData(), genie::PathLengthList::LoadFromXml(), main(), genie::Target::Mass(), genie::GHepParticle::Mass(), genie::utils::intranuke2018::MeanFreePath(), genie::PaisQELLambdaPXSec::MHyperon(), genie::KovalenkoQELCharmPXSec::MRes(), INukeNucleonCorr::mstar(), genie::GHepParticle::Name(), genie::utils::fragmrec::NNegatives(), genie::utils::fragmrec::NPositives(), PDGcheck(), genie::KNOHadronization::PhaseSpaceDecay(), genie::utils::intranuke::PhaseSpaceDecay(), genie::utils::intranuke2018::PhaseSpaceDecay(), genie::utils::intranuke::PionProduction(), genie::utils::intranuke2018::PionProduction(), genie::utils::intranuke::PreEquilibrium(), genie::PDGCodeList::Print(), genie::PathLengthList::Print(), genie::XclsTag::Print(), genie::InitialState::Print(), genie::Target::Print(), genie::geometry::PathSegmentList::Print(), genie::InitialState::Probe(), genie::DFRHadronicSystemGenerator::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::KPhaseSpace::Q2Lim(), genie::utils::mec::Qvalue(), genie::Interaction::RecoilNucleon(), genie::PathLengthList::SaveAsXml(), SaveGraphsToRootFile(), SaveToPsFile(), genie::BaryonResonanceDecayer::SelectDecayChannel(), genie::MECGenerator::SelectEmpiricalKinematics(), genie::KNOHadronization::SelectParticles(), genie::Target::SetHitNucPdg(), genie::SmithMonizUtils::SetInteraction(), genie::QELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode(), TestPythiaTauDecays(), genie::utils::intranuke::ThreeBodyKinematics(), genie::utils::intranuke2018::ThreeBodyKinematics(), genie::KPhaseSpace::Threshold(), genie::utils::intranuke::TwoBodyCollision(), genie::utils::intranuke2018::TwoBodyCollision(), genie::utils::kinematics::W(), genie::EmpiricalMECPXSec2015::XSec(), genie::AlamSimoAtharVacasSKPXSec2014::XSec(), and genie::GEVGDriver::XSecSum().

62 {
63 // save some typing in the most frequently typed TDatabasePDG method
64 
65  return fDatabasePDG->GetParticle(pdgc);
66 }
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:54
PDGLibrary * PDGLibrary::Instance ( void  )
static

Definition at line 43 of file PDGLibrary.cxx.

References genie::PDGLibrary::Cleaner::DummyMethodAndSilentCompiler(), fInstance, LOG, PDGLibrary(), and pINFO.

Referenced by genie::HNIntranuke2018::AbsorbHN(), genie::NucleonDecayPrimaryVtxGenerator::AddInitialState(), genie::NNBarOscPrimaryVtxGenerator::AddInitialState(), genie::InitialStateAppender::AddNucleus(), genie::AMNuGammaGenerator::AddRecoilNucleon(), genie::RSPPHadronicSystemGenerator::AddResonanceDecayProducts(), genie::InitialStateAppender::AddStruckParticle(), genie::NuETargetRemnantGenerator::AddTargetNucleusRemnant(), genie::HadronicSystemGenerator::AddTargetNucleusRemnant(), genie::FermiMover::AddTargetNucleusRemnant(), genie::QELEventGenerator::AddTargetNucleusRemnant(), genie::QELEventGeneratorSM::AddTargetNucleusRemnant(), genie::AMNuGammaGenerator::AddTargetRemnant(), genie::alvarezruso::ARConstants::ARConstants(), genie::GHepParticle::AssertIsKnownParticle(), INukeNucleonCorr::AvgCorrection(), genie::utils::BindHitNucleon(), genie::SKHadronicSystemGenerator::CalculateHadronicSystem_AtharSingleKaon(), genie::COHHadronicSystemGenerator::CalculateHadronicSystem_BergerSehgalFM(), genie::COHHadronicSystemGenerator::CalculateHadronicSystem_ReinSehgal(), genie::SKKinematicsGenerator::CalculateKin_AtharSingleKaon(), genie::Target::Charge(), genie::GHepParticle::Charge(), CheckDecayerConsistency(), genie::SKKinematicsGenerator::ComputeMaxXSec(), ConvertToGRooTracker(), genie::SmithMonizQELCCPXSec::d2sQES_dQ2dv_SM(), genie::PythiaDecayer::Decay(), Decay(), genie::BaryonResonanceDecayer::DecayExclusive(), genie::KNOHadronization::DecayMethod2(), genie::MECGenerator::DecayNucleonCluster(), genie::HAIntranuke::ElasHA(), genie::HAIntranuke2018::ElasHA(), genie::FermiMover::Emit2ndNucleonFromSRC(), genie::utils::intranuke::Equilibrium(), genie::PDGCodeList::ExistsInPDGLibrary(), genie::BaryonResonanceDecayer::FinalStateMass(), genie::Interaction::FSPrimLepton(), genie::NucleonDecayPrimaryVtxGenerator::GenerateDecayProducts(), genie::NNBarOscPrimaryVtxGenerator::GenerateDecayProducts(), genie::NucleonDecayPrimaryVtxGenerator::GenerateFermiMomentum(), genie::MECGenerator::GenerateFermiMomentum(), genie::KNOHadronization::GenerateHadronCodes(), genie::MECGenerator::GenerateNSVInitialHadrons(), GetCommandLineArgs(), genie::CharmHadronization::Hadronize(), genie::HadronicSystemGenerator::HadronShowerCharge(), genie::KNOHadronization::HadronShowerCharge(), genie::Target::HitNucMass(), genie::HAIntranuke::Inelastic(), genie::HAIntranuke2018::Inelastic(), genie::HAIntranuke2018::InelasticHA(), genie::InitialState::Init(), InitializeEvent(), genie::GLRESPXSec::Integral(), genie::LwlynSmithQELCCPXSec::Integral(), genie::AlamSimoAtharVacasSKXSec::Integrate(), genie::GHepParticle::IsOnMassShell(), genie::Target::IsParticle(), genie::Target::IsValidNucleus(), genie::FermiMover::KickHitNucleon(), genie::Decayer::LoadConfig(), genie::AlamSimoAtharVacasSKPXSec2014::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::flux::GAtmoFlux::LoadFluxData(), genie::PathLengthList::LoadFromXml(), main(), genie::Target::Mass(), genie::GHepParticle::Mass(), genie::utils::intranuke2018::MeanFreePath(), genie::PaisQELLambdaPXSec::MHyperon(), genie::KovalenkoQELCharmPXSec::MRes(), INukeNucleonCorr::mstar(), genie::GHepParticle::Name(), genie::utils::fragmrec::NNegatives(), genie::utils::fragmrec::NPositives(), PDGcheck(), genie::KNOHadronization::PhaseSpaceDecay(), genie::utils::intranuke::PhaseSpaceDecay(), genie::utils::intranuke2018::PhaseSpaceDecay(), genie::utils::intranuke::PionProduction(), genie::utils::intranuke2018::PionProduction(), genie::utils::intranuke::PreEquilibrium(), genie::PDGCodeList::Print(), genie::PathLengthList::Print(), genie::XclsTag::Print(), genie::InitialState::Print(), genie::Target::Print(), genie::geometry::PathSegmentList::Print(), genie::InitialState::Probe(), genie::DFRHadronicSystemGenerator::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::KPhaseSpace::Q2Lim(), genie::utils::mec::Qvalue(), genie::Interaction::RecoilNucleon(), genie::PathLengthList::SaveAsXml(), SaveGraphsToRootFile(), SaveToPsFile(), genie::BaryonResonanceDecayer::SelectDecayChannel(), genie::MECGenerator::SelectEmpiricalKinematics(), genie::KNOHadronization::SelectParticles(), genie::Target::SetHitNucPdg(), genie::SmithMonizUtils::SetInteraction(), genie::QELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode(), TestPythiaTauDecays(), genie::utils::intranuke::ThreeBodyKinematics(), genie::utils::intranuke2018::ThreeBodyKinematics(), genie::KPhaseSpace::Threshold(), genie::utils::intranuke::TwoBodyCollision(), genie::utils::intranuke2018::TwoBodyCollision(), genie::utils::kinematics::W(), genie::EmpiricalMECPXSec2015::XSec(), genie::AlamSimoAtharVacasSKPXSec2014::XSec(), and genie::GEVGDriver::XSecSum().

44 {
45  if(fInstance == 0) {
46  LOG("PDG", pINFO) << "PDGLibrary late initialization";
47 
48  static PDGLibrary::Cleaner cleaner;
50 
51  fInstance = new PDGLibrary;
52  }
53  return fInstance;
54 }
static PDGLibrary * fInstance
Definition: PDGLibrary.h:53
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
bool PDGLibrary::LoadDBase ( void  )
private

Definition at line 69 of file PDGLibrary.cxx.

References fDatabasePDG, LOG, path, pERROR, and pINFO.

Referenced by PDGLibrary(), and ReloadDBase().

70 {
71  fDatabasePDG = TDatabasePDG::Instance();
72 
73  // loading PDG data from $GENIE/config/
74  const char* altpdgtable = gSystem->Getenv("GENIE_PDG_TABLE");
75  if ( altpdgtable ) {
76  if ( ! (gSystem->AccessPathName(altpdgtable) ) ) {
77  LOG("PDG", pINFO) << "Load PDG data from $GENIE_PDG_TABLE: "
78  << altpdgtable;
79  fDatabasePDG->ReadPDGTable( altpdgtable );
80  return true;
81  }
82  }
83 
84  if ( gSystem->Getenv("GENIE") ) {
85  string base_dir = string( gSystem->Getenv("GENIE") );
86  string path = base_dir +
87  string("/data/evgen/catalogues/pdg/genie_pdg_table.txt");
88 
89  if ( ! (gSystem->AccessPathName(path.c_str()) ) ) {
90  LOG("PDG", pINFO) << "Load PDG data from: " << path;
91  fDatabasePDG->ReadPDGTable( path.c_str() );
92  return true;
93  }
94  }
95 
96  // no PDG data in $GENIE/config/ - Try $ROOTSYS/etc/
97 
98  if(gSystem->Getenv("ROOTSYS")) {
99  string base_dir = string( gSystem->Getenv("ROOTSYS") );
100  string path = base_dir + string("/etc/pdg_table.txt");
101 
102  if ( !(gSystem->AccessPathName(path.c_str())) ) {
103  LOG("PDG", pINFO) << "Load PDG data from: " << path;
104  fDatabasePDG->ReadPDGTable( path.c_str() );
105  return true;
106  }
107  }
108 
109  LOG("PDG", pERROR) << " *** The PDG extensions will not be loaded!! ***";
110  return false;
111 };
#define pERROR
Definition: Messenger.h:60
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:54
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
const std::string path
Definition: plot_BEN.C:43
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
void PDGLibrary::ReloadDBase ( void  )

Definition at line 137 of file PDGLibrary.cxx.

References fDatabasePDG, LoadDBase(), LOG, and pERROR.

Referenced by main().

138 {
139  if(fDatabasePDG) {
140  delete fDatabasePDG;
141  }
142 
143  if( ! LoadDBase() ) LOG("PDG", pERROR) << "Could not load PDG data";
144 }
#define pERROR
Definition: Messenger.h:60
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:54
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool LoadDBase(void)
Definition: PDGLibrary.cxx:69

Friends And Related Function Documentation

friend struct Cleaner
friend

Definition at line 65 of file PDGLibrary.h.

Member Data Documentation

TDatabasePDG* genie::PDGLibrary::fDatabasePDG
private

Definition at line 54 of file PDGLibrary.h.

Referenced by AddDarkMatter(), DBase(), Find(), LoadDBase(), and ReloadDBase().

PDGLibrary * PDGLibrary::fInstance = 0
staticprivate

The documentation for this class was generated from the following files: