From 1caf978e73d6ba6d905ee408db1d1703b7cf7d4e Mon Sep 17 00:00:00 2001 From: Penny Slocum Date: Mon, 16 Sep 2024 21:00:21 -0400 Subject: [PATCH 1/7] Increment track ID for each track in an event. --- Source/IO/LMCTrack.cc | 5 +++-- Source/IO/LMCTrack.hh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/IO/LMCTrack.cc b/Source/IO/LMCTrack.cc index 390cdd54..70ec7d7c 100644 --- a/Source/IO/LMCTrack.cc +++ b/Source/IO/LMCTrack.cc @@ -12,7 +12,8 @@ ClassImp(locust::Track); namespace locust { - Track::Track() + Track::Track() : + TrackID( -2 ) { } @@ -22,7 +23,7 @@ namespace locust bool Track::Initialize() { - EventID = -99; + TrackID += 1; RandomSeed = -99.; StartTime = -99.; EndTime = -99.; diff --git a/Source/IO/LMCTrack.hh b/Source/IO/LMCTrack.hh index 353bd01f..3490ca4e 100644 --- a/Source/IO/LMCTrack.hh +++ b/Source/IO/LMCTrack.hh @@ -29,7 +29,7 @@ namespace locust Track(); virtual ~Track(); bool Initialize(); - int EventID = -99; + int TrackID; int RandomSeed = -99.; double StartTime = -99.; double EndTime = -99.; From 4c8629d0c5a758ac3b999992d1ebc8087211e77b Mon Sep 17 00:00:00 2001 From: Penny Slocum Date: Mon, 16 Sep 2024 21:17:33 -0400 Subject: [PATCH 2/7] Define event ID in terms of date/time stamp and additional flag. Also define new TTree structure for event properties in PIII simulation. --- Source/IO/LMCEvent.cc | 57 +++++++++++++++++-- Source/IO/LMCEvent.hh | 10 +++- Source/IO/LMCRootTreeWriter.cc | 9 +-- .../LMCCyclotronRadiationExtractor.cc | 32 +++++------ Source/Kassiopeia/LMCEventHold.cc | 13 +++-- Source/Kassiopeia/LMCKassLocustInterface.hh | 2 +- Source/Kassiopeia/LMCTrackHold.cc | 2 +- 7 files changed, 90 insertions(+), 35 deletions(-) diff --git a/Source/IO/LMCEvent.cc b/Source/IO/LMCEvent.cc index 453436f9..9dc8b0ca 100644 --- a/Source/IO/LMCEvent.cc +++ b/Source/IO/LMCEvent.cc @@ -23,7 +23,56 @@ namespace locust } Event::~Event() {} - void Event::AddTrack(const Track aTrack) + bool Event::Initialize() + { + time_t rawtime; + struct tm * timeInfo; + time (&rawtime); + timeInfo = localtime (&rawtime); + + struct timeval tv; + gettimeofday(&tv, NULL); + + int tDay = timeInfo->tm_mday; + int tMonth = timeInfo->tm_mon + 1; + int tYear = timeInfo->tm_year - 100; + int tMicrosec = tv.tv_usec; + + fEventID = 1e12 + tDay*1e10 + tMonth*1e8 + tYear*1e6 + tMicrosec; + fRandomSeed = -99; + fLOFrequency = -99.; + fRandomSeed = -99; + return true; + } + + + void Event::AddTrack(const Track* aTrack) // Phase III structure + { + fTrackIDs.push_back( aTrack->TrackID ); + fStartingEnergies_eV.push_back( aTrack->StartingEnergy_eV ); + fOutputStartFrequencies.push_back( aTrack->OutputStartFrequency ); + fStartFrequencies.push_back( aTrack->StartFrequency ); + fEndFrequencies.push_back( aTrack->EndFrequency ); + fAvgFrequencies.push_back( aTrack->AvgFrequency ); + fOutputAvgFrequencies.push_back( aTrack->OutputAvgFrequency ); + fAvgAxialFrequencies.push_back( aTrack->AvgAxialFrequency ); + fTrackPowers.push_back( aTrack->TrackPower ); + fStartTimes.push_back( aTrack->StartTime ); + fTrackLengths.push_back( aTrack->TrackLength ); + fEndTimes.push_back( aTrack->EndTime ); + fSlopes.push_back( aTrack->Slope ); + fPitchAngles.push_back( aTrack->PitchAngle ); + 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. + fNTracks = fStartFrequencies.size(); + fLOFrequency = aTrack->LOFrequency; + fRandomSeed = aTrack->RandomSeed; + } + + void Event::AddTrack(const Track aTrack) // Phase II structure { fStartingEnergies_eV.push_back( aTrack.StartingEnergy_eV ); fOutputStartFrequencies.push_back( aTrack.OutputStartFrequency ); @@ -40,11 +89,7 @@ namespace locust fPitchAngles.push_back( aTrack.PitchAngle ); 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. fNTracks = fStartFrequencies.size(); - fLOFrequency = aTrack.LOFrequency; - fRandomSeed = aTrack.RandomSeed; } + } diff --git a/Source/IO/LMCEvent.hh b/Source/IO/LMCEvent.hh index 2202e2d6..3169bb42 100644 --- a/Source/IO/LMCEvent.hh +++ b/Source/IO/LMCEvent.hh @@ -16,6 +16,11 @@ #include "TObject.h" #include "LMCTrack.hh" #include +#include "time.h" +#include + + + namespace locust { @@ -27,12 +32,15 @@ namespace locust Event(); virtual ~Event(); + bool Initialize(); + void AddTrack(const Track* aTrack); void AddTrack(const Track aTrack); - int fEventID; + long int fEventID; double fLOFrequency; int fRandomSeed; + std::vector fTrackIDs; std::vector fStartingEnergies_eV; std::vector fOutputStartFrequencies; std::vector fStartFrequencies; diff --git a/Source/IO/LMCRootTreeWriter.cc b/Source/IO/LMCRootTreeWriter.cc index a0de1899..c95fc673 100644 --- a/Source/IO/LMCRootTreeWriter.cc +++ b/Source/IO/LMCRootTreeWriter.cc @@ -49,13 +49,14 @@ namespace locust void RootTreeWriter::WriteEvent(Event* anEvent) { - char buffer[100]; - int n=sprintf(buffer, "Event_%d", anEvent->fEventID); - char* treename = buffer; + char buffer[100]; + int n=sprintf(buffer, "Event_%ld", anEvent->fEventID); + char* treename = buffer; TTree *aTree = new TTree(treename,"Locust Tree"); - aTree->Branch("EventID", &anEvent->fEventID, "EventID/I"); + aTree->Branch("EventID", &anEvent->fEventID, "EventID/L"); aTree->Branch("ntracks", &anEvent->fNTracks, "ntracks/I"); + aTree->Branch("TrackIDs", "std::vector", &anEvent->fTrackIDs); aTree->Branch("StartingEnergieseV", "std::vector", &anEvent->fStartingEnergies_eV); aTree->Branch("OutputStartFrequencies", "std::vector", &anEvent->fOutputStartFrequencies); aTree->Branch("StartFrequencies", "std::vector", &anEvent->fStartFrequencies); diff --git a/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc b/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc index 78612273..8e982437 100644 --- a/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc +++ b/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc @@ -70,21 +70,21 @@ namespace locust if (bStart) { fStartingIndex = index; - fInterface->aTrack.StartTime = tTime; + fInterface->aTrack->StartTime = tTime; double tX = aFinalParticle.GetPosition().X(); double tY = aFinalParticle.GetPosition().Y(); - fInterface->aTrack.Radius = pow(tX*tX + tY*tY, 0.5); - fInterface->aTrack.RadialPhase = calcOrbitPhase(tX, tY); - fInterface->aTrack.StartingEnergy_eV = LMCConst::kB_eV() / LMCConst::kB() * aFinalParticle.GetKineticEnergy(); + fInterface->aTrack->Radius = pow(tX*tX + tY*tY, 0.5); + fInterface->aTrack->RadialPhase = calcOrbitPhase(tX, tY); + fInterface->aTrack->StartingEnergy_eV = LMCConst::kB_eV() / LMCConst::kB() * aFinalParticle.GetKineticEnergy(); } else { - fInterface->aTrack.EndTime = tTime; + fInterface->aTrack->EndTime = tTime; unsigned nElapsedSamples = index - fStartingIndex; - fInterface->aTrack.AvgFrequency = ( fInterface->aTrack.AvgFrequency * nElapsedSamples + aFinalParticle.GetCyclotronFrequency() ) / ( nElapsedSamples + 1); - fInterface->aTrack.OutputAvgFrequency = fInterface->aTrack.AvgFrequency + tOffset; - fInterface->aTrack.TrackLength = tTime - fInterface->aTrack.StartTime; - fInterface->aTrack.Slope = (fInterface->aTrack.EndFrequency - fInterface->aTrack.StartFrequency) / (fInterface->aTrack.TrackLength); + fInterface->aTrack->AvgFrequency = ( fInterface->aTrack->AvgFrequency * nElapsedSamples + aFinalParticle.GetCyclotronFrequency() ) / ( nElapsedSamples + 1); + fInterface->aTrack->OutputAvgFrequency = fInterface->aTrack->AvgFrequency + tOffset; + fInterface->aTrack->TrackLength = tTime - fInterface->aTrack->StartTime; + fInterface->aTrack->Slope = (fInterface->aTrack->EndFrequency - fInterface->aTrack->StartFrequency) / (fInterface->aTrack->TrackLength); } #endif @@ -145,20 +145,20 @@ namespace locust fPitchAngle = aFinalParticle.GetPolarAngleToB(); fT0trapMin = aFinalParticle.GetTime(); #ifdef ROOT_FOUND - fInterface->aTrack.PitchAngle = aFinalParticle.GetPolarAngleToB(); - fInterface->aTrack.StartFrequency = aFinalParticle.GetCyclotronFrequency(); + fInterface->aTrack->PitchAngle = aFinalParticle.GetPolarAngleToB(); + 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.; + fInterface->aTrack->LOFrequency = tLOfrequency; + fInterface->aTrack->RandomSeed = fInterface->aRunParameter->fRandomSeed; + fInterface->aTrack->OutputStartFrequency = fInterface->aTrack->StartFrequency - tLOfrequency + tSamplingRate * 1.e6 / 2.; #endif } else { #ifdef ROOT_FOUND - fInterface->aTrack.EndFrequency = aFinalParticle.GetCyclotronFrequency(); - fInterface->aTrack.AvgAxialFrequency = fNCrossings / 2. / ( aFinalParticle.GetTime() - fT0trapMin ); + fInterface->aTrack->EndFrequency = aFinalParticle.GetCyclotronFrequency(); + fInterface->aTrack->AvgAxialFrequency = fNCrossings / 2. / ( aFinalParticle.GetTime() - fT0trapMin ); #endif } } diff --git a/Source/Kassiopeia/LMCEventHold.cc b/Source/Kassiopeia/LMCEventHold.cc index ddf22a8d..7833b101 100644 --- a/Source/Kassiopeia/LMCEventHold.cc +++ b/Source/Kassiopeia/LMCEventHold.cc @@ -41,7 +41,6 @@ namespace locust bool EventHold::ConfigureByInterface() { - OpenEvent(); if (!fConfigurationComplete) { @@ -93,11 +92,9 @@ namespace locust { #ifdef ROOT_FOUND fInterface->anEvent = new Event(); - fInterface->anEvent->fEventID = 0; - fInterface->anEvent->fRandomSeed = -99; - fInterface->anEvent->fLOFrequency = -99.; - fInterface->anEvent->fRandomSeed = -99; - fInterface->aTrack.Initialize(); + fInterface->anEvent->Initialize(); + fInterface->aTrack = new Track(); + fInterface->aTrack->Initialize(); #endif return true; @@ -152,6 +149,8 @@ namespace locust return false; } + OpenEvent(); // for recording event properties to file. + LPROG( lmclog, "Kass is waiting for event trigger" ); fInterface->fDigitizerCondition.notify_one(); // unlock if still locked. @@ -180,6 +179,8 @@ namespace locust fInterface->fEventInProgress = false; fInterface->fDigitizerCondition.notify_one(); // unlock LPROG( lmclog, "Kass is waking after event" ); + delete fInterface->anEvent; + delete fInterface->aTrack; return true; } diff --git a/Source/Kassiopeia/LMCKassLocustInterface.hh b/Source/Kassiopeia/LMCKassLocustInterface.hh index 2ef3aad2..c54e5276 100644 --- a/Source/Kassiopeia/LMCKassLocustInterface.hh +++ b/Source/Kassiopeia/LMCKassLocustInterface.hh @@ -75,7 +75,7 @@ namespace locust #ifdef ROOT_FOUND Event* anEvent; - Track aTrack; + Track* aTrack; RunParameters* aRunParameter; #endif diff --git a/Source/Kassiopeia/LMCTrackHold.cc b/Source/Kassiopeia/LMCTrackHold.cc index 09856b63..52f39c72 100644 --- a/Source/Kassiopeia/LMCTrackHold.cc +++ b/Source/Kassiopeia/LMCTrackHold.cc @@ -63,7 +63,7 @@ namespace locust bool TrackHold::ExecutePreTrackModification(Kassiopeia::KSTrack &aTrack) { - fInterface->aTrack.Initialize(); + fInterface->aTrack->Initialize(); fInterface->fNewTrackStarting = true; double tTime = aTrack.GetInitialParticle().GetTime(); From 2396609c0e4b389ad0e2896e67e9c094189162b2 Mon Sep 17 00:00:00 2001 From: Penny Slocum Date: Fri, 20 Sep 2024 14:08:38 -0400 Subject: [PATCH 3/7] Add option to specify absolute path to mode map file. --- Source/Fields/LMCCylindricalCavity.cc | 12 ++++++++++-- Source/Fields/LMCModeMapCavity.cc | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/Fields/LMCCylindricalCavity.cc b/Source/Fields/LMCCylindricalCavity.cc index 000b06bb..e5e4dbef 100644 --- a/Source/Fields/LMCCylindricalCavity.cc +++ b/Source/Fields/LMCCylindricalCavity.cc @@ -100,8 +100,16 @@ namespace locust } if (!fFieldCore->ReadModeMapTE_E((dataDir / aParam["upload-modemap-filename"]().as_string()).string(), aParam)) { - LERROR(lmclog,"There was a problem uploading the mode map."); - exit(-1); + LWARN(lmclog,"The mode map was not in the data/ subdirectory. Trying another path ... "); + if (!fFieldCore->ReadModeMapTE_E(aParam["upload-modemap-filename"]().as_string(), aParam)) + { + LERROR(lmclog, "There was a problem uploading the mode map."); + exit(-1); + } + else + { + LPROG(lmclog, "Reading in the mode map now ..."); + } } SetNormFactors(SetUnityNormFactors(GetNModes(), 0)); // Temporary quick normalization factors of 1.0 } diff --git a/Source/Fields/LMCModeMapCavity.cc b/Source/Fields/LMCModeMapCavity.cc index 6d80212d..3ab5455d 100644 --- a/Source/Fields/LMCModeMapCavity.cc +++ b/Source/Fields/LMCModeMapCavity.cc @@ -82,12 +82,12 @@ namespace locust std::fstream modeMapFile(aFilename.c_str(),std::ios::in); if (modeMapFile.fail()) { - LERROR(lmclog,"The mode map file \"" << aFilename <<"\" was not found."); + LWARN(lmclog,"The mode map file \"" << aFilename <<"\" was not found."); return false; } else { - LWARN(lmclog,"Reading mode map file \"" << aFilename <<"\" ."); + LPROG(lmclog,"Reading mode map file \"" << aFilename <<"\" ."); } fModeMapTE_E.resize(fnPixel1); From 343784884ec8e420764ee034cded43573ce6e9df Mon Sep 17 00:00:00 2001 From: Penny Slocum Date: Fri, 20 Sep 2024 14:08:55 -0400 Subject: [PATCH 4/7] Build on push to feature branch. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0fb64758..8b515c0f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,7 +3,7 @@ name: Build and Test Locust on: pull_request: push: - branches: [master, develop, feature/pileupChecks] + branches: [master, develop, feature/addPaths] tags: ['*'] workflow_dispatch: From 2c82eea862d1a6a7cd21e745e72f0a677c4e9eb4 Mon Sep 17 00:00:00 2001 From: Penny Slocum Date: Fri, 20 Sep 2024 17:04:35 -0400 Subject: [PATCH 5/7] Use the same seed for Locust and Kass, if specified in the config file. --- Source/Kassiopeia/LMCRunPause.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Kassiopeia/LMCRunPause.cc b/Source/Kassiopeia/LMCRunPause.cc index 043225eb..c0865b70 100644 --- a/Source/Kassiopeia/LMCRunPause.cc +++ b/Source/Kassiopeia/LMCRunPause.cc @@ -183,7 +183,17 @@ namespace locust && aParam.has( "ks-starting-energy-min" ) && aParam.has( "ks-starting-energy-max" ) && aParam.has( "ks-starting-pitch-min" ) && aParam.has( "ks-starting-pitch-max" ) ) { - KRandom::GetInstance().SetSeed(time(NULL)); + int tSeed = 0; + if ( aParam.has( "random-track-seed" ) ) + { + tSeed = aParam["random-track-seed"]().as_int(); + KRandom::GetInstance().SetSeed(tSeed); + } + else + { + KRandom::GetInstance().SetSeed(time(NULL)); + } + auto tGen = fToolbox.GetAll(); for (unsigned i=0; i Date: Sat, 21 Sep 2024 15:57:42 -0400 Subject: [PATCH 6/7] Propagate the random-track-seed parameter to Kass and to the truth outputs. If it is not specified, record its default [unused] value. --- Source/Generators/LMCCavitySignalGenerator.cc | 1 - Source/IO/LMCEvent.cc | 10 +++------- Source/IO/LMCEvent.hh | 4 ++-- Source/IO/LMCRootTreeWriter.cc | 2 +- Source/IO/LMCRunParameters.hh | 1 - Source/IO/LMCTrack.cc | 2 -- Source/IO/LMCTrack.hh | 1 - Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc | 2 -- Source/Kassiopeia/LMCEventHold.cc | 10 ++++++++-- Source/Kassiopeia/LMCEventHold.hh | 2 ++ 10 files changed, 16 insertions(+), 19 deletions(-) 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; }; From e1317d493a990d5381d7b05c676fafa76d405367 Mon Sep 17 00:00:00 2001 From: Penny Slocum Date: Mon, 23 Sep 2024 11:59:54 -0400 Subject: [PATCH 7/7] Remove build on push to feature branch. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8b515c0f..592aedda 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,7 +3,7 @@ name: Build and Test Locust on: pull_request: push: - branches: [master, develop, feature/addPaths] + branches: [master, develop] tags: ['*'] workflow_dispatch: