Skip to content

Commit 14e0a80

Browse files
authored
[PWGLF] Corrections for systematic uncertainties (#16212)
1 parent 1fd8573 commit 14e0a80

1 file changed

Lines changed: 35 additions & 64 deletions

File tree

PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx

Lines changed: 35 additions & 64 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"
@@ -35,7 +37,6 @@
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"};
7576
AxisSpec axisPhi{629, 0, o2::constants::math::TwoPI, "#phi"};
7677
AxisSpec axisCollSel{5, 0.5, 5.5, "#Event", "CollSelAxis"};
7778
auto static constexpr kMinCharge = 3.f;
78-
auto static constexpr kMinPtCut = 0.1f;
79+
auto static constexpr pTminCut = 0.1f;
7980

8081
struct 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,12 @@ 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);
173-
}
174-
if (ispTincrease || ispTdecrease) {
175165
histos.add("hMultiplicityMCgenPtCut", "hMultiplicityMCgenPtCut", kTH1F, {axisMult}, true);
176166
histos.add("hResponseMatrixPtCut", "hResponseMatrixPtCut", kTH2F, {axisMult, axisMult}, true);
177167
}
178168
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);
169+
histos.add("hMultiplicityMCSubStrDecay", "hMultiplicityMCSubStrDecay", kTH1F, {axisMult}, true);
170+
histos.add("hResponseMatrixSubStrDecay", "hResponseMatrixSubStrDecay", kTH2F, {axisMult, axisMult}, true);
183171
}
184172
if (doprocessEvtLossSigLossMC) {
185173
histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false);
@@ -339,7 +327,8 @@ struct StudyPnch {
339327
template <typename countTrk, typename McColType>
340328
int countStrangeTracksMcCol(countTrk const& tracks, McColType const& McCol)
341329
{
342-
auto nTrk_strange = 0;
330+
auto nTrkStrange = 0;
331+
auto nTrk = 0;
343332
std::vector<int> mcRecIDs;
344333
for (const auto& track : tracks) {
345334
if (!isTrackSelected(track)) {
@@ -357,41 +346,34 @@ struct StudyPnch {
357346
if (particle.has_mothers()) {
358347
auto mcMother = particle.template mothers_as<aod::McParticles>().front();
359348
if (mcMother.pdgCode() == PDG_t::kK0Short || std::abs(mcMother.pdgCode()) == PDG_t::kLambda0) {
360-
nTrk_strange++;
349+
nTrkStrange++;
361350
}
362351
}
352+
nTrk++;
363353
}
364354
}
365-
return nTrk_strange;
355+
return nTrk - nTrkStrange;
366356
}
367357

368358
template <typename countTrk, typename McColType>
369-
int countTracksPtCut(countTrk const& tracks, McColType const& McCol)
359+
float countTracksPtCut(countTrk const& tracks, McColType const& McCol)
370360
{
371-
auto nTrk_lowpT = 0;
372-
auto nTrk_highpT = 0;
373-
auto nTrk = 0;
361+
float nTrk = 0.0;
374362
for (const auto& track : tracks) {
375363
if (!isGenTrackSelected(track)) {
376364
continue;
377365
}
378366
if (track.mcCollisionId() != McCol.mcCollisionId()) {
379367
continue;
380368
}
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-
}
369+
if (track.pt() > pTminCut)
370+
continue;
371+
if (isPtincrease) {
372+
nTrk += 2 - 10 * track.pt();
390373
} else {
391-
nTrk_highpT++;
374+
nTrk += 0.5 + 5 * track.pt();
392375
}
393376
}
394-
nTrk = nTrk_lowpT + nTrk_highpT;
395377
return nTrk;
396378
}
397379

@@ -426,48 +408,37 @@ struct StudyPnch {
426408
histos.fill(HIST("NPVtracks_vs_GlobalMult"), cols.multNTracksPV(), mult);
427409
}
428410

429-
void processMonteCarlo(soa::Join<aod::McCollisions, aod::McCollsExtra>::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks)
411+
void processMonteCarlo(soa::Join<aod::McCollisions, aod::McCollsExtra, aod::MultMCExtras>::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks)
430412
{
413+
if (isApplyInelgt0 && !mcCollision.isInelGt0()) {
414+
return;
415+
}
416+
431417
for (const auto& RecCol : RecCols) {
432418
if (!isEventSelected(RecCol)) {
433419
continue;
434420
}
435-
histos.fill(HIST("SelCollsHist"), 1);
436421
// Evaluation of reconstructed collisions with more than 1 contributor
437422
if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) {
438423
continue;
439424
}
440-
histos.fill(HIST("SelCollsHist"), 2);
441425
if (!RecCol.has_mcCollision()) {
442426
continue;
443427
}
444-
histos.fill(HIST("SelCollsHist"), 3);
445428
auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex());
446429
auto multrec = countNTracksMcCol(recTracksPart, RecCol);
447-
if (multrec > 0) {
448-
histos.fill(HIST("hMultiplicityMCrec"), multrec);
449-
}
450-
auto multgen = countGenTracks(GenParticles, RecCol);
451-
if (multgen > 0 && multrec > 0) {
452-
histos.fill(HIST("hMultiplicityMCgen"), multgen);
453-
histos.fill(HIST("hResponseMatrix"), multrec, multgen);
454-
}
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-
}
461-
}
430+
histos.fill(HIST("hMultiplicityMCrec"), multrec);
431+
float multgen = countGenTracks(GenParticles, RecCol);
432+
histos.fill(HIST("hMultiplicityMCgen"), multgen);
433+
histos.fill(HIST("hResponseMatrix"), multrec, multgen);
434+
float nTrkPtCut = countTracksPtCut(GenParticles, RecCol);
435+
nTrkPtCut = multgen + nTrkPtCut;
436+
histos.fill(HIST("hMultiplicityMCgenPtCut"), nTrkPtCut);
437+
histos.fill(HIST("hResponseMatrixPtCut"), multrec, nTrkPtCut);
462438
if (isApplyStrangenessSysUncert) {
463-
auto nTrk_strange = countStrangeTracksMcCol(recTracksPart, RecCol);
464-
auto nSubtract_strange = multrec - nTrk_strange;
465-
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);
470-
}
439+
auto nSubtractStrange = countStrangeTracksMcCol(recTracksPart, RecCol);
440+
histos.fill(HIST("hMultiplicityMCSubStrDecay"), nSubtractStrange);
441+
histos.fill(HIST("hResponseMatrixSubStrDecay"), nSubtractStrange, multgen);
471442
}
472443
}
473444
}

0 commit comments

Comments
 (0)