Skip to content

Commit ca40185

Browse files
authored
Inclusion of conditions to evaluate systematic uncertainties
The inclusion considers pT extrapolation to zero, phi cut variation, and the evaluation of particles coming from weak decays
1 parent 2d99f6c commit ca40185

1 file changed

Lines changed: 104 additions & 0 deletions

File tree

PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
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"
@@ -74,6 +76,7 @@ AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"};
7476
AxisSpec axisPhi{629, 0, o2::constants::math::TwoPI, "#phi"};
7577
AxisSpec axisCollSel{5, 0.5, 5.5, "#Event", "CollSelAxis"};
7678
auto static constexpr kMinCharge = 3.f;
79+
auto static constexpr kMinPtCut = 0.1f;
7780

7881
struct StudyPnch {
7982

@@ -105,6 +108,12 @@ struct StudyPnch {
105108
Configurable<bool> isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"};
106109
Configurable<bool> isApplyCheckID{"isApplyCheckID", true, "Select Tracks evaluating Collision ID"};
107110
Configurable<bool> isApplyDuplicatedTrack{"isApplyDuplicatedTrack", true, "Select tracks that are not duplicated"};
111+
Configurable<bool> isApplyPhiSelection{"isApplyPhiSelection", false, "Select tracks in specific phi range"};
112+
Configurable<float> minPhi{"minPhi", 0.f, "Minimum phi value for track selection"};
113+
Configurable<float> maxPhi{"maxPhi", 6.283185f, "Maximum phi value for track selection"};
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%"};
116+
Configurable<bool> isApplyStrangenessSysUncert{"isApplyStrangenessSysUncert", false, "Enable the evaluation of systematics due to strange particle contribution"};
108117

109118
void init(InitContext const&)
110119
{
@@ -163,6 +172,16 @@ struct StudyPnch {
163172
histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true);
164173
histos.add("hCountNTracks", "hCountNTracks", kTH1F, {axisCountNumberTracks}, true);
165174
}
175+
if (ispTincrease || ispTdecrease) {
176+
histos.add("hMultiplicityMCgenPtCut", "hMultiplicityMCgenPtCut", kTH1F, {axisMult}, true);
177+
histos.add("hResponseMatrixPtCut", "hResponseMatrixPtCut", kTH2F, {axisMult, axisMult}, true);
178+
}
179+
if (isApplyStrangenessSysUncert) {
180+
histos.add("hMultiplicityMCStangeDecay", "hMultiplicityMCStangeDecay", kTH1F, {axisMult}, true);
181+
histos.add("hMultiplicityMCSubtractionSDecay", "hMultiplicityMCSubtractionSDecay", kTH1F, {axisMult}, true);
182+
histos.add("hResponseMatrixStrangeDecay", "hResponseMatrixStrangeDecay", kTH2F, {axisMult, axisMult}, true);
183+
histos.add("hResponseMatrixSubtractionSDecay", "hResponseMatrixSubtractionSDecay", kTH2F, {axisMult, axisMult}, true);
184+
}
166185
if (doprocessEvtLossSigLossMC) {
167186
histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false);
168187
auto hstat = histos.get<TH1>(HIST("MCEventHist"));
@@ -251,6 +270,9 @@ struct StudyPnch {
251270
if (!isTrackSelected(track)) {
252271
continue;
253272
}
273+
if (isApplyPhiSelection && (track.phi() < minPhi || track.phi() > maxPhi)) {
274+
continue;
275+
}
254276
histos.fill(HIST("hdcaxy"), track.dcaXY());
255277
histos.fill(HIST("hdcaz"), track.dcaZ());
256278
histos.fill(HIST("EtaHist"), track.eta());
@@ -272,6 +294,9 @@ struct StudyPnch {
272294
if (track.mcCollisionId() != McCol.mcCollisionId()) {
273295
continue;
274296
}
297+
if (isApplyPhiSelection && (track.phi() < minPhi || track.phi() > maxPhi)) {
298+
continue;
299+
}
275300
histos.fill(HIST("EtaGenHist"), track.eta());
276301
histos.fill(HIST("PhiGenHist"), track.phi());
277302
histos.fill(HIST("PhiVsEtaGenHist"), track.phi(), track.eta());
@@ -298,6 +323,9 @@ struct StudyPnch {
298323
continue;
299324
}
300325
mcRecIDs.push_back(particle.globalIndex());
326+
if (isApplyPhiSelection && (track.phi() < minPhi || track.phi() > maxPhi)) {
327+
continue;
328+
}
301329
nTrk++;
302330
}
303331
histos.fill(HIST("hdcaxy"), track.dcaXY());
@@ -309,6 +337,65 @@ struct StudyPnch {
309337
return nTrk;
310338
}
311339

340+
template <typename countTrk, typename McColType>
341+
int countStrangeTracksMcCol(countTrk const& tracks, McColType const& McCol)
342+
{
343+
auto nTrk_strange = 0;
344+
std::vector<int> mcRecIDs;
345+
for (const auto& track : tracks) {
346+
if (!isTrackSelected(track)) {
347+
continue;
348+
}
349+
if (track.has_mcParticle()) {
350+
auto particle = track.mcParticle();
351+
if (isApplyCheckID && particle.mcCollisionId() != McCol.mcCollisionId()) {
352+
continue;
353+
}
354+
if (isApplyDuplicatedTrack && find(mcRecIDs.begin(), mcRecIDs.end(), particle.globalIndex()) != mcRecIDs.end()) {
355+
continue;
356+
}
357+
mcRecIDs.push_back(particle.globalIndex());
358+
if (particle.has_mothers()) {
359+
auto mcMother = particle.template mothers_as<aod::McParticles>().front();
360+
if (mcMother.pdgCode() == PDG_t::kK0Short || std::abs(mcMother.pdgCode() == PDG_t::kLambda0)) {
361+
nTrk_strange++;
362+
}
363+
}
364+
}
365+
}
366+
return nTrk_strange;
367+
}
368+
369+
template <typename countTrk, typename McColType>
370+
int countTracksPtCut(countTrk const& tracks, McColType const& McCol)
371+
{
372+
auto nTrk_lowpT = 0;
373+
auto nTrk_highpT = 0;
374+
auto nTrk = 0;
375+
for (const auto& track : tracks) {
376+
if (!isGenTrackSelected(track)) {
377+
continue;
378+
}
379+
if (track.mcCollisionId() != McCol.mcCollisionId()) {
380+
continue;
381+
}
382+
// Evaluate low pT extrapolation
383+
if (track.pt() < kMinPtCut) {
384+
// nTrk_lowpT++;
385+
if (ispTincrease) {
386+
nTrk_lowpT += 2 - 10 * track.pt();
387+
}
388+
if (ispTdecrease) {
389+
nTrk_lowpT += 0.5 + 5 * track.pt();
390+
}
391+
} else {
392+
nTrk_highpT++;
393+
}
394+
}
395+
nTrk = nTrk_lowpT + nTrk_highpT;
396+
return nTrk;
397+
}
398+
312399
Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) &&
313400
ncheckbit(aod::track::trackCutFlag, TrackSelectionIts);
314401
Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC),
@@ -366,6 +453,23 @@ struct StudyPnch {
366453
histos.fill(HIST("hMultiplicityMCgen"), multgen);
367454
histos.fill(HIST("hResponseMatrix"), multrec, multgen);
368455
}
456+
if (ispTincrease || ispTdecrease) {
457+
auto nTrkPtCut = countTracksPtCut(GenParticles, RecCol);
458+
if (nTrkPtCut > 0) {
459+
histos.fill(HIST("hMultiplicityMCgenPtCut"), nTrkPtCut);
460+
histos.fill(HIST("hResponseMatrixPtCut"), multrec, nTrkPtCut);
461+
}
462+
}
463+
if (isApplyStrangenessSysUncert) {
464+
auto nTrk_strange = countStrangeTracksMcCol(recTracksPart, RecCol);
465+
auto nSubtract_strange = multrec - nTrk_strange;
466+
if (multrec > 0) {
467+
histos.fill(HIST("hMultiplicityMCStangeDecay"), nTrk_strange);
468+
histos.fill(HIST("hMultiplicityMCSubtractionSDecay"), nSubtract_strange);
469+
histos.fill(HIST("hResponseMatrixStrangeDecay"), nTrk_strange, multgen);
470+
histos.fill(HIST("hResponseMatrixSubtractionSDecay"), nSubtract_strange, multgen);
471+
}
472+
}
369473
}
370474
}
371475

0 commit comments

Comments
 (0)