GENIEGenerator
Loading...
Searching...
No Matches
genie::RandomGen Class Reference

A singleton holding random number generator classes. All random number generation in GENIE should take place through this class. Ensures that the random number generator seed is set consistently to all GENIE modules and that all modules use the preferred rndm number generator. More...

#include <RandomGen.h>

Collaboration diagram for genie::RandomGen:
[legend]

Classes

struct  Cleaner

Public Member Functions

TRandom3 & RndKine (void) const
 rnd number generator used by kinematics generators
TRandom3 & RndHadro (void) const
 rnd number generator used by hadronization models
TRandom3 & RndDec (void) const
 rnd number generator used by decay models
TRandom3 & RndFsi (void) const
 rnd number generator used by intranuclear cascade monte carlos
TRandom3 & RndLep (void) const
 rnd number generator used by final state primary lepton generators
TRandom3 & RndISel (void) const
 rnd number generator used by interaction selectors
TRandom3 & RndGeom (void) const
 rnd number generator used by geometry drivers
TRandom3 & RndFlux (void) const
 rnd number generator used by flux drivers
TRandom3 & RndEvg (void) const
 rnd number generator used by the event generation drivers
TRandom3 & RndNum (void) const
 rnd number generator used by MC integrators & other numerical methods
TRandom3 & RndGen (void) const
 rnd number generator for generic usage
long int GetSeed (void) const
void SetSeed (long int seed)

Static Public Member Functions

static RandomGenInstance ()
 Access instance.

Private Member Functions

 RandomGen ()
 RandomGen (const RandomGen &rgen)
virtual ~RandomGen ()
void InitRandomGenerators (long int seed)

Private Attributes

TRandom3 * fRandom3
 Mersenne Twistor.
long int fCurrSeed
 random number generator seed number
bool fInitalized
 done initializing singleton?

Static Private Attributes

static RandomGenfInstance = 0

Friends

struct Cleaner

Detailed Description

A singleton holding random number generator classes. All random number generation in GENIE should take place through this class. Ensures that the random number generator seed is set consistently to all GENIE modules and that all modules use the preferred rndm number generator.

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n September 22, 2004
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 29 of file RandomGen.h.

Constructor & Destructor Documentation

◆ RandomGen() [1/2]

genie::RandomGen::RandomGen ( )
private

Definition at line 30 of file RandomGen.cxx.

31{
32 LOG("Rndm", pINFO) << "RandomGen late initialization";
33
34 fInitalized = false;
35 fInstance = 0;
36/*
37 // try to get this job's random number seed from the environment
38 const char * seed = gSystem->Getenv("GSEED");
39 if(seed) {
40 LOG("Rndm", pDEBUG) << "Reading RandomNumGenerator seed env. var $GSEED";
41 fCurrSeed = atoi(seed);
42 } else {
43 LOG("Rndm", pINFO) << "Env. var. $GSEED is not set. Using default seed";
44 fCurrSeed = kDefaultRandSeed; // default seed number
45 }
46 this->InitRandomGenerators(fCurrSeed);
47*/
48
49 if ( gSystem->Getenv("GSEED") ) {
50 LOG("Rndm", pFATAL)
51 << "\n\n"
52 << "************************************************************************************** \n"
53 << "The random number seed is no longer set via the $GSEED variable.\n"
54 << "Please use the --seed option implemented in all GENIE apps or, if you access RandomGen \n"
55 << "directly in your user code, use RandomGen::SetSeed(long int seed).\n"
56 << "Unset $GSEED to continue running GENIE. \n"
57 << "************************************************************************************** \n";
58 gAbortingInErr = true;
59 exit(1);
60 }
61
62 fCurrSeed = kDefaultRandSeed; // a default seed number is set a init
64
65 fInitalized = true;
66}
#define pINFO
Definition Messenger.h:62
#define pFATAL
Definition Messenger.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
bool fInitalized
done initializing singleton?
Definition RandomGen.h:95
static RandomGen * fInstance
Definition RandomGen.h:91
void InitRandomGenerators(long int seed)
long int fCurrSeed
random number generator seed number
Definition RandomGen.h:94
static const unsigned int kDefaultRandSeed
Definition Controls.h:37
bool gAbortingInErr
Definition Messenger.cxx:34

References fCurrSeed, fInitalized, fInstance, genie::gAbortingInErr, InitRandomGenerators(), genie::controls::kDefaultRandSeed, LOG, pFATAL, and pINFO.

Referenced by Instance(), and RandomGen().

◆ RandomGen() [2/2]

genie::RandomGen::RandomGen ( const RandomGen & rgen)
private

References RandomGen().

◆ ~RandomGen()

genie::RandomGen::~RandomGen ( )
privatevirtual

Definition at line 68 of file RandomGen.cxx.

69{
70 fInstance = 0;
71 if(fRandom3) delete fRandom3;
72}
TRandom3 * fRandom3
Mersenne Twistor.
Definition RandomGen.h:93

References fInstance, and fRandom3.

Member Function Documentation

◆ GetSeed()

◆ InitRandomGenerators()

void genie::RandomGen::InitRandomGenerators ( long int seed)
private

Definition at line 133 of file RandomGen.cxx.

134{
135 fRandom3 = new TRandom3();
136 this->SetSeed(seed);
137}
void SetSeed(long int seed)
Definition RandomGen.cxx:85

References fRandom3, and SetSeed().

Referenced by RandomGen().

◆ Instance()

RandomGen * genie::RandomGen::Instance ( )
static

Access instance.

Definition at line 74 of file RandomGen.cxx.

75{
76 if(fInstance == 0) {
77 static RandomGen::Cleaner cleaner;
78 cleaner.DummyMethodAndSilentCompiler();
79
80 fInstance = new RandomGen;
81 }
82 return fInstance;
83}
friend struct Cleaner
Definition RandomGen.h:109

References genie::RandomGen::Cleaner::DummyMethodAndSilentCompiler(), fInstance, and RandomGen().

Referenced by genie::HNIntranuke2018::AbsorbHN(), genie::HNIntranuke2025::AbsorbHN(), genie::BaryonResonanceDecayer::AcceptPionDecay(), genie::MECGenerator::AddFinalStateLepton(), genie::CEvNSEventGenerator::AddFinalStateNeutrino(), genie::AMNuGammaGenerator::AddPhoton(), genie::HEDISGenerator::AddPrimaryLepton(), genie::NucDeExcitationSim::ArgonTargetSim(), INukeNucleonCorr::AvgCorrection(), BuildSpectrum(), genie::hnl::VertexGenerator::CalcTravelLength(), genie::COHHadronicSystemGenerator::CalculateHadronicSystem_BergerSehgalFM(), genie::COHHadronicSystemGenerator::CalculateHadronicSystem_ReinSehgal(), genie::COHKinematicsGenerator::CalculateKin_AlvarezRuso(), genie::SKKinematicsGenerator::CalculateKin_AtharSingleKaon(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgal(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgalFM(), genie::COHKinematicsGenerator::CalculateKin_ReinSehgal(), genie::NucDeExcitationSim::CarbonTargetSim(), genie::utils::math::CholeskyGenerateCorrelatedParams(), genie::utils::math::CholeskyGenerateCorrelatedParamVariations(), genie::flux::GFluxBlender::ChooseFlavor(), ConvertToGTracker(), genie::DarkSectorDecayer::Decay(), genie::AGKYLowW2019::DecayBackToBack(), genie::BaryonResonanceDecayer::DecayExclusive(), genie::AGKYLowW2019::DecayMethod2(), genie::MECGenerator::DecayNucleonCluster(), genie::HNIntranuke2018::ElasHN(), genie::HNIntranuke2025::ElasHN(), genie::utils::intranuke2018::Equilibrium(), genie::utils::intranuke2025::Equilibrium(), genie::utils::intranuke::Equilibrium(), genie::BaryonResonanceDecayer::FindDistributionExtrema(), genie::HNIntranuke2018::GammaInelasticHN(), genie::HNIntranuke2025::GammaInelasticHN(), genie::geometry::ROOTGeomAnalyzer::GenBoxRay(), genie::AGKYLowW2019::GenerateBaryonPdgCode(), genie::AGCharmPythiaBaseHadro2023::GenerateCharmHadron(), genie::NucleonDecayPrimaryVtxGenerator::GenerateDecayedNucleonPosition(), genie::hnl::Decayer::GenerateDecayPosition(), genie::hnl::Decayer::GenerateDecayProducts(), genie::NNBarOscPrimaryVtxGenerator::GenerateDecayProducts(), genie::NucleonDecayPrimaryVtxGenerator::GenerateDecayProducts(), genie::GMCJDriver::GenerateEvent1Try(), genie::AGKYLowW2019::GenerateHadronCodes(), genie::CEvNSEventGenerator::GenerateKinematics(), genie::COHDNuEventGenerator::GenerateKinematics(), genie::hnl::Decayer::GenerateMomentum(), genie::flux::GJPARCNuFlux::GenerateNext(), genie::flux::GMonoEnergeticFlux::GenerateNext(), genie::flux::GNuMIFlux::GenerateNext(), genie::flux::GPowerLawFlux::GenerateNext(), genie::flux::GSimpleNtpFlux::GenerateNext(), genie::flux::GAtmoFlux::GenerateNext_1try(), genie::flux::GNuMIFlux::GenerateNext_weighted(), genie::EffectiveSF::GenerateNucleon(), genie::FGMBodekRitchie::GenerateNucleon(), genie::LocalFGM::GenerateNucleon(), genie::SpectralFunc1d::GenerateNucleon(), genie::SpectralFunc::GenerateNucleon(), GenerateOriginMomentum(), GenerateOriginPosition(), genie::NNBarOscPrimaryVtxGenerator::GenerateOscillatingNeutronPosition(), genie::flux::GCylindTH1Flux::GeneratePhi(), GeneratePosition(), genie::Intranuke2018::GenerateStep(), genie::Intranuke2025::GenerateStep(), genie::Intranuke::GenerateStep(), INukeNucleonCorr::generateTargetNucleon(), genie::geometry::ROOTGeomAnalyzer::GenerateVertex(), genie::Intranuke2018::GenerateVertex(), genie::Intranuke2025::GenerateVertex(), genie::Intranuke::GenerateVertex(), genie::VertexGenerator::GenerateVertex(), genie::hnl::FluxCreator::GetAngDeviation(), GetDetectorVertex(), GetRandomRay(), genie::LeptoHadPythia8::getRandomZ(), GetTargetMaterial(), genie::HAIntranuke2018::HadronFateHA(), genie::HAIntranuke2025::HadronFateHA(), genie::HAIntranuke::HadronFateHA(), genie::HNIntranuke2018::HadronFateHN(), genie::HNIntranuke2025::HadronFateHN(), genie::HNIntranuke2018::HadronFateOset(), genie::HNIntranuke2025::HadronFateOset(), genie::AGCharmPythiaBaseHadro2023::Hadronize(), genie::LeptoHadPythia6::Hadronize(), genie::LeptoHadPythia8::Hadronize(), genie::hnl::FluxCreator::HNLEnergy(), genie::HAIntranuke2018::Inelastic(), genie::HAIntranuke2025::Inelastic(), genie::HAIntranuke::Inelastic(), genie::HAIntranuke2018::InelasticHA(), genie::HAIntranuke2025::InelasticHA(), genie::HAIntranuke::InelasticHA(), genie::AGCharmPythia6Hadro2023::Initialize(), genie::AGCharmPythia8Hadro2023::Initialize(), genie::GLRESWdecPythia6::Initialize(), genie::LeptoHadPythia6::Initialize(), genie::LeptoHadPythia8::Initialize(), genie::PhotonCOHWdecPythia6::Initialize(), genie::PhotonCOHWdecPythia8::Initialize(), genie::PhotonRESWdecPythia6::Initialize(), genie::Pythia6Decayer2023::Initialize(), genie::Pythia6Hadro2019::Initialize(), genie::Pythia8Decayer2023::Initialize(), genie::Pythia8Hadro2019::Initialize(), genie::INukeHadroData2018::IntBounce(), genie::INukeHadroData2025::IntBounce(), genie::INukeHadroData::IntBounce(), genie::flux::GNuMIFlux::LoadBeamSimData(), genie::flux::GSimpleNtpFlux::LoadBeamSimData(), main(), main(), genie::PythiaBaseHadro2019::MakeQuarkDiquarkAssignments(), genie::hnl::FluxCreator::MakeTupleFluxEntry(), genie::LocalFGM::MaxwellBoltzmannRemovalE(), genie::NucDeExcitationSim::OxygenTargetSim(), genie::AGKYLowW2019::PhaseSpaceDecay(), genie::utils::intranuke2018::PhaseSpaceDecay(), genie::utils::intranuke2025::PhaseSpaceDecay(), genie::utils::intranuke::PhaseSpaceDecay(), genie::NucDeExcitationSim::Photon4P(), genie::NucDeExcitationSim::PhotonEnergySmearing(), genie::HAIntranuke2018::PiBounce(), genie::HAIntranuke2025::PiBounce(), genie::HAIntranuke::PiBounce(), genie::utils::intranuke2018::PionProduction(), genie::utils::intranuke2025::PionProduction(), genie::utils::intranuke::PionProduction(), genie::HAIntranuke2018::PnBounce(), genie::HAIntranuke2025::PnBounce(), genie::HAIntranuke::PnBounce(), genie::hnl::FluxCreator::PointToRandomPointInBBox(), genie::hnl::Decayer::PolarisedDecay(), genie::utils::intranuke2018::PreEquilibrium(), genie::utils::intranuke2025::PreEquilibrium(), genie::utils::intranuke::PreEquilibrium(), genie::DFRHadronicSystemGenerator::ProcessEventRecord(), genie::DFRKinematicsGenerator::ProcessEventRecord(), genie::DISKinematicsGenerator::ProcessEventRecord(), genie::DMDISKinematicsGenerator::ProcessEventRecord(), genie::DMEKinematicsGenerator::ProcessEventRecord(), genie::DMELEventGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::DMEOutgoingDarkGenerator::ProcessEventRecord(), genie::evtlib::EventLibraryInterface::ProcessEventRecord(), genie::HEDISKinematicsGenerator::ProcessEventRecord(), genie::HELeptonKinematicsGenerator::ProcessEventRecord(), genie::HENuElGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::INukeDeltaPropg::ProcessEventRecord(), genie::NucDeExcitationSim::ProcessEventRecord(), genie::NuEKinematicsGenerator::ProcessEventRecord(), genie::NuEPrimaryLeptonGenerator::ProcessEventRecord(), genie::OutgoingDarkGenerator::ProcessEventRecord(), genie::PrimaryLeptonGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::RESKinematicsGenerator::ProcessEventRecord(), genie::SPPEventGenerator::ProcessEventRecord(), genie::utils::app_init::RandGen(), genie::flux::GJPARCNuFlux::RandomOffset(), SelectAnnihilationMode(), genie::BaryonResonanceDecayer::SelectDecayChannel(), genie::DarkSectorDecayer::SelectDecayChannel(), SelectDecayMode(), genie::MECGenerator::SelectEmpiricalKinematics(), genie::flux::GAstroFlux::NuGenerator::SelectEnergy(), genie::AGKY2019::SelectHadronizer(), SelectInitState(), genie::PhysInteractionSelector::SelectInteraction(), genie::ToyInteractionSelector::SelectInteraction(), genie::QELEventGeneratorSuSA::SelectLeptonKinematics(), genie::flux::GAtmoFlux::SelectNeutrino(), genie::flux::GCylindTH1Flux::SelectNeutrino(), genie::MECGenerator::SelectNSVLeptonKinematics(), genie::flux::GAstroFlux::NuGenerator::SelectNuPdg(), genie::flux::GAstroFlux::NuGenerator::SelectOrigin(), genie::RSPPResonanceSelector::SelectResonance(), genie::flux::GPointSourceAstroFlux::SelectSource(), genie::MECGenerator::SelectSuSALeptonKinematics(), genie::DarkSectorDecayer::SetSpaceTime(), genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::QELKinematicsGenerator::SpectralFuncExperimentalCode(), genie::SRCNuclearRecoil::SRCRecoilPDG(), genie::utils::intranuke2018::ThreeBodyKinematics(), genie::utils::intranuke2025::ThreeBodyKinematics(), genie::utils::intranuke::ThreeBodyKinematics(), genie::utils::intranuke2018::TwoBodyKinematics(), genie::utils::intranuke2025::TwoBodyKinematics(), genie::utils::intranuke::TwoBodyKinematics(), genie::hnl::Decayer::UnpolarisedDecay(), genie::GLRESWdecPythia6::Wdecay(), genie::GLRESWdecPythia8::Wdecay(), genie::PhotonCOHWdecPythia6::Wdecay(), genie::PhotonCOHWdecPythia8::Wdecay(), genie::PhotonRESWdecPythia6::Wdecay(), and genie::PhotonRESWdecPythia8::Wdecay().

◆ RndDec()

◆ RndEvg()

TRandom3 & genie::RandomGen::RndEvg ( void ) const
inline

rnd number generator used by the event generation drivers

Definition at line 74 of file RandomGen.h.

74{ return *fRandom3; }

References fRandom3.

Referenced by genie::GMCJDriver::GenerateEvent1Try(), genie::evtlib::EventLibraryInterface::ProcessEventRecord(), SelectInitState(), and SetSeed().

◆ RndFlux()

◆ RndFsi()

TRandom3 & genie::RandomGen::RndFsi ( void ) const
inline

rnd number generator used by intranuclear cascade monte carlos

Definition at line 59 of file RandomGen.h.

59{ return *fRandom3; }

References fRandom3.

Referenced by genie::HNIntranuke2018::AbsorbHN(), genie::HNIntranuke2025::AbsorbHN(), genie::HNIntranuke2018::ElasHN(), genie::HNIntranuke2025::ElasHN(), genie::utils::intranuke2018::Equilibrium(), genie::utils::intranuke2025::Equilibrium(), genie::utils::intranuke::Equilibrium(), genie::HNIntranuke2018::GammaInelasticHN(), genie::HNIntranuke2025::GammaInelasticHN(), genie::NucleonDecayPrimaryVtxGenerator::GenerateDecayedNucleonPosition(), genie::NNBarOscPrimaryVtxGenerator::GenerateOscillatingNeutronPosition(), genie::Intranuke2018::GenerateStep(), genie::Intranuke2025::GenerateStep(), genie::Intranuke::GenerateStep(), genie::Intranuke2018::GenerateVertex(), genie::Intranuke2025::GenerateVertex(), genie::Intranuke::GenerateVertex(), genie::VertexGenerator::GenerateVertex(), genie::HAIntranuke2018::HadronFateHA(), genie::HAIntranuke2025::HadronFateHA(), genie::HAIntranuke::HadronFateHA(), genie::HNIntranuke2018::HadronFateHN(), genie::HNIntranuke2025::HadronFateHN(), genie::HNIntranuke2018::HadronFateOset(), genie::HNIntranuke2025::HadronFateOset(), genie::HAIntranuke2018::Inelastic(), genie::HAIntranuke2025::Inelastic(), genie::HAIntranuke::Inelastic(), genie::HAIntranuke2018::InelasticHA(), genie::HAIntranuke2025::InelasticHA(), genie::HAIntranuke::InelasticHA(), genie::INukeHadroData2018::IntBounce(), genie::INukeHadroData2025::IntBounce(), genie::INukeHadroData::IntBounce(), genie::utils::intranuke2018::PhaseSpaceDecay(), genie::utils::intranuke2025::PhaseSpaceDecay(), genie::utils::intranuke::PhaseSpaceDecay(), genie::HAIntranuke2018::PiBounce(), genie::HAIntranuke2025::PiBounce(), genie::HAIntranuke::PiBounce(), genie::utils::intranuke2018::PionProduction(), genie::utils::intranuke2025::PionProduction(), genie::utils::intranuke::PionProduction(), genie::HAIntranuke2018::PnBounce(), genie::HAIntranuke2025::PnBounce(), genie::HAIntranuke::PnBounce(), genie::utils::intranuke2018::PreEquilibrium(), genie::utils::intranuke2025::PreEquilibrium(), genie::utils::intranuke::PreEquilibrium(), genie::INukeDeltaPropg::ProcessEventRecord(), SetSeed(), genie::utils::intranuke2018::ThreeBodyKinematics(), genie::utils::intranuke2025::ThreeBodyKinematics(), genie::utils::intranuke::ThreeBodyKinematics(), genie::utils::intranuke2018::TwoBodyKinematics(), genie::utils::intranuke2025::TwoBodyKinematics(), and genie::utils::intranuke::TwoBodyKinematics().

◆ RndGen()

◆ RndGeom()

TRandom3 & genie::RandomGen::RndGeom ( void ) const
inline

rnd number generator used by geometry drivers

Definition at line 68 of file RandomGen.h.

68{ return *fRandom3; }

References fRandom3.

Referenced by genie::geometry::ROOTGeomAnalyzer::GenBoxRay(), GeneratePosition(), genie::geometry::ROOTGeomAnalyzer::GenerateVertex(), and SetSeed().

◆ RndHadro()

◆ RndISel()

TRandom3 & genie::RandomGen::RndISel ( void ) const
inline

rnd number generator used by interaction selectors

Definition at line 65 of file RandomGen.h.

65{ return *fRandom3; }

References fRandom3.

Referenced by genie::PhysInteractionSelector::SelectInteraction(), genie::ToyInteractionSelector::SelectInteraction(), and SetSeed().

◆ RndKine()

TRandom3 & genie::RandomGen::RndKine ( void ) const
inline

rnd number generator used by kinematics generators

Random number generators used by various GENIE modules. (See note at http://root.cern.ch/root/html//TRandom.html on using several TRandom objects each with each own "independent" run sequence).

At this point, since the actual random number generator periodicity is very high, all the generators are in fact one! However, the option to use many generators is reserved.

Currently, the preferred generator is the "Mersenne Twister" with a periodicity of 10**6000 See: http://root.cern.ch/root/html/TRandom3.html

Definition at line 50 of file RandomGen.h.

50{ return *fRandom3; }

References fRandom3.

Referenced by genie::AMNuGammaGenerator::AddPhoton(), genie::COHKinematicsGenerator::CalculateKin_AlvarezRuso(), genie::SKKinematicsGenerator::CalculateKin_AtharSingleKaon(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgal(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgalFM(), genie::COHKinematicsGenerator::CalculateKin_ReinSehgal(), genie::CEvNSEventGenerator::GenerateKinematics(), genie::COHDNuEventGenerator::GenerateKinematics(), genie::DFRKinematicsGenerator::ProcessEventRecord(), genie::DISKinematicsGenerator::ProcessEventRecord(), genie::DMDISKinematicsGenerator::ProcessEventRecord(), genie::DMEKinematicsGenerator::ProcessEventRecord(), genie::DMELEventGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::HEDISKinematicsGenerator::ProcessEventRecord(), genie::HELeptonKinematicsGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::NuEKinematicsGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::RESKinematicsGenerator::ProcessEventRecord(), genie::SPPEventGenerator::ProcessEventRecord(), genie::MECGenerator::SelectEmpiricalKinematics(), genie::QELEventGeneratorSuSA::SelectLeptonKinematics(), genie::MECGenerator::SelectNSVLeptonKinematics(), genie::MECGenerator::SelectSuSALeptonKinematics(), SetSeed(), genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode(), and genie::QELKinematicsGenerator::SpectralFuncExperimentalCode().

◆ RndLep()

◆ RndNum()

TRandom3 & genie::RandomGen::RndNum ( void ) const
inline

rnd number generator used by MC integrators & other numerical methods

Definition at line 77 of file RandomGen.h.

77{ return *fRandom3; }

References fRandom3.

Referenced by genie::NNBarOscPrimaryVtxGenerator::GenerateDecayProducts(), SelectAnnihilationMode(), and SetSeed().

◆ SetSeed()

void genie::RandomGen::SetSeed ( long int seed)

Definition at line 85 of file RandomGen.cxx.

86{
87 LOG("Rndm", pNOTICE)
88 << "Setting"
89 << ((fInitalized) ? " " : " default ")
90 << "random number seed"
91 << ((fInitalized) ? ": " : " at random number generator initialization: ")
92 << seed;
93
94 // Set the seed number for all internal GENIE random number generators
95 this->RndKine ().SetSeed(seed);
96 this->RndHadro().SetSeed(seed);
97 this->RndDec ().SetSeed(seed);
98 this->RndFsi ().SetSeed(seed);
99 this->RndLep ().SetSeed(seed);
100 this->RndISel ().SetSeed(seed);
101 this->RndGeom ().SetSeed(seed);
102 this->RndFlux ().SetSeed(seed);
103 this->RndEvg ().SetSeed(seed);
104 this->RndNum ().SetSeed(seed);
105 this->RndGen ().SetSeed(seed);
106
107 // Set the seed number for ROOT's gRandom
108 gRandom ->SetSeed (seed);
109
110#ifdef __GENIE_PYTHIA6_ENABLED__
111 // Set the PYTHIA6 seed number
112 TPythia6 * pythia6 = TPythia6::Instance();
113 pythia6->SetMRPY(1, seed);
114#endif
115
116 LOG("Rndm", pINFO) << "RndKine seed = " << this->RndKine ().GetSeed();
117 LOG("Rndm", pINFO) << "RndHadro seed = " << this->RndHadro().GetSeed();
118 LOG("Rndm", pINFO) << "RndDec seed = " << this->RndDec ().GetSeed();
119 LOG("Rndm", pINFO) << "RndFsi seed = " << this->RndFsi ().GetSeed();
120 LOG("Rndm", pINFO) << "RndLep seed = " << this->RndLep ().GetSeed();
121 LOG("Rndm", pINFO) << "RndISel seed = " << this->RndISel ().GetSeed();
122 LOG("Rndm", pINFO) << "RndGeom seed = " << this->RndGeom ().GetSeed();
123 LOG("Rndm", pINFO) << "RndFlux seed = " << this->RndFlux ().GetSeed();
124 LOG("Rndm", pINFO) << "RndEvg seed = " << this->RndEvg ().GetSeed();
125 LOG("Rndm", pINFO) << "RndNum seed = " << this->RndNum ().GetSeed();
126 LOG("Rndm", pINFO) << "RndGen seed = " << this->RndGen ().GetSeed();
127 LOG("Rndm", pINFO) << "gRandom seed = " << gRandom->GetSeed();
128#ifdef __GENIE_PYTHIA6_ENABLED__
129 LOG("Rndm", pINFO) << "PYTHIA6 seed = " << pythia6->GetMRPY(1);
130#endif
131}
#define pNOTICE
Definition Messenger.h:61
TRandom3 & RndGeom(void) const
rnd number generator used by geometry drivers
Definition RandomGen.h:68
TRandom3 & RndEvg(void) const
rnd number generator used by the event generation drivers
Definition RandomGen.h:74
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
Definition RandomGen.h:53
TRandom3 & RndLep(void) const
rnd number generator used by final state primary lepton generators
Definition RandomGen.h:62
TRandom3 & RndDec(void) const
rnd number generator used by decay models
Definition RandomGen.h:56
TRandom3 & RndISel(void) const
rnd number generator used by interaction selectors
Definition RandomGen.h:65
TRandom3 & RndFlux(void) const
rnd number generator used by flux drivers
Definition RandomGen.h:71
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
Definition RandomGen.h:59
TRandom3 & RndKine(void) const
rnd number generator used by kinematics generators
Definition RandomGen.h:50
TRandom3 & RndGen(void) const
rnd number generator for generic usage
Definition RandomGen.h:80
TRandom3 & RndNum(void) const
rnd number generator used by MC integrators & other numerical methods
Definition RandomGen.h:77

References fInitalized, LOG, pINFO, pNOTICE, RndDec(), RndEvg(), RndFlux(), RndFsi(), RndGen(), RndGeom(), RndHadro(), RndISel(), RndKine(), RndLep(), and RndNum().

Referenced by genie::NNBarOscPrimaryVtxGenerator::GenerateDecayProducts(), InitRandomGenerators(), genie::utils::app_init::RandGen(), and SelectAnnihilationMode().

◆ Cleaner

friend struct Cleaner
friend

Definition at line 109 of file RandomGen.h.

Member Data Documentation

◆ fCurrSeed

long int genie::RandomGen::fCurrSeed
private

random number generator seed number

Definition at line 94 of file RandomGen.h.

Referenced by GetSeed(), and RandomGen().

◆ fInitalized

bool genie::RandomGen::fInitalized
private

done initializing singleton?

Definition at line 95 of file RandomGen.h.

Referenced by RandomGen(), and SetSeed().

◆ fInstance

RandomGen * genie::RandomGen::fInstance = 0
staticprivate

Definition at line 91 of file RandomGen.h.

Referenced by Instance(), RandomGen(), genie::RandomGen::Cleaner::~Cleaner(), and ~RandomGen().

◆ fRandom3

TRandom3* genie::RandomGen::fRandom3
private

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