|
17 | 17 | /// \author Ravindra Singh <ravindra.singh@cern.ch> |
18 | 18 |
|
19 | 19 | #include <vector> |
| 20 | +#include "TRandom3.h" |
20 | 21 |
|
21 | 22 | #include "CommonConstants/PhysicsConstants.h" |
22 | 23 | #include "Framework/AnalysisTask.h" |
@@ -201,12 +202,14 @@ struct HfCorrelatorLcHadrons { |
201 | 202 | Configurable<bool> calTrkEff{"calTrkEff", false, "fill histograms to calculate efficiency"}; |
202 | 203 | Configurable<bool> isRecTrkPhyPrimary{"isRecTrkPhyPrimary", true, "Calculate the efficiency of reconstructed primary physical tracks"}; |
203 | 204 | 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)"}; |
204 | 206 |
|
205 | 207 | HfHelper hfHelper; |
206 | 208 | SliceCache cache; |
207 | 209 | Service<o2::framework::O2DatabasePDG> pdg; |
208 | 210 | int leadingIndex = 0; |
209 | 211 | bool correlationStatus = false; |
| 212 | + TRandom3* rnd = new TRandom3(0); |
210 | 213 |
|
211 | 214 | // Event Mixing for the Data Mode |
212 | 215 | using SelCollisionsWithLc = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::LcSelection>>; |
@@ -330,6 +333,13 @@ struct HfCorrelatorLcHadrons { |
330 | 333 | return; |
331 | 334 | } |
332 | 335 |
|
| 336 | + bool skipMixedEventTableFilling = false; |
| 337 | + if (eventFractionToAnalyze > 0) { |
| 338 | + if (rnd->Uniform(0, 1) > eventFractionToAnalyze) { |
| 339 | + skipMixedEventTableFilling = true; |
| 340 | + } |
| 341 | + } |
| 342 | + |
333 | 343 | // find leading particle |
334 | 344 | if (correlateLcWithLeadingParticle) { |
335 | 345 | leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); |
@@ -394,7 +404,9 @@ struct HfCorrelatorLcHadrons { |
394 | 404 | outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; |
395 | 405 | } |
396 | 406 | 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 | + } |
398 | 410 | } |
399 | 411 |
|
400 | 412 | // Lc-Hadron correlation dedicated section |
@@ -450,11 +462,13 @@ struct HfCorrelatorLcHadrons { |
450 | 462 | } |
451 | 463 | } |
452 | 464 | 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); |
456 | 471 | } |
457 | | - registry.fill(HIST("hTracksBin"), poolBin); |
458 | 472 | } |
459 | 473 | } // Hadron Tracks loop |
460 | 474 | countLc++; |
|
0 commit comments