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+ #include " PWGMM/Mult/DataModel/Index.h"
20+ #include " PWGMM/Mult/DataModel/bestCollisionTable.h"
21+
1822#include " Common/CCDB/EventSelectionParams.h"
23+ #include " Common/Core/TrackSelection.h"
24+ #include " Common/Core/trackUtilities.h"
25+ #include " Common/DataModel/Centrality.h"
1926#include " Common/DataModel/EventSelection.h"
20- #include " Common/DataModel/McCollisionExtra.h"
2127#include " Common/DataModel/Multiplicity.h"
2228#include " Common/DataModel/TrackSelectionTables.h"
2329
24- #include < CommonConstants/MathConstants.h>
25- #include < Framework/AnalysisDataModel.h>
26- #include < Framework/AnalysisHelpers.h>
27- #include < Framework/AnalysisTask.h>
28- #include < Framework/Configurable.h>
29- #include < Framework/DataTypes.h>
30- #include < Framework/HistogramRegistry.h>
31- #include < Framework/HistogramSpec.h>
32- #include < Framework/InitContext.h>
33- #include < Framework/O2DatabasePDGPlugin.h>
34- #include < Framework/OutputObjHeader.h>
35- #include < Framework/runDataProcessing.h>
36-
37- #include < TH1.h>
30+ #include " CCDB/BasicCCDBManager.h"
31+ #include " CommonConstants/MathConstants.h"
32+ #include " Framework/ASoAHelpers.h"
33+ #include " Framework/AnalysisDataModel.h"
34+ #include " Framework/AnalysisTask.h"
35+ #include " Framework/Configurable.h"
36+ #include " Framework/O2DatabasePDGPlugin.h"
37+ #include " Framework/runDataProcessing.h"
38+ #include " ReconstructionDataFormats/GlobalTrackID.h"
39+ #include " ReconstructionDataFormats/Track.h"
40+
41+ #include < TPDGCode.h>
3842
3943#include < cmath>
40- #include < cstdint>
4144#include < cstdlib>
45+ #include < unordered_map>
4246#include < vector>
4347
4448using namespace o2 ;
@@ -74,6 +78,7 @@ AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"};
7478AxisSpec axisPhi{629 , 0 , o2::constants::math::TwoPI, " #phi" };
7579AxisSpec axisCollSel{5 , 0.5 , 5.5 , " #Event" , " CollSelAxis" };
7680auto static constexpr kMinCharge = 3 .f;
81+ auto static constexpr kMinPtCut = 0 .1f ;
7782
7883struct StudyPnch {
7984
@@ -105,6 +110,12 @@ struct StudyPnch {
105110 Configurable<bool > isApplyTVX{" isApplyTVX" , false , " Enable TVX trigger sel" };
106111 Configurable<bool > isApplyCheckID{" isApplyCheckID" , true , " Select Tracks evaluating Collision ID" };
107112 Configurable<bool > isApplyDuplicatedTrack{" isApplyDuplicatedTrack" , true , " Select tracks that are not duplicated" };
113+ Configurable<bool > isApplyPhiSelection{" isApplyPhiSelection" , false , " Select tracks in specific phi range" };
114+ Configurable<float > minPhi{" minPhi" , 0 .f , " Minimum phi value for track selection" };
115+ Configurable<float > maxPhi{" maxPhi" , 6 .283185f , " Maximum phi value for track selection" };
116+ Configurable<bool > ispTincrease{" ispTincrease" , false , " Varies low pT particles by a conservative amount of +100%" };
117+ Configurable<bool > ispTdecrease{" ispTdecrease" , false , " Varies low pT particles by a conservative amount of -50%" };
118+ Configurable<bool > isApplyStrangenessSysUncert{" isApplyStrangenessSysUncert" , false , " Enable the evalution of systematics due to strange particle contribution" };
108119
109120 void init (InitContext const &)
110121 {
@@ -163,6 +174,16 @@ struct StudyPnch {
163174 histos.add (" hResponseMatrix" , " hResponseMatrix" , kTH2F , {axisMult, axisMult}, true );
164175 histos.add (" hCountNTracks" , " hCountNTracks" , kTH1F , {axisCountNumberTracks}, true );
165176 }
177+ if (ispTincrease || ispTdecrease) {
178+ histos.add (" hMultiplicityMCgenPtCut" , " hMultiplicityMCgenPtCut" , kTH1F , {axisMult}, true );
179+ histos.add (" hResponseMatrixPtCut" , " hResponseMatrixPtCut" , kTH2F , {axisMult, axisMult}, true );
180+ }
181+ if (isApplyStrangenessSysUncert) {
182+ histos.add (" hMultiplicityMCStangeDecay" , " hMultiplicityMCStangeDecay" , kTH1F , {axisMult}, true );
183+ histos.add (" hMultiplicityMCSubtractionSDecay" , " hMultiplicityMCSubtractionSDecay" , kTH1F , {axisMult}, true );
184+ histos.add (" hResponseMatrixStrangeDecay" , " hResponseMatrixStrangeDecay" , kTH2F , {axisMult, axisMult}, true );
185+ histos.add (" hResponseMatrixSubtractionSDecay" , " hResponseMatrixSubtractionSDecay" , kTH2F , {axisMult, axisMult}, true );
186+ }
166187 if (doprocessEvtLossSigLossMC) {
167188 histos.add (" MCEventHist" , " MCEventHist" , kTH1F , {axisEvent}, false );
168189 auto hstat = histos.get <TH1>(HIST (" MCEventHist" ));
@@ -251,6 +272,9 @@ struct StudyPnch {
251272 if (!isTrackSelected (track)) {
252273 continue ;
253274 }
275+ if (isApplyPhiSelection && (track.phi () < minPhi || track.phi () > maxPhi)) {
276+ continue ;
277+ }
254278 histos.fill (HIST (" hdcaxy" ), track.dcaXY ());
255279 histos.fill (HIST (" hdcaz" ), track.dcaZ ());
256280 histos.fill (HIST (" EtaHist" ), track.eta ());
@@ -272,6 +296,9 @@ struct StudyPnch {
272296 if (track.mcCollisionId () != McCol.mcCollisionId ()) {
273297 continue ;
274298 }
299+ if (isApplyPhiSelection && (track.phi () < minPhi || track.phi () > maxPhi)) {
300+ continue ;
301+ }
275302 histos.fill (HIST (" EtaGenHist" ), track.eta ());
276303 histos.fill (HIST (" PhiGenHist" ), track.phi ());
277304 histos.fill (HIST (" PhiVsEtaGenHist" ), track.phi (), track.eta ());
@@ -298,6 +325,9 @@ struct StudyPnch {
298325 continue ;
299326 }
300327 mcRecIDs.push_back (particle.globalIndex ());
328+ if (isApplyPhiSelection && (track.phi () < minPhi || track.phi () > maxPhi)) {
329+ continue ;
330+ }
301331 nTrk++;
302332 }
303333 histos.fill (HIST (" hdcaxy" ), track.dcaXY ());
@@ -309,6 +339,65 @@ struct StudyPnch {
309339 return nTrk;
310340 }
311341
342+ template <typename countTrk, typename McColType>
343+ int countStrangeTracksMcCol (countTrk const & tracks, McColType const & McCol)
344+ {
345+ auto nTrk_strange = 0 ;
346+ std::vector<int > mcRecIDs;
347+ for (const auto & track : tracks) {
348+ if (!isTrackSelected (track)) {
349+ continue ;
350+ }
351+ if (track.has_mcParticle ()) {
352+ auto particle = track.mcParticle ();
353+ if (isApplyCheckID && particle.mcCollisionId () != McCol.mcCollisionId ()) {
354+ continue ;
355+ }
356+ if (isApplyDuplicatedTrack && find (mcRecIDs.begin (), mcRecIDs.end (), particle.globalIndex ()) != mcRecIDs.end ()) {
357+ continue ;
358+ }
359+ mcRecIDs.push_back (particle.globalIndex ());
360+ if (particle.has_mothers ()) {
361+ auto mcMother = particle.template mothers_as <aod::McParticles>().front ();
362+ if (mcMother.pdgCode () == PDG_t::kK0Short || std::abs (mcMother.pdgCode () == PDG_t::kLambda0 )) {
363+ nTrk_strange++;
364+ }
365+ }
366+ }
367+ }
368+ return nTrk_strange;
369+ }
370+
371+ template <typename countTrk, typename McColType>
372+ int countTracksPtCut (countTrk const & tracks, McColType const & McCol)
373+ {
374+ auto nTrk_lowpT = 0 ;
375+ auto nTrk_highpT = 0 ;
376+ auto nTrk = 0 ;
377+ for (const auto & track : tracks) {
378+ if (!isGenTrackSelected (track)) {
379+ continue ;
380+ }
381+ if (track.mcCollisionId () != McCol.mcCollisionId ()) {
382+ continue ;
383+ }
384+ // Evaluate low pT extrapolation
385+ if (track.pt () < kMinPtCut ) {
386+ // nTrk_lowpT++;
387+ if (ispTincrease) {
388+ nTrk_lowpT += 2 - 10 * track.pt ();
389+ }
390+ if (ispTdecrease) {
391+ nTrk_lowpT += 0.5 + 5 * track.pt ();
392+ }
393+ } else {
394+ nTrk_highpT++;
395+ }
396+ }
397+ nTrk = nTrk_lowpT + nTrk_highpT;
398+ return nTrk;
399+ }
400+
312401 Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t )o2::aod::track::ITS) &&
313402 ncheckbit (aod::track::trackCutFlag, TrackSelectionIts);
314403 Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t )o2::aod::track::TPC),
@@ -366,6 +455,23 @@ struct StudyPnch {
366455 histos.fill (HIST (" hMultiplicityMCgen" ), multgen);
367456 histos.fill (HIST (" hResponseMatrix" ), multrec, multgen);
368457 }
458+ if (ispTincrease || ispTdecrease) {
459+ auto nTrkPtCut = countTracksPtCut (GenParticles, RecCol);
460+ if (nTrkPtCut > 0 ) {
461+ histos.fill (HIST (" hMultiplicityMCgenPtCut" ), nTrkPtCut);
462+ histos.fill (HIST (" hResponseMatrixPtCut" ), multrec, nTrkPtCut);
463+ }
464+ }
465+ if (isApplyStrangenessSysUncert) {
466+ auto nTrk_strange = countStrangeTracksMcCol (recTracksPart, RecCol);
467+ auto nSubtract_strange = multrec - nTrk_strange;
468+ if (multrec > 0 ) {
469+ histos.fill (HIST (" hMultiplicityMCStangeDecay" ), nTrk_strange);
470+ histos.fill (HIST (" hMultiplicityMCSubtractionSDecay" ), nSubtract_strange);
471+ histos.fill (HIST (" hResponseMatrixStrangeDecay" ), nTrk_strange, multgen);
472+ histos.fill (HIST (" hResponseMatrixSubtractionSDecay" ), nSubtract_strange, multgen);
473+ }
474+ }
369475 }
370476 }
371477
0 commit comments