GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 <PDGLibrary.h>

Collaboration diagram for genie::PDGLibrary:
Collaboration graph
[legend]

Classes

struct  Cleaner
 

Public Member Functions

TDatabasePDG * DBase (void)
 
TParticlePDG * Find (int pdgc, bool must_exist=true)
 
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)
 
bool AddDarkSector ()
 
bool AddHNL (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 <c.andreopoulos cern.ch> University of Liverpool

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

Changes required to implement the GENIE Dark Neutrino module were installed by Iker de Icaza (Univ. of Sussex)

Changes required to implement the GENIE BeamHNL module were installed by John Plows (Univ. of Oxford)

Created:
May 06, 2004
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 35 of file PDGLibrary.h.

Constructor & Destructor Documentation

PDGLibrary::PDGLibrary ( )
private

Definition at line 40 of file PDGLibrary.cxx.

References AddDarkSector(), AddHNL(), fInstance, LoadDBase(), LOG, pERROR, pFATAL, and pINFO.

Referenced by Instance().

41 {
42  if( ! LoadDBase() ) LOG("PDG", pERROR) << "Could not load PDG data";
43 
44 #ifdef __GENIE_DARK_NEUTRINO_ENABLED__
45  LOG("PDG", pINFO) << "Loading Dark sector Info";
46  if ( ! AddDarkSector() ) {
47  LOG("PDG", pFATAL) << "Could not load Dark Neutrino data";
48  exit(78);
49  }
50 #endif // __GENIE_DARK_NEUTRINO_ENABLED__
51 
52 #ifdef __GENIE_HEAVY_NEUTRAL_LEPTON_ENABLED__
53  LOG("PDG", pINFO) << "Loading Heavy Neutral Lepton data";
54  if( ! AddHNL() ){
55  LOG("PDG", pFATAL) << "Could not load Heavy Neutral Lepton data";
56  exit(78);
57  }
58 #endif // #ifdef __GENIE_HEAVY_NEUTRAL_LEPTON_ENABLED__
59 
60  fInstance = 0;
61 }
#define pERROR
Definition: Messenger.h:59
#define pFATAL
Definition: Messenger.h:56
bool AddHNL(void)
Definition: PDGLibrary.cxx:176
static PDGLibrary * fInstance
Definition: PDGLibrary.h:60
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool LoadDBase(void)
Definition: PDGLibrary.cxx:100
#define pINFO
Definition: Messenger.h:62
genie::PDGLibrary::PDGLibrary ( const PDGLibrary config_pool)
private
PDGLibrary::~PDGLibrary ( )
privatevirtual

Definition at line 63 of file PDGLibrary.cxx.

References fInstance.

64 {
65  fInstance = 0;
66 }
static PDGLibrary * fInstance
Definition: PDGLibrary.h:60

Member Function Documentation

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

Definition at line 153 of file PDGLibrary.cxx.

References fDatabasePDG, genie::kPdgDarkMatter, and genie::kPdgMediator.

Referenced by main().

154 {
155 // Add dark matter particle to PDG database
156 
157  double med_mass = mass*med_ratio;
158  TParticlePDG * dm_particle = fDatabasePDG->GetParticle(kPdgDarkMatter);
159  TParticlePDG * med_particle = fDatabasePDG->GetParticle(kPdgMediator);
160  if (!dm_particle) {
161  // Name Title Mass Stable Width Charge Class PDG
162  fDatabasePDG->AddParticle("chi_dm","chi_dm",mass,true,0.,0,"DarkMatter",kPdgDarkMatter);
163  }
164  else {
165  assert(dm_particle->Mass() == mass);
166  }
167  if (!med_particle) {
168  // Name Title Mass Stable Width Charge Class PDG
169  fDatabasePDG->AddParticle("Z_prime","Z_prime",med_mass,true,0.,0,"DarkMatter",kPdgMediator);
170  }
171  else {
172  assert(med_particle->Mass() == med_mass);
173  }
174 }
const int kPdgMediator
Definition: PDGCodes.h:220
const int kPdgDarkMatter
Definition: PDGCodes.h:218
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:61
bool PDGLibrary::AddDarkSector ( )
private

Definition at line 193 of file PDGLibrary.cxx.

References genie::AlgConfigPool::CommonList(), fDatabasePDG, genie::Registry::GetDouble(), genie::AlgConfigPool::Instance(), genie::kPdgAntiDarkNeutrino, genie::kPdgDarkNeutrino, genie::kPdgDNuMediator, LOG, and pERROR.

Referenced by PDGLibrary().

194 {
195  // Add dark neutrino particles to PDG database
196 
197  const Registry * reg = AlgConfigPool::Instance()->CommonList("Dark", "Masses");
198  if(!reg) {
199  LOG("PDG", pERROR) << "The Dark Sector masses not available.";
200  return false;
201  }
202  TParticlePDG * dnu_particle = fDatabasePDG->GetParticle(kPdgDarkNeutrino);
203  TParticlePDG * anti_dnu_particle = fDatabasePDG->GetParticle(kPdgAntiDarkNeutrino);
204  TParticlePDG * med_particle = fDatabasePDG->GetParticle(kPdgDNuMediator);
205  if (!dnu_particle) {
206  // Name Title Mass Stable Width Charge Class PDG
207  fDatabasePDG->AddParticle("nu_D","#nu_{D}",reg->GetDouble("Dark-NeutrinoMass"),
208  true,0.,0,"DarkNeutrino",kPdgDarkNeutrino);
209  }
210  if (!anti_dnu_particle) {
211  // Name Title Mass Stable Width Charge Class PDG
212  fDatabasePDG->AddParticle("nu_D_bar","#bar{#nu}_{D}",reg->GetDouble("Dark-NeutrinoMass"),
213  true,0.,0,"DarkNeutrino",kPdgAntiDarkNeutrino);
214  }
215  if (!med_particle) {
216  // Name Title Mass Stable Width Charge Class PDG
217  fDatabasePDG->AddParticle("Z_D","Z_{D}",reg->GetDouble("Dark-MediatorMass"),
218  true,0.,0,"DarkNeutrino",kPdgDNuMediator);
219  }
220  return true;
221 }
#define pERROR
Definition: Messenger.h:59
RgDbl GetDouble(RgKey key) const
Definition: Registry.cxx:474
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:61
const int kPdgAntiDarkNeutrino
Definition: PDGCodes.h:222
Registry * CommonList(const string &file_id, const string &set_name) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgDNuMediator
Definition: PDGCodes.h:223
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
const int kPdgDarkNeutrino
Definition: PDGCodes.h:221
static AlgConfigPool * Instance()
bool PDGLibrary::AddHNL ( void  )
private

Definition at line 176 of file PDGLibrary.cxx.

References genie::AlgConfigPool::CommonList(), fDatabasePDG, genie::Registry::GetDouble(), genie::AlgConfigPool::Instance(), genie::kPdgHNL, LOG, and pERROR.

Referenced by PDGLibrary().

177 {
178  // Add HNL to PDG database
179  const Registry * reg = AlgConfigPool::Instance()->CommonList("HNL", "ParameterSpace");
180  if (!reg) {
181  LOG("PDG", pERROR) << "Cannot find HNL ParameterSpace param_set";
182  return false;
183  }
184  TParticlePDG * hnl = fDatabasePDG->GetParticle(kPdgHNL);
185  if (!hnl) {
186  // Name Title Mass Stable Width Charge Class PDG
187  fDatabasePDG->AddParticle("HNL","HNL",reg->GetDouble("HNL-Mass"),true,0.,0,"HNL",kPdgHNL);
188  fDatabasePDG->AddParticle("HNLBar","HNLBar",reg->GetDouble("HNL-Mass"),true,0.,0,"HNL",-1*kPdgHNL);
189  }
190  return true;
191 }
#define pERROR
Definition: Messenger.h:59
RgDbl GetDouble(RgKey key) const
Definition: Registry.cxx:474
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:61
Registry * CommonList(const string &file_id, const string &set_name) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgHNL
Definition: PDGCodes.h:224
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
static AlgConfigPool * Instance()
TDatabasePDG * PDGLibrary::DBase ( void  )

Definition at line 81 of file PDGLibrary.cxx.

References fDatabasePDG.

Referenced by genie::evtlib::EventLibraryInterface::LoadRecords(), and genie::evtlib::EvtLibPXSec::LoadXSecs().

82 {
83  return fDatabasePDG;
84 }
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:61
TParticlePDG * PDGLibrary::Find ( int  pdgc,
bool  must_exist = true 
)

Definition at line 86 of file PDGLibrary.cxx.

References fDatabasePDG, LOG, and pERROR.

Referenced by genie::HNIntranuke2018::AbsorbHN(), genie::CEvNSEventGenerator::AddFinalStateNeutrino(), genie::NucleonDecayPrimaryVtxGenerator::AddInitialState(), genie::NNBarOscPrimaryVtxGenerator::AddInitialState(), genie::InitialStateAppender::AddNucleus(), genie::AMNuGammaGenerator::AddRecoilNucleon(), genie::InitialStateAppender::AddStruckParticle(), genie::NuETargetRemnantGenerator::AddTargetNucleusRemnant(), genie::DMETargetRemnantGenerator::AddTargetNucleusRemnant(), genie::HadronicSystemGenerator::AddTargetNucleusRemnant(), genie::QELEventGeneratorSuSA::AddTargetNucleusRemnant(), genie::QELEventGenerator::AddTargetNucleusRemnant(), genie::FermiMover::AddTargetNucleusRemnant(), genie::DMELEventGenerator::AddTargetNucleusRemnant(), genie::QELEventGeneratorSM::AddTargetNucleusRemnant(), genie::AMNuGammaGenerator::AddTargetRemnant(), genie::alvarezruso::ARConstants::ARConstants(), genie::GHepParticle::AssertIsKnownParticle(), INukeNucleonCorr::AvgCorrection(), genie::utils::BindHitNucleon(), genie::Born::Born(), genie::SppChannel::BranchingRatio(), genie::BostedChristyEMPXSec::BranchingRatios(), genie::hnl::Decayer::CalcPolMag(), genie::hnl::Decayer::CalcPolMod(), 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::d3sQES_dQ2dvdkF_SM(), genie::DarkSectorDecayer::DarkMediatorDecayChannels(), Decay(), genie::DarkSectorDecayer::Decay(), genie::BaryonResonanceDecayer::DecayExclusive(), genie::AGKYLowW2019::DecayMethod2(), genie::MECGenerator::DecayNucleonCluster(), genie::HAIntranuke::ElasHA(), genie::HAIntranuke2018::ElasHA(), genie::SecondNucleonEmissionI::EmitSecondNucleon(), genie::utils::intranuke::Equilibrium(), genie::PDGCodeList::ExistsInPDGLibrary(), genie::BaryonResonanceDecayer::FinalStateMass(), genie::Interaction::FSPrimLepton(), genie::GalsterELFormFactorsModel::Gen(), genie::NucleonDecayPrimaryVtxGenerator::GenerateDecayProducts(), genie::NNBarOscPrimaryVtxGenerator::GenerateDecayProducts(), genie::hnl::Decayer::GenerateDecayProducts(), genie::NucleonDecayPrimaryVtxGenerator::GenerateFermiMomentum(), genie::MECGenerator::GenerateFermiMomentum(), genie::AGKYLowW2019::GenerateHadronCodes(), genie::hnl::Decayer::GenerateMomentum(), genie::flux::GCylindTH1Flux::GenerateNext(), genie::MECGenerator::GenerateNSVInitialHadrons(), genie::QELEventGeneratorSuSA::GenerateNucleon(), GetCommandLineArgs(), genie::MECScaleVsW::GetMapWithLimits(), genie::MECScaleVsW::GetScaling(), genie::LeptoHadronization::Hadronize(), genie::AGCharm2019::Hadronize(), genie::HadronicSystemGenerator::HadronShowerCharge(), genie::AGKYLowW2019::HadronShowerCharge(), genie::Target::HitNucMass(), genie::hnl::FluxCreator::HNLEnergy(), genie::HAIntranuke::Inelastic(), genie::HAIntranuke2018::Inelastic(), genie::HAIntranuke2018::InelasticHA(), genie::InitialState::Init(), 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::DarkSectorDecayer::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::DMElectronPXSec::LoadConfig(), genie::BostedChristyEMPXSec::LoadConfig(), genie::hnl::BRCalculator::LoadConfig(), genie::flux::GAtmoFlux::LoadFluxData(), genie::PathLengthList::LoadFromXml(), genie::evtlib::EventLibraryInterface::LoadRecords(), genie::evtlib::EvtLibPXSec::LoadXSecs(), main(), genie::hnl::FluxCreator::MakeTupleFluxEntry(), genie::utils::res::Mass(), genie::Target::Mass(), genie::GHepParticle::Mass(), genie::utils::intranuke2018::MeanFreePath(), genie::PaisQELLambdaPXSec::MHyperon(), genie::KovalenkoQELCharmPXSec::MRes(), INukeNucleonCorr::mstar(), genie::GHepParticle::Name(), PDGcheck(), genie::AGKYLowW2019::PhaseSpaceDecay(), genie::utils::intranuke::PhaseSpaceDecay(), genie::utils::intranuke2018::PhaseSpaceDecay(), genie::utils::intranuke::PionProduction(), genie::utils::intranuke2018::PionProduction(), genie::hnl::Decayer::PolarisedDecay(), genie::utils::intranuke::PreEquilibrium(), genie::PDGCodeList::Print(), genie::PathLengthList::Print(), genie::InitialState::Print(), genie::Target::Print(), genie::XclsTag::Print(), genie::InitialState::Probe(), genie::DFRHadronicSystemGenerator::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::PhotonRESGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::PhotonCOHGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::GLRESGenerator::ProcessEventRecord(), genie::DMELEventGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::SPPEventGenerator::ProcessEventRecord(), genie::KPhaseSpace::Q2Lim(), genie::KPhaseSpace::Q2Lim_W_SPP(), genie::KPhaseSpace::Q2Lim_W_SPP_iso(), genie::utils::mec::Qvalue(), genie::hnl::FluxCreator::ReadBRs(), genie::Interaction::RecoilNucleon(), genie::PathLengthList::SaveAsXml(), SaveGraphsToRootFile(), SaveToPsFile(), genie::BaryonResonanceDecayer::SelectDecayChannel(), genie::MECGenerator::SelectEmpiricalKinematics(), genie::AGKYLowW2019::SelectParticles(), genie::Target::SetHitNucPdg(), genie::SmithMonizUtils::SetInteraction(), genie::QELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::MKFFCC::tau(), genie::MKFFEM::tau(), TestPythiaTauDecays(), genie::utils::intranuke::ThreeBodyKinematics(), genie::utils::intranuke2018::ThreeBodyKinematics(), genie::KPhaseSpace::Threshold(), genie::KPhaseSpace::Threshold_SPP_iso(), genie::utils::intranuke::TwoBodyCollision(), genie::utils::intranuke2018::TwoBodyCollision(), genie::utils::kinematics::W(), genie::utils::res::Width(), genie::KPhaseSpace::WLim_SPP(), genie::KPhaseSpace::WLim_SPP_iso(), genie::PattonCEvNSPXSec::XSec(), genie::EmpiricalMECPXSec2015::XSec(), genie::AlamSimoAtharVacasSKPXSec2014::XSec(), genie::MKSPPPXSec2020::XSec(), and genie::GEVGDriver::XSecSum().

87 {
88 
89  TParticlePDG * ret = fDatabasePDG->GetParticle(pdgc);
90  if(ret) return ret;
91 
92  if ( must_exist ) {
93  LOG("PDG", pERROR) << "Requested missing particle with PDG: " << pdgc ;
94  }
95 
96  return ret ;
97 }
#define pERROR
Definition: Messenger.h:59
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:61
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
PDGLibrary * PDGLibrary::Instance ( void  )
static

Definition at line 68 of file PDGLibrary.cxx.

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

Referenced by genie::HNIntranuke2018::AbsorbHN(), genie::CEvNSEventGenerator::AddFinalStateNeutrino(), genie::NucleonDecayPrimaryVtxGenerator::AddInitialState(), genie::NNBarOscPrimaryVtxGenerator::AddInitialState(), genie::InitialStateAppender::AddNucleus(), genie::AMNuGammaGenerator::AddRecoilNucleon(), genie::RSPPHadronicSystemGenerator::AddResonanceDecayProducts(), genie::InitialStateAppender::AddStruckParticle(), genie::NuETargetRemnantGenerator::AddTargetNucleusRemnant(), genie::DMETargetRemnantGenerator::AddTargetNucleusRemnant(), genie::HadronicSystemGenerator::AddTargetNucleusRemnant(), genie::QELEventGeneratorSuSA::AddTargetNucleusRemnant(), genie::QELEventGenerator::AddTargetNucleusRemnant(), genie::FermiMover::AddTargetNucleusRemnant(), genie::DMELEventGenerator::AddTargetNucleusRemnant(), genie::QELEventGeneratorSM::AddTargetNucleusRemnant(), genie::AMNuGammaGenerator::AddTargetRemnant(), genie::alvarezruso::ARConstants::ARConstants(), genie::GHepParticle::AssertIsKnownParticle(), INukeNucleonCorr::AvgCorrection(), genie::utils::BindHitNucleon(), genie::Born::Born(), genie::SppChannel::BranchingRatio(), genie::BostedChristyEMPXSec::BranchingRatios(), genie::hnl::Decayer::CalcPolMag(), genie::hnl::Decayer::CalcPolMod(), 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::d3sQES_dQ2dvdkF_SM(), genie::DarkSectorDecayer::DarkMediatorDecayChannels(), genie::PythiaDecayer::Decay(), Decay(), genie::DarkSectorDecayer::Decay(), genie::BaryonResonanceDecayer::DecayExclusive(), genie::AGKYLowW2019::DecayMethod2(), genie::MECGenerator::DecayNucleonCluster(), genie::HAIntranuke::ElasHA(), genie::HAIntranuke2018::ElasHA(), genie::SecondNucleonEmissionI::EmitSecondNucleon(), genie::utils::intranuke::Equilibrium(), genie::PDGCodeList::ExistsInPDGLibrary(), genie::BaryonResonanceDecayer::FinalStateMass(), genie::Interaction::FSPrimLepton(), genie::GalsterELFormFactorsModel::Gen(), genie::NucleonDecayPrimaryVtxGenerator::GenerateDecayProducts(), genie::NNBarOscPrimaryVtxGenerator::GenerateDecayProducts(), genie::hnl::Decayer::GenerateDecayProducts(), genie::NucleonDecayPrimaryVtxGenerator::GenerateFermiMomentum(), genie::MECGenerator::GenerateFermiMomentum(), genie::AGKYLowW2019::GenerateHadronCodes(), genie::hnl::Decayer::GenerateMomentum(), genie::flux::GCylindTH1Flux::GenerateNext(), genie::MECGenerator::GenerateNSVInitialHadrons(), genie::QELEventGeneratorSuSA::GenerateNucleon(), GetCommandLineArgs(), genie::MECScaleVsW::GetMapWithLimits(), genie::MECScaleVsW::GetScaling(), genie::LeptoHadronization::Hadronize(), genie::AGCharm2019::Hadronize(), genie::HadronicSystemGenerator::HadronShowerCharge(), genie::AGKYLowW2019::HadronShowerCharge(), genie::Target::HitNucMass(), genie::hnl::FluxCreator::HNLEnergy(), genie::HAIntranuke::Inelastic(), genie::HAIntranuke2018::Inelastic(), genie::HAIntranuke2018::InelasticHA(), genie::InitialState::Init(), InitializeEvent(), genie::LwlynSmithQELCCPXSec::Integral(), genie::AlamSimoAtharVacasSKXSec::Integrate(), genie::GHepParticle::IsOnMassShell(), genie::Target::IsParticle(), genie::Target::IsValidNucleus(), genie::FermiMover::KickHitNucleon(), genie::XSecScaleMap::LoadConfig(), genie::CascadeReweight::LoadConfig(), genie::QvalueShifter::LoadConfig(), genie::Decayer::LoadConfig(), genie::AlamSimoAtharVacasSKPXSec2014::LoadConfig(), genie::AhrensDMELPXSec::LoadConfig(), genie::DarkSectorDecayer::LoadConfig(), genie::QPMDMDISPXSec::LoadConfig(), genie::DMElectronPXSec::LoadConfig(), genie::BostedChristyEMPXSec::LoadConfig(), genie::hnl::BRCalculator::LoadConfig(), genie::flux::GAtmoFlux::LoadFluxData(), genie::PathLengthList::LoadFromXml(), genie::evtlib::EventLibraryInterface::LoadRecords(), genie::evtlib::EvtLibPXSec::LoadXSecs(), main(), genie::hnl::FluxCreator::MakeTupleFluxEntry(), genie::utils::res::Mass(), genie::Target::Mass(), genie::GHepParticle::Mass(), genie::utils::intranuke2018::MeanFreePath(), genie::PaisQELLambdaPXSec::MHyperon(), genie::KovalenkoQELCharmPXSec::MRes(), INukeNucleonCorr::mstar(), genie::GHepParticle::Name(), PDGcheck(), genie::AGKYLowW2019::PhaseSpaceDecay(), genie::utils::intranuke::PhaseSpaceDecay(), genie::utils::intranuke2018::PhaseSpaceDecay(), genie::utils::intranuke::PionProduction(), genie::utils::intranuke2018::PionProduction(), genie::hnl::Decayer::PolarisedDecay(), genie::utils::intranuke::PreEquilibrium(), genie::PDGCodeList::Print(), genie::PathLengthList::Print(), genie::InitialState::Print(), genie::Target::Print(), genie::XclsTag::Print(), genie::InitialState::Probe(), genie::DFRHadronicSystemGenerator::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::PhotonRESGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::PhotonCOHGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::GLRESGenerator::ProcessEventRecord(), genie::DMELEventGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::SPPEventGenerator::ProcessEventRecord(), genie::KPhaseSpace::Q2Lim(), genie::KPhaseSpace::Q2Lim_W_SPP(), genie::KPhaseSpace::Q2Lim_W_SPP_iso(), genie::utils::mec::Qvalue(), genie::hnl::FluxCreator::ReadBRs(), genie::Interaction::RecoilNucleon(), genie::PathLengthList::SaveAsXml(), SaveGraphsToRootFile(), SaveToPsFile(), genie::BaryonResonanceDecayer::SelectDecayChannel(), genie::MECGenerator::SelectEmpiricalKinematics(), genie::AGKYLowW2019::SelectParticles(), genie::Target::SetHitNucPdg(), genie::SmithMonizUtils::SetInteraction(), genie::QELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::MKFFCC::tau(), genie::MKFFEM::tau(), TestPythiaTauDecays(), genie::utils::intranuke::ThreeBodyKinematics(), genie::utils::intranuke2018::ThreeBodyKinematics(), genie::KPhaseSpace::Threshold(), genie::KPhaseSpace::Threshold_SPP_iso(), genie::utils::intranuke::TwoBodyCollision(), genie::utils::intranuke2018::TwoBodyCollision(), genie::utils::kinematics::W(), genie::utils::res::Width(), genie::KPhaseSpace::WLim_SPP(), genie::KPhaseSpace::WLim_SPP_iso(), genie::EmpiricalMECPXSec2015::XSec(), genie::PattonCEvNSPXSec::XSec(), genie::AlamSimoAtharVacasSKPXSec2014::XSec(), genie::MKSPPPXSec2020::XSec(), and genie::GEVGDriver::XSecSum().

69 {
70  if(fInstance == 0) {
71  LOG("PDG", pINFO) << "PDGLibrary late initialization";
72 
73  static PDGLibrary::Cleaner cleaner;
75 
76  fInstance = new PDGLibrary;
77  }
78  return fInstance;
79 }
static PDGLibrary * fInstance
Definition: PDGLibrary.h:60
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
bool PDGLibrary::LoadDBase ( void  )
private

Definition at line 100 of file PDGLibrary.cxx.

References genie::AlgConfigPool::CommonList(), fDatabasePDG, genie::utils::xml::GetString(), genie::AlgConfigPool::Instance(), LOG, pERROR, and pINFO.

Referenced by PDGLibrary(), and ReloadDBase().

101 {
102  fDatabasePDG = TDatabasePDG::Instance();
103 
104  // loading PDG data from $GENIE/config/
105  const char* altpdgtable = gSystem->Getenv("GENIE_PDG_TABLE");
106  if ( altpdgtable ) {
107  if ( ! (gSystem->AccessPathName(altpdgtable) ) ) {
108  LOG("PDG", pINFO) << "Load PDG data from $GENIE_PDG_TABLE: "
109  << altpdgtable;
110  fDatabasePDG->ReadPDGTable( altpdgtable );
111  return true;
112  }
113  }
114 
115  if ( gSystem->Getenv("GENIE") ) {
116  string base_dir = string( gSystem->Getenv("GENIE") );
117  base_dir += string("/data/evgen/catalogues/pdg/") ;
118 
119  string file_name = "genie_pdg_table.txt" ;
120  const Registry * reg = AlgConfigPool::Instance()->CommonList("Param", "PDG");
121  if( reg ) {
122  file_name = reg -> GetString("PDG-TableName") ;
123  LOG("PDG", pINFO) << "Found file name specification: " << file_name ;
124 
125  }
126 
127  string path = base_dir + file_name ;
128 
129  if ( ! (gSystem->AccessPathName(path.c_str()) ) ) {
130  LOG("PDG", pINFO) << "Load PDG data from: " << path;
131  fDatabasePDG->ReadPDGTable( path.c_str() );
132  return true;
133  }
134  }
135 
136  // no PDG data in $GENIE/config/ - Try $ROOTSYS/etc/
137 
138  if(gSystem->Getenv("ROOTSYS")) {
139  string base_dir = string( gSystem->Getenv("ROOTSYS") );
140  string path = base_dir + string("/etc/pdg_table.txt");
141 
142  if ( !(gSystem->AccessPathName(path.c_str())) ) {
143  LOG("PDG", pINFO) << "Load PDG data from: " << path;
144  fDatabasePDG->ReadPDGTable( path.c_str() );
145  return true;
146  }
147  }
148 
149  LOG("PDG", pERROR) << " *** The PDG extensions will not be loaded!! ***";
150  return false;
151 };
#define pERROR
Definition: Messenger.h:59
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:61
Registry * CommonList(const string &file_id, const string &set_name) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
string GetString(xmlDocPtr xml_doc, string node_path)
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
static AlgConfigPool * Instance()
void PDGLibrary::ReloadDBase ( void  )

Definition at line 224 of file PDGLibrary.cxx.

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

Referenced by main().

225 {
226  if(fDatabasePDG) {
227  delete fDatabasePDG;
228  }
229 
230  if( ! LoadDBase() ) LOG("PDG", pERROR) << "Could not load PDG data";
231 }
#define pERROR
Definition: Messenger.h:59
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:61
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool LoadDBase(void)
Definition: PDGLibrary.cxx:100

Friends And Related Function Documentation

friend struct Cleaner
friend

Definition at line 72 of file PDGLibrary.h.

Member Data Documentation

TDatabasePDG* genie::PDGLibrary::fDatabasePDG
private

Definition at line 61 of file PDGLibrary.h.

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

PDGLibrary * PDGLibrary::fInstance = 0
staticprivate

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