Skip to content

Commit 73e92f6

Browse files
authored
Add files via upload
1 parent de773b0 commit 73e92f6

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,8 @@ struct AnalysisDileptonTrack {
20672067
Configurable<int> fConfigMixingDepth{"cfgMixingDepth", 5, "Event mixing pool depth"};
20682068
Configurable<bool> fConfigPublishTripletTable{"cfgPublishTripletTable", false, "Publish the triplet tables, BmesonCandidates"};
20692069
Configurable<bool> fConfigApplyMassEC{"cfgApplyMassEC", false, "Apply fit mass for sideband for the energy correlator study"};
2070-
Configurable<float> fConfigSavelessevents{"cfgSavelessevents", -1.0, "Save less events for the energy correlator study"};
2070+
Configurable<std::vector<int>> fConfigSavelessevents{"cfgSavelessevents", std::vector<int>{1, 0}, "Save less events for the energy correlator study"};
2071+
// Configurable<int> fConfigSavelessevents{"cfgSavelessevents", 1, "Save less events for the energy correlator study"};
20712072
} fConfigOptions;
20722073

20732074
struct : ConfigurableGroup {
@@ -2792,12 +2793,8 @@ struct AnalysisDileptonTrack {
27922793
if (!event.isEventSelected_bit(0)) {
27932794
continue;
27942795
}
2795-
std::hash<uint64_t> hasher;
2796-
size_t seed = hasher(static_cast<uint64_t>(event.globalIndex()));
2797-
std::mt19937 gen(seed);
2798-
std::uniform_real_distribution<float> dist(0.0, 1.0);
2799-
float randomVal = dist(gen);
2800-
if (randomVal < fConfigOptions.fConfigSavelessevents)
2796+
std::vector<int> fSavelessevents = fConfigOptions.fConfigSavelessevents;
2797+
if (fSavelessevents[0] > 1 && event.globalIndex() % fSavelessevents[0] == fSavelessevents[1])
28012798
continue;
28022799
auto groupedBarrelAssocs = assocs.sliceBy(trackAssocsPerCollision, event.globalIndex());
28032800
// groupedBarrelAssocs.bindInternalIndicesTo(&assocs);
@@ -2992,12 +2989,8 @@ struct AnalysisDileptonTrack {
29922989
if (!event.has_mcCollision()) {
29932990
continue;
29942991
}
2995-
std::hash<uint64_t> hasher;
2996-
size_t seed = hasher(static_cast<uint64_t>(event.globalIndex()));
2997-
std::mt19937 gen(seed);
2998-
std::uniform_real_distribution<float> dist(0.0, 1.0);
2999-
float randomVal = dist(gen);
3000-
if (randomVal < fConfigOptions.fConfigSavelessevents)
2992+
std::vector<int> fSavelessevents = fConfigOptions.fConfigSavelessevents;
2993+
if (fSavelessevents[0] > 1 && event.globalIndex() % fSavelessevents[0] == fSavelessevents[1])
30012994
continue;
30022995
runEnergyCorrelators<VarManager::kJpsiHadronMass>(event, mcTracks);
30032996
}

0 commit comments

Comments
 (0)