Skip to content

Commit 2e82f56

Browse files
fcolamarfcolamaralibuild
authored
[PWGHF] Add option to fill ME tables of Lc-h in a fraction of events (#10009)
Co-authored-by: fcolamar <fabio.colamaria@cern.ch> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 1ae4ee5 commit 2e82f56

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
/// \author Ravindra Singh <ravindra.singh@cern.ch>
1818

1919
#include <vector>
20+
#include "TRandom3.h"
2021

2122
#include "CommonConstants/PhysicsConstants.h"
2223
#include "Framework/AnalysisTask.h"
@@ -201,12 +202,14 @@ struct HfCorrelatorLcHadrons {
201202
Configurable<bool> calTrkEff{"calTrkEff", false, "fill histograms to calculate efficiency"};
202203
Configurable<bool> isRecTrkPhyPrimary{"isRecTrkPhyPrimary", true, "Calculate the efficiency of reconstructed primary physical tracks"};
203204
Configurable<bool> calEffLcEvent{"calEffLcEvent", true, "Calculate the efficiency of Lc candidate"};
205+
Configurable<float> eventFractionToAnalyze{"eventFractionToAnalyze", -1, "Fraction of events to analyze (use only for ME offline on very large samples)"};
204206

205207
HfHelper hfHelper;
206208
SliceCache cache;
207209
Service<o2::framework::O2DatabasePDG> pdg;
208210
int leadingIndex = 0;
209211
bool correlationStatus = false;
212+
TRandom3* rnd = new TRandom3(0);
210213

211214
// Event Mixing for the Data Mode
212215
using SelCollisionsWithLc = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::LcSelection>>;
@@ -330,6 +333,13 @@ struct HfCorrelatorLcHadrons {
330333
return;
331334
}
332335

336+
bool skipMixedEventTableFilling = false;
337+
if (eventFractionToAnalyze > 0) {
338+
if (rnd->Uniform(0, 1) > eventFractionToAnalyze) {
339+
skipMixedEventTableFilling = true;
340+
}
341+
}
342+
333343
// find leading particle
334344
if (correlateLcWithLeadingParticle) {
335345
leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value);
@@ -394,7 +404,9 @@ struct HfCorrelatorLcHadrons {
394404
outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)];
395405
}
396406
entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore
397-
entryLc(candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassLcToPiKP(candidate), poolBin, gCollisionId, timeStamp);
407+
if (!skipMixedEventTableFilling) {
408+
entryLc(candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassLcToPiKP(candidate), poolBin, gCollisionId, timeStamp);
409+
}
398410
}
399411

400412
// Lc-Hadron correlation dedicated section
@@ -450,11 +462,13 @@ struct HfCorrelatorLcHadrons {
450462
}
451463
}
452464
if (countLc == 0) {
453-
entryHadron(track.phi(), track.eta(), track.pt() * track.sign(), poolBin, gCollisionId, timeStamp);
454-
if (fillTrkPID) {
455-
entryTrkPID(track.tpcNSigmaPr(), track.tpcNSigmaKa(), track.tpcNSigmaPi(), track.tofNSigmaPr(), track.tofNSigmaKa(), track.tofNSigmaPi());
465+
if (!skipMixedEventTableFilling) {
466+
entryHadron(track.phi(), track.eta(), track.pt() * track.sign(), poolBin, gCollisionId, timeStamp);
467+
if (fillTrkPID) {
468+
entryTrkPID(track.tpcNSigmaPr(), track.tpcNSigmaKa(), track.tpcNSigmaPi(), track.tofNSigmaPr(), track.tofNSigmaKa(), track.tofNSigmaPi());
469+
}
470+
registry.fill(HIST("hTracksBin"), poolBin);
456471
}
457-
registry.fill(HIST("hTracksBin"), poolBin);
458472
}
459473
} // Hadron Tracks loop
460474
countLc++;

0 commit comments

Comments
 (0)