1515// / \author Abhi Modak (abhi.modak@cern.ch), Lucas José (lucas.jose.franco.da.silva@cern.ch)
1616// / \since September 10, 2025
1717
18+ #include " PWGLF/DataModel/LFStrangenessTables.h"
19+
1820#include " Common/CCDB/EventSelectionParams.h"
1921#include " Common/DataModel/EventSelection.h"
2022#include " Common/DataModel/McCollisionExtra.h"
3537#include < Framework/runDataProcessing.h>
3638
3739#include < TH1.h>
38- #include < TPDGCode.h>
3940
4041#include < cmath>
4142#include < cstdint>
@@ -75,7 +76,7 @@ AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"};
7576AxisSpec axisPhi{629 , 0 , o2::constants::math::TwoPI, " #phi" };
7677AxisSpec axisCollSel{5 , 0.5 , 5.5 , " #Event" , " CollSelAxis" };
7778auto static constexpr kMinCharge = 3 .f;
78- auto static constexpr kMinPtCut = 0 .1f ;
79+ auto static constexpr pTminCut = 0 .1f ;
7980
8081struct StudyPnch {
8182
@@ -110,8 +111,8 @@ struct StudyPnch {
110111 Configurable<bool > isApplyPhiSelection{" isApplyPhiSelection" , false , " Select tracks in specific phi range" };
111112 Configurable<float > minPhi{" minPhi" , 0 .f , " Minimum phi value for track selection" };
112113 Configurable<float > maxPhi{" maxPhi" , 6 .283185f , " Maximum phi value for track selection" };
113- Configurable<bool > ispTincrease{ " ispTincrease " , false , " Varies low pT particles by a conservative amount of +100%" };
114- Configurable<bool > ispTdecrease{ " ispTdecrease " , false , " Varies low pT particles by a conservative amount of -50%" };
114+ Configurable<bool > isPtincrease{ " isPtincrease " , false , " Varies low pT particles by a conservative amount of +100%" };
115+ Configurable<bool > isPtdecrease{ " isPtdecrease " , false , " Varies low pT particles by a conservative amount of -50%" };
115116 Configurable<bool > isApplyStrangenessSysUncert{" isApplyStrangenessSysUncert" , false , " Enable the evaluation of systematics due to strange particle contribution" };
116117
117118 void init (InitContext const &)
@@ -122,7 +123,6 @@ struct StudyPnch {
122123 AxisSpec axisFt0aMult = {ft0aMultHistBin, " ft0a" , " FT0AMultAxis" };
123124 AxisSpec axisFt0cMult = {ft0cMultHistBin, " ft0c" , " FT0CMultAxis" };
124125 AxisSpec axisPt = {ptHistBin, " pT" , " pTAxis" };
125- AxisSpec axisCountNumberTracks = {countNumberTracks, " Count" , " CountAxis" };
126126 AxisSpec dcaAxis = {binsDCA, " DCA vs PV" };
127127
128128 histos.add (" EventHist" , " EventHist" , kTH1D , {axisEvent}, false );
@@ -138,13 +138,6 @@ struct StudyPnch {
138138 x->SetBinLabel (6 , " INEL > 0" );
139139 x->SetBinLabel (7 , " |vz| < 10" );
140140
141- histos.add (" SelCollsHist" , " SelCollsHist" , kTH1D , {axisCollSel}, false );
142- auto hstat_colls = histos.get <TH1>(HIST (" SelCollsHist" ));
143- auto * xColls = hstat_colls->GetXaxis ();
144- xColls->SetBinLabel (1 , " All collisions" );
145- xColls->SetBinLabel (2 , " Best Collision Selection" );
146- xColls->SetBinLabel (3 , " Has MC Collision Selection" );
147-
148141 if (doprocessData || doprocessCorrelation || doprocessMonteCarlo) {
149142 histos.add (" PhiVsEtaHist" , " PhiVsEtaHist" , kTH2F , {axisPhi, axisEta}, false );
150143 histos.add (" EtaHist" , " EtaHist" , kTH1D , {axisEta}, false );
@@ -169,17 +162,14 @@ struct StudyPnch {
169162 histos.add (" hMultiplicityMCrec" , " hMultiplicityMCrec" , kTH1F , {axisMult}, true );
170163 histos.add (" hMultiplicityMCgen" , " hMultiplicityMCgen" , kTH1F , {axisMult}, true );
171164 histos.add (" hResponseMatrix" , " hResponseMatrix" , kTH2F , {axisMult, axisMult}, true );
172- histos.add (" hCountNTracks" , " hCountNTracks" , kTH1F , {axisCountNumberTracks}, true );
173165 }
174- if (ispTincrease || ispTdecrease ) {
166+ if (isPtincrease || isPtdecrease ) {
175167 histos.add (" hMultiplicityMCgenPtCut" , " hMultiplicityMCgenPtCut" , kTH1F , {axisMult}, true );
176168 histos.add (" hResponseMatrixPtCut" , " hResponseMatrixPtCut" , kTH2F , {axisMult, axisMult}, true );
177169 }
178170 if (isApplyStrangenessSysUncert) {
179- histos.add (" hMultiplicityMCStangeDecay" , " hMultiplicityMCStangeDecay" , kTH1F , {axisMult}, true );
180- histos.add (" hMultiplicityMCSubtractionSDecay" , " hMultiplicityMCSubtractionSDecay" , kTH1F , {axisMult}, true );
181- histos.add (" hResponseMatrixStrangeDecay" , " hResponseMatrixStrangeDecay" , kTH2F , {axisMult, axisMult}, true );
182- histos.add (" hResponseMatrixSubtractionSDecay" , " hResponseMatrixSubtractionSDecay" , kTH2F , {axisMult, axisMult}, true );
171+ histos.add (" hMultiplicityMCSubStrDecay" , " hMultiplicityMCSubStrDecay" , kTH1F , {axisMult}, true );
172+ histos.add (" hResponseMatrixSubStrDecay" , " hResponseMatrixSubStrDecay" , kTH2F , {axisMult, axisMult}, true );
183173 }
184174 if (doprocessEvtLossSigLossMC) {
185175 histos.add (" MCEventHist" , " MCEventHist" , kTH1F , {axisEvent}, false );
@@ -339,7 +329,8 @@ struct StudyPnch {
339329 template <typename countTrk, typename McColType>
340330 int countStrangeTracksMcCol (countTrk const & tracks, McColType const & McCol)
341331 {
342- auto nTrk_strange = 0 ;
332+ auto nTrkStrange = 0 ;
333+ auto nTrk = 0 ;
343334 std::vector<int > mcRecIDs;
344335 for (const auto & track : tracks) {
345336 if (!isTrackSelected (track)) {
@@ -356,42 +347,35 @@ struct StudyPnch {
356347 mcRecIDs.push_back (particle.globalIndex ());
357348 if (particle.has_mothers ()) {
358349 auto mcMother = particle.template mothers_as <aod::McParticles>().front ();
359- if (mcMother.pdgCode () == PDG_t::kK0Short || std::abs (mcMother.pdgCode ()) == PDG_t::kLambda0 ) {
360- nTrk_strange ++;
350+ if (mcMother.pdgCode () == PDG_t::kK0Short || std::abs (mcMother.pdgCode () == PDG_t::kLambda0 ) ) {
351+ nTrkStrange ++;
361352 }
362353 }
354+ nTrk++;
363355 }
364356 }
365- return nTrk_strange ;
357+ return nTrk - nTrkStrange ;
366358 }
367359
368360 template <typename countTrk, typename McColType>
369- int countTracksPtCut (countTrk const & tracks, McColType const & McCol)
361+ float countTracksPtCut (countTrk const & tracks, McColType const & McCol)
370362 {
371- auto nTrk_lowpT = 0 ;
372- auto nTrk_highpT = 0 ;
373- auto nTrk = 0 ;
363+ auto nTrk = 0.0 ;
374364 for (const auto & track : tracks) {
375365 if (!isGenTrackSelected (track)) {
376366 continue ;
377367 }
378368 if (track.mcCollisionId () != McCol.mcCollisionId ()) {
379369 continue ;
380370 }
381- // Evaluate low pT extrapolation
382- if (track.pt () < kMinPtCut ) {
383- // nTrk_lowpT++;
384- if (ispTincrease) {
385- nTrk_lowpT += 2 - 10 * track.pt ();
386- }
387- if (ispTdecrease) {
388- nTrk_lowpT += 0.5 + 5 * track.pt ();
389- }
371+ if (track.pt () > pTminCut)
372+ continue ;
373+ if (isPtincrease) {
374+ nTrk += 2 - 10 * track.pt ();
390375 } else {
391- nTrk_highpT++ ;
376+ nTrk += 0.5 + 5 * track. pt () ;
392377 }
393378 }
394- nTrk = nTrk_lowpT + nTrk_highpT;
395379 return nTrk;
396380 }
397381
@@ -426,47 +410,44 @@ struct StudyPnch {
426410 histos.fill (HIST (" NPVtracks_vs_GlobalMult" ), cols.multNTracksPV (), mult);
427411 }
428412
429- void processMonteCarlo (soa::Join<aod::McCollisions, aod::McCollsExtra>::iterator const & mcCollision, ColMCRecTable const & RecCols, TrackMCTrueTable const & GenParticles, FilTrackMCRecTable const & RecTracks)
413+ void processMonteCarlo (soa::Join<aod::McCollisions, aod::McCollsExtra, aod::MultMCExtras >::iterator const & mcCollision, ColMCRecTable const & RecCols, TrackMCTrueTable const & GenParticles, FilTrackMCRecTable const & RecTracks)
430414 {
415+ if (isApplyInelgt0 && !mcCollision.isInelGt0 ()) {
416+ return ;
417+ }
418+
431419 for (const auto & RecCol : RecCols) {
432420 if (!isEventSelected (RecCol)) {
433421 continue ;
434422 }
435- histos.fill (HIST (" SelCollsHist" ), 1 );
436423 // Evaluation of reconstructed collisions with more than 1 contributor
437424 if (RecCol.globalIndex () != mcCollision.bestCollisionIndex ()) {
438425 continue ;
439426 }
440- histos.fill (HIST (" SelCollsHist" ), 2 );
441427 if (!RecCol.has_mcCollision ()) {
442428 continue ;
443429 }
444- histos.fill (HIST (" SelCollsHist" ), 3 );
445430 auto recTracksPart = RecTracks.sliceBy (perCollision, RecCol.globalIndex ());
446431 auto multrec = countNTracksMcCol (recTracksPart, RecCol);
447432 if (multrec > 0 ) {
448433 histos.fill (HIST (" hMultiplicityMCrec" ), multrec);
449434 }
450- auto multgen = countGenTracks (GenParticles, RecCol);
435+ float multgen = countGenTracks (GenParticles, RecCol);
451436 if (multgen > 0 && multrec > 0 ) {
452437 histos.fill (HIST (" hMultiplicityMCgen" ), multgen);
453438 histos.fill (HIST (" hResponseMatrix" ), multrec, multgen);
454439 }
455- if (ispTincrease || ispTdecrease) {
456- auto nTrkPtCut = countTracksPtCut (GenParticles, RecCol);
457- if (nTrkPtCut > 0 ) {
458- histos.fill (HIST (" hMultiplicityMCgenPtCut" ), nTrkPtCut);
459- histos.fill (HIST (" hResponseMatrixPtCut" ), multrec, nTrkPtCut);
460- }
440+ if (isPtincrease || isPtdecrease) {
441+ float nTrkPtCut = countTracksPtCut (GenParticles, RecCol);
442+ multgen = multgen + nTrkPtCut;
443+ histos.fill (HIST (" hMultiplicityMCgenPtCut" ), multgen);
444+ histos.fill (HIST (" hResponseMatrixPtCut" ), multrec, multgen);
461445 }
462446 if (isApplyStrangenessSysUncert) {
463- auto nTrk_strange = countStrangeTracksMcCol (recTracksPart, RecCol);
464- auto nSubtract_strange = multrec - nTrk_strange;
447+ auto nSubtractStrange = countStrangeTracksMcCol (recTracksPart, RecCol);
465448 if (multrec > 0 ) {
466- histos.fill (HIST (" hMultiplicityMCStangeDecay" ), nTrk_strange);
467- histos.fill (HIST (" hMultiplicityMCSubtractionSDecay" ), nSubtract_strange);
468- histos.fill (HIST (" hResponseMatrixStrangeDecay" ), nTrk_strange, multgen);
469- histos.fill (HIST (" hResponseMatrixSubtractionSDecay" ), nSubtract_strange, multgen);
449+ histos.fill (HIST (" hMultiplicityMCSubStrDecay" ), nSubtractStrange);
450+ histos.fill (HIST (" hResponseMatrixSubStrDecay" ), nSubtractStrange, multgen);
470451 }
471452 }
472453 }
0 commit comments