Skip to content

Commit

Permalink
Use LMCUniformDistribution for track start delay randomization.
Browse files Browse the repository at this point in the history
  • Loading branch information
pslocum committed Apr 4, 2024
1 parent 216c679 commit 0882682
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Generators/LMCCavitySignalGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,11 @@ namespace locust

bool CavitySignalGenerator::RandomizeStartDelay()
{
srand ( fTrackDelaySeed );
int tNPreEventSamples = fNPreEventSamples/10 * ( rand() % 10 );
scarab::param_node default_setting;
default_setting.add("name","uniform");
fStartDelayDistribution = fDistributionInterface.get_dist(default_setting);
fDistributionInterface.SetSeed( fTrackDelaySeed );
int tNPreEventSamples = fNPreEventSamples * fStartDelayDistribution->Generate();
LPROG(lmclog,"Randomizing the start delay to " << tNPreEventSamples << " fast samples.");
fNPreEventSamples = tNPreEventSamples;

Expand Down
4 changes: 4 additions & 0 deletions Source/Generators/LMCCavitySignalGenerator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "LMCTFFileHandler.hh"
#include "LMCCavityUtility.hh"
#include "LMCAliasingUtility.hh"
#include "LMCDistributionInterface.hh"
#include <vector>
#include <sstream>
#include <string>
Expand Down Expand Up @@ -134,6 +135,9 @@ namespace locust

const scarab::param_node* fParam;

std::shared_ptr< BaseDistribution> fStartDelayDistribution;
DistributionInterface fDistributionInterface;


};

Expand Down

0 comments on commit 0882682

Please sign in to comment.