Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions EventMixing/src/MixBackgroundFrames_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,9 @@ namespace mu2e {
Comment("control the level of debug output"),
0u
};
Atom<int> minSkip { Name("minSkip"),
Comment("minimum number of background events to skip at the start of a file"),
0
};
Atom<int> maxSkip { Name("maxSkip"),
Comment("maximum number of background events to skip at the start of a file"),
10000
Atom<float> skipFactor { Name("skipFactor"),
Comment("mixer will skip a number of background events between 0 and this numberr multiplied by meanEventsPerProton and PBI intensity at the start of each secondary input file."),
1
};
};

Expand Down Expand Up @@ -96,8 +92,7 @@ namespace mu2e {

ProtonBunchIntensity pbi_;
int totalBkgCount_;
int minSkip_;
int maxSkip_;
float skipFactor_;

public:
MixBackgroundFramesDetail(const fhicl::ParameterSet& pset, art::MixHelper &helper);
Expand All @@ -120,8 +115,7 @@ namespace mu2e {
, engine_{helper.createEngine(art::ServiceHandle<SeedService>()->getSeed())}
, urbg_{ engine_ }
, totalBkgCount_(0)
, minSkip_{ retrieveConfiguration("mu2e", pset).minSkip() }
, maxSkip_{ retrieveConfiguration("mu2e", pset).maxSkip() }
, skipFactor_{ retrieveConfiguration("mu2e", pset).skipFactor() }
{}

//================================================================
Expand All @@ -142,7 +136,7 @@ namespace mu2e {
//================================================================
size_t MixBackgroundFramesDetail::eventsToSkip() {
//FIXME: Ideally, we would know the number of events in the secondary input file
std::uniform_int_distribution<size_t> uniform(minSkip_, maxSkip_);
std::uniform_int_distribution<size_t> uniform(0, skipFactor_*meanEventsPerProton_*pbi_.intensity());
size_t result = uniform(urbg_);
if(debugLevel_ > 0) {
std::cout << " Skipping " << result << " Secondaries " << std::endl;
Expand Down
3 changes: 1 addition & 2 deletions JobConfig/mixing/prolog.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ mixerTemplateCommon: {
protonBunchIntensityTag: "protonBunchIntensity"
meanEventsPerProton: @nil
products: @nil
minSkip : 0
maxSkip : 1000 # temporary
skipFactor : 1 # temporary
}
}

Expand Down