Skip to content

Commit 8c0d0b4

Browse files
Preet-BhanjanPreet Patialibuild
authored
[PWGCF] Addition of QA for TPC dEdx (#15088)
Co-authored-by: Preet Pati <preet@Mac.home> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent bb405f3 commit 8c0d0b4

File tree

1 file changed

+58
-16
lines changed

1 file changed

+58
-16
lines changed

PWGCF/TwoParticleCorrelations/Tasks/pidDiHadron.cxx

Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ struct PidDiHadron {
118118
O2_DEFINE_CONFIGURABLE(cfgUseOnlyTPC, bool, true, "Use only TPC PID for daughter selection")
119119
O2_DEFINE_CONFIGURABLE(cfgPIDParticle, int, 0, "1 = pion, 2 = kaon, 3 = proton, 4 = kshort, 5 = lambda, 6 = phi, 0 for no PID")
120120
O2_DEFINE_CONFIGURABLE(cfgGetNsigmaQA, bool, true, "Get QA histograms for selection of pions, kaons, and protons")
121+
O2_DEFINE_CONFIGURABLE(cfgGetdEdx, bool, true, "Get QA histograms for selection of pions, kaons, and protons")
121122
O2_DEFINE_CONFIGURABLE(cfgUseAntiLambda, bool, true, "Use AntiLambda candidates for analysis")
122123
O2_DEFINE_CONFIGURABLE(cfgPIDUseRejection, bool, true, "Turn off and on the exclusion criteria for PID determination")
123124

@@ -172,6 +173,7 @@ struct PidDiHadron {
172173
ConfigurableAxis axisNsigmaTOF{"axisNsigmaTOF", {80, -5, 5}, "nsigmaTOF axis"};
173174
ConfigurableAxis axisNsigmaITS{"axisNsigmaITS", {80, -5, 5}, "nsigmaITS axis"};
174175
ConfigurableAxis axisTpcSignal{"axisTpcSignal", {250, 0, 250}, "dEdx axis for TPC"};
176+
ConfigurableAxis axisSigma{"axisSigma", {200, 0, 20}, "sigma axis for TPC"};
175177

176178
Configurable<LabeledArray<int>> cfgUseEventCuts{"cfgUseEventCuts", {LongArrayInt[0], 15, 1, {"Filtered Events", "Sel8", "kNoTimeFrameBorder", "kNoITSROFrameBorder", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "kNoCollInTimeRangeStandard", "kIsGoodITSLayersAll", "kNoCollInRofStandard", "kNoHighMultCollInPrevRof", "Occupancy", "Multcorrelation", "T0AV0ACut", "kIsVertexITSTPC", "kTVXinTRD"}, {"EvCuts"}}, "Labeled array (int) for various cuts on resonances"};
177179
Configurable<LabeledArray<float>> nSigmas{"nSigmas", {LongArrayFloat[0], 6, 3, {"UpCut_pi", "UpCut_ka", "UpCut_pr", "LowCut_pi", "LowCut_ka", "LowCut_pr"}, {"TPC", "TOF", "ITS"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"};
@@ -497,15 +499,18 @@ struct PidDiHadron {
497499
if (!cfgUseItsPID) {
498500
histos.add("TofTpcNsigma_before", "", {HistType::kTHnSparseD, {{axisNsigmaTPC, axisNsigmaTOF, axisPt}}});
499501
histos.add("TofTpcNsigma_after", "", {HistType::kTHnSparseD, {{axisNsigmaTPC, axisNsigmaTOF, axisPt}}});
500-
}
502+
503+
if (cfgGetdEdx) {
504+
histos.add("TpcdEdx_ptwise", "", {HistType::kTHnSparseD, {{axisPt, axisTpcSignal, axisNsigmaTOF}}});
505+
histos.add("ExpTpcdEdx_ptwise", "", {HistType::kTHnSparseD, {{axisPt, axisTpcSignal, axisNsigmaTOF}}});
506+
histos.add("ExpSigma_ptwise", "", {HistType::kTHnSparseD, {{axisPt, axisSigma, axisNsigmaTOF}}});
507+
}
508+
} // TPC-TOF PID QA hists
501509
if (cfgUseItsPID) {
502510
histos.add("TofItsNsigma_before", "", {HistType::kTHnSparseD, {{axisNsigmaITS, axisNsigmaTOF, axisPt}}});
503511
histos.add("TofItsNsigma_after", "", {HistType::kTHnSparseD, {{axisNsigmaITS, axisNsigmaTOF, axisPt}}});
504-
}
505-
506-
histos.add("TpcdEdx_ptwise", "", {HistType::kTH2D, {{axisTpcSignal, axisPt}}});
507-
histos.add("TpcdEdx_ptwise_afterCut", "", {HistType::kTH2D, {{axisTpcSignal, axisPt}}});
508-
}
512+
} // ITS-TOF PID QA hists
513+
} // end of PID QA hists
509514
}
510515

511516
if (cfgPIDParticle == kK0 || cfgPIDParticle == kLambda || cfgPIDParticle == kPhi) {
@@ -527,6 +532,14 @@ struct PidDiHadron {
527532
histos.add("hNsigmaPionTrue", "hNsigmaPionTrue", {HistType::kTH1D, {axisPt}}); // All true pions from MC
528533
histos.add("hNsigmaKaonTrue", "hNsigmaKaonTrue", {HistType::kTH1D, {axisPt}}); // All true kaons from MC
529534
histos.add("hNsigmaProtonTrue", "hNsigmaProtonTrue", {HistType::kTH1D, {axisPt}}); // All true protons from MC
535+
536+
histos.add("TpcdEdx_ptwise_pi", "", {HistType::kTHnSparseD, {{axisPt, axisTpcSignal, axisNsigmaTOF}}});
537+
histos.add("TpcdEdx_ptwise_ka", "", {HistType::kTHnSparseD, {{axisPt, axisTpcSignal, axisNsigmaTOF}}});
538+
histos.add("TpcdEdx_ptwise_pr", "", {HistType::kTHnSparseD, {{axisPt, axisTpcSignal, axisNsigmaTOF}}});
539+
540+
histos.add("ExpTpcdEdx_ptwise_pi", "", {HistType::kTHnSparseD, {{axisPt, axisTpcSignal, axisNsigmaTOF}}});
541+
histos.add("ExpTpcdEdx_ptwise_ka", "", {HistType::kTHnSparseD, {{axisPt, axisTpcSignal, axisNsigmaTOF}}});
542+
histos.add("ExpTpcdEdx_ptwise_pr", "", {HistType::kTHnSparseD, {{axisPt, axisTpcSignal, axisNsigmaTOF}}});
530543
}
531544

532545
histos.add("eventcount", "bin", {HistType::kTH1F, {{4, 0, 4, "bin"}}}); // histogram to see how many events are in the same and mixed event
@@ -839,12 +852,36 @@ struct PidDiHadron {
839852

840853
// Fill Nsigma QA
841854
if (cfgGetNsigmaQA && !cfgUseItsPID) {
842-
if (cfgPIDParticle == kPions)
855+
if (cfgPIDParticle == kPions) {
843856
histos.fill(HIST("TofTpcNsigma_before"), track1.tpcNSigmaPi(), track1.tofNSigmaPi(), track1.pt());
844-
if (cfgPIDParticle == kKaons)
857+
if (cfgGetdEdx) {
858+
double tpcExpSignalPi = track1.tpcSignal() - (track1.tpcNSigmaPi() * track1.tpcExpSigmaPi());
859+
860+
histos.fill(HIST("TpcdEdx_ptwise"), track1.pt(), track1.tpcSignal(), track1.tofNSigmaPi());
861+
histos.fill(HIST("ExpTpcdEdx_ptwise"), track1.pt(), tpcExpSignalPi, track1.tofNSigmaPi());
862+
histos.fill(HIST("ExpSigma_ptwise"), track1.pt(), track1.tpcExpSigmaPi(), track1.tofNSigmaPi());
863+
}
864+
}
865+
if (cfgPIDParticle == kKaons) {
845866
histos.fill(HIST("TofTpcNsigma_before"), track1.tpcNSigmaKa(), track1.tofNSigmaKa(), track1.pt());
846-
if (cfgPIDParticle == kProtons)
867+
if (cfgGetdEdx) {
868+
double tpcExpSignalKa = track1.tpcSignal() - (track1.tpcNSigmaKa() * track1.tpcExpSigmaKa());
869+
870+
histos.fill(HIST("TpcdEdx_ptwise"), track1.pt(), track1.tpcSignal(), track1.tofNSigmaKa());
871+
histos.fill(HIST("ExpTpcdEdx_ptwise"), track1.pt(), tpcExpSignalKa, track1.tofNSigmaKa());
872+
histos.fill(HIST("ExpSigma_ptwise"), track1.pt(), track1.tpcExpSigmaKa(), track1.tofNSigmaKa());
873+
}
874+
}
875+
if (cfgPIDParticle == kProtons) {
847876
histos.fill(HIST("TofTpcNsigma_before"), track1.tpcNSigmaPr(), track1.tofNSigmaPr(), track1.pt());
877+
if (cfgGetdEdx) {
878+
double tpcExpSignalPr = track1.tpcSignal() - (track1.tpcNSigmaPr() * track1.tpcExpSigmaPr());
879+
880+
histos.fill(HIST("TpcdEdx_ptwise"), track1.pt(), track1.tpcSignal(), track1.tofNSigmaPr());
881+
histos.fill(HIST("ExpTpcdEdx_ptwise"), track1.pt(), tpcExpSignalPr, track1.tofNSigmaPr());
882+
histos.fill(HIST("ExpSigma_ptwise"), track1.pt(), track1.tpcExpSigmaPr(), track1.tofNSigmaPr());
883+
}
884+
}
848885
}
849886
if (cfgGetNsigmaQA && cfgUseItsPID) {
850887
if (cfgPIDParticle == kPions)
@@ -855,18 +892,12 @@ struct PidDiHadron {
855892
histos.fill(HIST("TofItsNsigma_before"), itsResponse.nSigmaITS<o2::track::PID::Proton>(track1), track1.tofNSigmaPr(), track1.pt());
856893
}
857894

858-
if (cfgGetNsigmaQA)
859-
histos.fill(HIST("TpcdEdx_ptwise"), track1.tpcSignal(), track1.pt());
860-
861895
if (cfgPIDParticle && getNsigmaPID(track1) != cfgPIDParticle)
862896
continue; // if PID is selected, check if the track has the right PID
863897

864898
if (cfgGetNsigmaQA)
865899
fillNsigmaAfterCut(track1, cfgPIDParticle);
866900

867-
if (cfgGetNsigmaQA)
868-
histos.fill(HIST("TpcdEdx_ptwise_afterCut"), track1.tpcSignal(), track1.pt());
869-
870901
if (!getEfficiencyCorrection(triggerWeight, track1.eta(), track1.pt(), posZ))
871902
continue;
872903
if (system == SameEvent) {
@@ -1518,6 +1549,10 @@ struct PidDiHadron {
15181549
// Check the PDG code for the particles (MC truth) and match with analysed Nsigma PID
15191550
if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) {
15201551
histos.fill(HIST("hNsigmaPionTrue"), track.pt());
1552+
histos.fill(HIST("TpcdEdx_ptwise_pi"), track.pt(), track.tpcSignal(), track.tofNSigmaPi());
1553+
1554+
double tpcExpSignalPi = track.tpcSignal() - (track.tpcNSigmaPi() * track.tpcExpSigmaPi());
1555+
histos.fill(HIST("ExpTpcdEdx_ptwise_pi"), track.pt(), tpcExpSignalPi, track.tofNSigmaPi());
15211556

15221557
if (pidIndex == kPions) {
15231558
histos.fill(HIST("hNsigmaPionTruePositives"), track.pt());
@@ -1526,6 +1561,10 @@ struct PidDiHadron {
15261561

15271562
if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) {
15281563
histos.fill(HIST("hNsigmaKaonTrue"), track.pt());
1564+
histos.fill(HIST("TpcdEdx_ptwise_ka"), track.pt(), track.tpcSignal(), track.tofNSigmaKa());
1565+
1566+
double tpcExpSignalKa = track.tpcSignal() - (track.tpcNSigmaKa() * track.tpcExpSigmaKa());
1567+
histos.fill(HIST("ExpTpcdEdx_ptwise_ka"), track.pt(), tpcExpSignalKa, track.tofNSigmaKa());
15291568

15301569
if (pidIndex == kKaons) {
15311570
histos.fill(HIST("hNsigmaKaonTruePositives"), track.pt());
@@ -1534,12 +1573,15 @@ struct PidDiHadron {
15341573

15351574
if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) {
15361575
histos.fill(HIST("hNsigmaProtonTrue"), track.pt());
1576+
histos.fill(HIST("TpcdEdx_ptwise_pr"), track.pt(), track.tpcSignal(), track.tofNSigmaPr());
1577+
1578+
double tpcExpSignalPr = track.tpcSignal() - (track.tpcNSigmaPr() * track.tpcExpSigmaPr());
1579+
histos.fill(HIST("ExpTpcdEdx_ptwise_pr"), track.pt(), tpcExpSignalPr, track.tofNSigmaPr());
15371580

15381581
if (pidIndex == kProtons) {
15391582
histos.fill(HIST("hNsigmaProtonTruePositives"), track.pt());
15401583
}
15411584
} // Proton condition
1542-
15431585
} // end of tracks MC loop
15441586
} // end of process MC
15451587
PROCESS_SWITCH(PidDiHadron, processMC, "Process Monte Carlo", true);

0 commit comments

Comments
 (0)