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>
40+ #include < TPDGCode.h>
3841
3942#include < cmath>
4043#include < cstdint>
@@ -74,6 +77,7 @@ AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"};
7477AxisSpec axisPhi{629 , 0 , o2::constants::math::TwoPI, " #phi" };
7578AxisSpec axisCollSel{5 , 0.5 , 5.5 , " #Event" , " CollSelAxis" };
7679auto static constexpr kMinCharge = 3 .f;
80+ auto static constexpr kMinPtCut = 0 .1f ;
7781
7882struct StudyPnch {
7983
@@ -105,6 +109,12 @@ struct StudyPnch {
105109 Configurable<bool > isApplyTVX{" isApplyTVX" , false , " Enable TVX trigger sel" };
106110 Configurable<bool > isApplyCheckID{" isApplyCheckID" , true , " Select Tracks evaluating Collision ID" };
107111 Configurable<bool > isApplyDuplicatedTrack{" isApplyDuplicatedTrack" , true , " Select tracks that are not duplicated" };
112+ Configurable<bool > isApplyPhiSelection{" isApplyPhiSelection" , false , " Select tracks in specific phi range" };
113+ Configurable<float > minPhi{" minPhi" , 0 .f , " Minimum phi value for track selection" };
114+ Configurable<float > maxPhi{" maxPhi" , 6 .283185f , " Maximum phi value for track selection" };
115+ Configurable<bool > ispTincrease{" ispTincrease" , false , " Varies low pT particles by a conservative amount of +100%" };
116+ Configurable<bool > ispTdecrease{" ispTdecrease" , false , " Varies low pT particles by a conservative amount of -50%" };
117+ Configurable<bool > isApplyStrangenessSysUncert{" isApplyStrangenessSysUncert" , false , " Enable the evaluation of systematics due to strange particle contribution" };
108118
109119 void init (InitContext const &)
110120 {
@@ -163,6 +173,16 @@ struct StudyPnch {
163173 histos.add (" hResponseMatrix" , " hResponseMatrix" , kTH2F , {axisMult, axisMult}, true );
164174 histos.add (" hCountNTracks" , " hCountNTracks" , kTH1F , {axisCountNumberTracks}, true );
165175 }
176+ if (ispTincrease || ispTdecrease) {
177+ histos.add (" hMultiplicityMCgenPtCut" , " hMultiplicityMCgenPtCut" , kTH1F , {axisMult}, true );
178+ histos.add (" hResponseMatrixPtCut" , " hResponseMatrixPtCut" , kTH2F , {axisMult, axisMult}, true );
179+ }
180+ if (isApplyStrangenessSysUncert) {
181+ histos.add (" hMultiplicityMCStangeDecay" , " hMultiplicityMCStangeDecay" , kTH1F , {axisMult}, true );
182+ histos.add (" hMultiplicityMCSubtractionSDecay" , " hMultiplicityMCSubtractionSDecay" , kTH1F , {axisMult}, true );
183+ histos.add (" hResponseMatrixStrangeDecay" , " hResponseMatrixStrangeDecay" , kTH2F , {axisMult, axisMult}, true );
184+ histos.add (" hResponseMatrixSubtractionSDecay" , " hResponseMatrixSubtractionSDecay" , kTH2F , {axisMult, axisMult}, true );
185+ }
166186 if (doprocessEvtLossSigLossMC) {
167187 histos.add (" MCEventHist" , " MCEventHist" , kTH1F , {axisEvent}, false );
168188 auto hstat = histos.get <TH1>(HIST (" MCEventHist" ));
@@ -251,6 +271,9 @@ struct StudyPnch {
251271 if (!isTrackSelected (track)) {
252272 continue ;
253273 }
274+ if (isApplyPhiSelection && (track.phi () < minPhi || track.phi () > maxPhi)) {
275+ continue ;
276+ }
254277 histos.fill (HIST (" hdcaxy" ), track.dcaXY ());
255278 histos.fill (HIST (" hdcaz" ), track.dcaZ ());
256279 histos.fill (HIST (" EtaHist" ), track.eta ());
@@ -272,6 +295,9 @@ struct StudyPnch {
272295 if (track.mcCollisionId () != McCol.mcCollisionId ()) {
273296 continue ;
274297 }
298+ if (isApplyPhiSelection && (track.phi () < minPhi || track.phi () > maxPhi)) {
299+ continue ;
300+ }
275301 histos.fill (HIST (" EtaGenHist" ), track.eta ());
276302 histos.fill (HIST (" PhiGenHist" ), track.phi ());
277303 histos.fill (HIST (" PhiVsEtaGenHist" ), track.phi (), track.eta ());
@@ -298,6 +324,9 @@ struct StudyPnch {
298324 continue ;
299325 }
300326 mcRecIDs.push_back (particle.globalIndex ());
327+ if (isApplyPhiSelection && (track.phi () < minPhi || track.phi () > maxPhi)) {
328+ continue ;
329+ }
301330 nTrk++;
302331 }
303332 histos.fill (HIST (" hdcaxy" ), track.dcaXY ());
@@ -309,6 +338,65 @@ struct StudyPnch {
309338 return nTrk;
310339 }
311340
341+ template <typename countTrk, typename McColType>
342+ int countStrangeTracksMcCol (countTrk const & tracks, McColType const & McCol)
343+ {
344+ auto nTrk_strange = 0 ;
345+ std::vector<int > mcRecIDs;
346+ for (const auto & track : tracks) {
347+ if (!isTrackSelected (track)) {
348+ continue ;
349+ }
350+ if (track.has_mcParticle ()) {
351+ auto particle = track.mcParticle ();
352+ if (isApplyCheckID && particle.mcCollisionId () != McCol.mcCollisionId ()) {
353+ continue ;
354+ }
355+ if (isApplyDuplicatedTrack && find (mcRecIDs.begin (), mcRecIDs.end (), particle.globalIndex ()) != mcRecIDs.end ()) {
356+ continue ;
357+ }
358+ mcRecIDs.push_back (particle.globalIndex ());
359+ if (particle.has_mothers ()) {
360+ auto mcMother = particle.template mothers_as <aod::McParticles>().front ();
361+ if (mcMother.pdgCode () == PDG_t::kK0Short || std::abs (mcMother.pdgCode ()) == PDG_t::kLambda0 ) {
362+ nTrk_strange++;
363+ }
364+ }
365+ }
366+ }
367+ return nTrk_strange;
368+ }
369+
370+ template <typename countTrk, typename McColType>
371+ int countTracksPtCut (countTrk const & tracks, McColType const & McCol)
372+ {
373+ auto nTrk_lowpT = 0 ;
374+ auto nTrk_highpT = 0 ;
375+ auto nTrk = 0 ;
376+ for (const auto & track : tracks) {
377+ if (!isGenTrackSelected (track)) {
378+ continue ;
379+ }
380+ if (track.mcCollisionId () != McCol.mcCollisionId ()) {
381+ continue ;
382+ }
383+ // Evaluate low pT extrapolation
384+ if (track.pt () < kMinPtCut ) {
385+ // nTrk_lowpT++;
386+ if (ispTincrease) {
387+ nTrk_lowpT += 2 - 10 * track.pt ();
388+ }
389+ if (ispTdecrease) {
390+ nTrk_lowpT += 0.5 + 5 * track.pt ();
391+ }
392+ } else {
393+ nTrk_highpT++;
394+ }
395+ }
396+ nTrk = nTrk_lowpT + nTrk_highpT;
397+ return nTrk;
398+ }
399+
312400 Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t )o2::aod::track::ITS) &&
313401 ncheckbit (aod::track::trackCutFlag, TrackSelectionIts);
314402 Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t )o2::aod::track::TPC),
@@ -366,6 +454,23 @@ struct StudyPnch {
366454 histos.fill (HIST (" hMultiplicityMCgen" ), multgen);
367455 histos.fill (HIST (" hResponseMatrix" ), multrec, multgen);
368456 }
457+ if (ispTincrease || ispTdecrease) {
458+ auto nTrkPtCut = countTracksPtCut (GenParticles, RecCol);
459+ if (nTrkPtCut > 0 ) {
460+ histos.fill (HIST (" hMultiplicityMCgenPtCut" ), nTrkPtCut);
461+ histos.fill (HIST (" hResponseMatrixPtCut" ), multrec, nTrkPtCut);
462+ }
463+ }
464+ if (isApplyStrangenessSysUncert) {
465+ auto nTrk_strange = countStrangeTracksMcCol (recTracksPart, RecCol);
466+ auto nSubtract_strange = multrec - nTrk_strange;
467+ if (multrec > 0 ) {
468+ histos.fill (HIST (" hMultiplicityMCStangeDecay" ), nTrk_strange);
469+ histos.fill (HIST (" hMultiplicityMCSubtractionSDecay" ), nSubtract_strange);
470+ histos.fill (HIST (" hResponseMatrixStrangeDecay" ), nTrk_strange, multgen);
471+ histos.fill (HIST (" hResponseMatrixSubtractionSDecay" ), nSubtract_strange, multgen);
472+ }
473+ }
369474 }
370475 }
371476
0 commit comments