diff --git a/Source/Generators/LMCCavitySignalGenerator.cc b/Source/Generators/LMCCavitySignalGenerator.cc index c4946163..945afec9 100644 --- a/Source/Generators/LMCCavitySignalGenerator.cc +++ b/Source/Generators/LMCCavitySignalGenerator.cc @@ -316,7 +316,6 @@ namespace locust fInterface->aRunParameter->fSamplingRateMHz = fAcquisitionRate; fInterface->aRunParameter->fDecimationFactor = aSignal->DecimationFactor(); fInterface->aRunParameter->fLOfrequency = fLO_Frequency; - fInterface->aRunParameter->fRandomSeed = fTrackDelaySeed; #endif return true; } diff --git a/Source/IO/LMCEvent.cc b/Source/IO/LMCEvent.cc index 9dc8b0ca..a88e65db 100644 --- a/Source/IO/LMCEvent.cc +++ b/Source/IO/LMCEvent.cc @@ -23,7 +23,7 @@ namespace locust } Event::~Event() {} - bool Event::Initialize() + bool Event::Initialize(long int aSeed) { time_t rawtime; struct tm * timeInfo; @@ -39,9 +39,8 @@ namespace locust int tMicrosec = tv.tv_usec; fEventID = 1e12 + tDay*1e10 + tMonth*1e8 + tYear*1e6 + tMicrosec; - fRandomSeed = -99; + fRandomSeed = aSeed; fLOFrequency = -99.; - fRandomSeed = -99; return true; } @@ -65,11 +64,8 @@ namespace locust fRadii.push_back( aTrack->Radius ); fRadialPhases.push_back( aTrack->RadialPhase ); - // Update size. And, record fLOFrequency for compatibility with previous work. The LO frequency is - // now also recorded in the RunParameters Tree. + // Update size. fNTracks = fStartFrequencies.size(); - fLOFrequency = aTrack->LOFrequency; - fRandomSeed = aTrack->RandomSeed; } void Event::AddTrack(const Track aTrack) // Phase II structure diff --git a/Source/IO/LMCEvent.hh b/Source/IO/LMCEvent.hh index 3169bb42..9591b614 100644 --- a/Source/IO/LMCEvent.hh +++ b/Source/IO/LMCEvent.hh @@ -32,13 +32,13 @@ namespace locust Event(); virtual ~Event(); - bool Initialize(); + bool Initialize(long int aSeed); void AddTrack(const Track* aTrack); void AddTrack(const Track aTrack); long int fEventID; double fLOFrequency; - int fRandomSeed; + long int fRandomSeed; std::vector fTrackIDs; std::vector fStartingEnergies_eV; diff --git a/Source/IO/LMCRootTreeWriter.cc b/Source/IO/LMCRootTreeWriter.cc index c95fc673..be36ba11 100644 --- a/Source/IO/LMCRootTreeWriter.cc +++ b/Source/IO/LMCRootTreeWriter.cc @@ -69,7 +69,7 @@ namespace locust aTree->Branch("TrackLengths", "std::vector", &anEvent->fTrackLengths); aTree->Branch("Slopes", "std::vector", &anEvent->fSlopes); aTree->Branch("LOFrequency", &anEvent->fLOFrequency, "LOFrequency/D"); - aTree->Branch("RandomSeed", &anEvent->fRandomSeed, "RandomSeed/I"); + aTree->Branch("RandomSeed", &anEvent->fRandomSeed, "RandomSeed/L"); aTree->Branch("TrackPower", "std::vector", &anEvent->fTrackPowers); aTree->Branch("PitchAngles", "std::vector", &anEvent->fPitchAngles); aTree->Branch("Radii", "std::vector", &anEvent->fRadii); diff --git a/Source/IO/LMCRunParameters.hh b/Source/IO/LMCRunParameters.hh index d7301ed4..867202de 100644 --- a/Source/IO/LMCRunParameters.hh +++ b/Source/IO/LMCRunParameters.hh @@ -30,7 +30,6 @@ namespace locust double fLOfrequency; double fSamplingRateMHz; double fDecimationFactor; - int fRandomSeed; ClassDef(RunParameters,1) // Root syntax. diff --git a/Source/IO/LMCTrack.cc b/Source/IO/LMCTrack.cc index 70ec7d7c..dfe53181 100644 --- a/Source/IO/LMCTrack.cc +++ b/Source/IO/LMCTrack.cc @@ -24,7 +24,6 @@ namespace locust bool Track::Initialize() { TrackID += 1; - RandomSeed = -99.; StartTime = -99.; EndTime = -99.; TrackLength = -99.; @@ -35,7 +34,6 @@ namespace locust AvgFrequency = 0.; OutputAvgFrequency = 0.; AvgAxialFrequency = 0.; - LOFrequency = -99.; TrackPower = -99.; Slope = -99.; PitchAngle = -99.; diff --git a/Source/IO/LMCTrack.hh b/Source/IO/LMCTrack.hh index 3490ca4e..e9d5f722 100644 --- a/Source/IO/LMCTrack.hh +++ b/Source/IO/LMCTrack.hh @@ -30,7 +30,6 @@ namespace locust virtual ~Track(); bool Initialize(); int TrackID; - int RandomSeed = -99.; double StartTime = -99.; double EndTime = -99.; double TrackLength = -99.; diff --git a/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc b/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc index 8e982437..3fc6db83 100644 --- a/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc +++ b/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc @@ -149,8 +149,6 @@ namespace locust fInterface->aTrack->StartFrequency = aFinalParticle.GetCyclotronFrequency(); double tLOfrequency = fInterface->aRunParameter->fLOfrequency; // Hz double tSamplingRate = fInterface->aRunParameter->fSamplingRateMHz; // MHz - fInterface->aTrack->LOFrequency = tLOfrequency; - fInterface->aTrack->RandomSeed = fInterface->aRunParameter->fRandomSeed; fInterface->aTrack->OutputStartFrequency = fInterface->aTrack->StartFrequency - tLOfrequency + tSamplingRate * 1.e6 / 2.; #endif } diff --git a/Source/Kassiopeia/LMCEventHold.cc b/Source/Kassiopeia/LMCEventHold.cc index 7833b101..bf343299 100644 --- a/Source/Kassiopeia/LMCEventHold.cc +++ b/Source/Kassiopeia/LMCEventHold.cc @@ -18,6 +18,7 @@ namespace locust fTruthOutputFilename("LocustEventProperties.root"), fAccumulateTruthInfo( false ), fConfigurationComplete( false ), + fEventSeed( 0 ), fInterface( KLInterfaceBootstrapper::get_instance()->GetInterface() ) { } @@ -26,6 +27,7 @@ namespace locust fTruthOutputFilename("LocustEventProperties.root"), fAccumulateTruthInfo( false ), fConfigurationComplete( false ), + fEventSeed( 0 ), fInterface( aOrig.fInterface ) { } @@ -71,7 +73,11 @@ namespace locust { if ( aParam.has( "random-track-seed" ) ) { - fInterface->anEvent->fRandomSeed = aParam["random-track-seed"]().as_int(); + fEventSeed = aParam["random-track-seed"]().as_int(); + } + else + { + fEventSeed = -99; } if ( aParam.has( "truth-output-filename" ) ) { @@ -92,7 +98,7 @@ namespace locust { #ifdef ROOT_FOUND fInterface->anEvent = new Event(); - fInterface->anEvent->Initialize(); + fInterface->anEvent->Initialize( fEventSeed ); fInterface->aTrack = new Track(); fInterface->aTrack->Initialize(); #endif diff --git a/Source/Kassiopeia/LMCEventHold.hh b/Source/Kassiopeia/LMCEventHold.hh index da159df6..5d490394 100644 --- a/Source/Kassiopeia/LMCEventHold.hh +++ b/Source/Kassiopeia/LMCEventHold.hh @@ -11,6 +11,7 @@ #include "KSEventModifier.h" #include "KSComponentTemplate.h" + #include "LMCKassLocustInterface.hh" #ifdef ROOT_FOUND @@ -49,6 +50,7 @@ namespace locust private: bool fConfigurationComplete; + long int fEventSeed; };