Skip to content

Commit e7e7207

Browse files
[PWGLF] Test histogram for TOF nSigma with MC (#14929)
1 parent d48d12e commit e7e7207

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

PWGLF/Tasks/Nuspex/spectraTOF.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ std::array<std::shared_ptr<TH2>, NpCharge> hDecayLengthMCNotHF; // Decay Length
7979
std::array<std::shared_ptr<TH2>, NpCharge> hPtNumTOFMatchWithPIDSignalPrm; // Pt distribution of particles with a hit in the TOF and a compatible signal
8080

8181
std::array<std::array<std::shared_ptr<TH3>, NpCharge>, 3> hMCpdg_nsigmaTPC; // 2D array of nsigmaTPC histograms [Selection: pi,K,p][True PDG: 18 species]
82+
std::array<std::array<std::shared_ptr<TH3>, NpCharge>, 3> hMCpdg_nsigmaTOF; // 2D array of nsigmaTPC histograms [Selection: pi,K,p][True PDG: 18 species]
8283

8384
// Spectra task
8485
struct tofSpectra {
@@ -452,6 +453,7 @@ struct tofSpectra {
452453
histos.add("Data/cent/neg/pt/its_tof", "neg ITS-TOF", kTH3D, {ptAxis, multAxis, occupancyAxis});
453454
}
454455
const AxisSpec nsigmaTPCAxisOccupancy{binsOptions.binsnsigmaTPC, "nsigmaTPC"};
456+
const AxisSpec nsigmaTOFAxisOccupancy{binsOptions.binsnsigmaTOF, "nsigmaTOF"};
455457
if (doprocessMCclosure) {
456458
histos.add("nsigmatpc/mc_closure/pos/pi", "mc_closure dependent pion", kTHnSparseD, {ptAxis, nsigmaTPCAxisOccupancy, multAxis});
457459
histos.add("nsigmatpc/mc_closure/neg/pi", "mc_closure dependent pion", kTHnSparseD, {ptAxis, nsigmaTPCAxisOccupancy, multAxis});
@@ -591,6 +593,7 @@ struct tofSpectra {
591593
for (int par = 2; par <= 4; par++) {
592594
for (int i = 0; i < NpCharge; i++) {
593595
hMCpdg_nsigmaTPC[par - 2][i] = histos.add<TH3>(Form("test_mclabels/nsigmatpc/%s/%s/pdg_%i", (i < Np) ? "pos" : "neg", pN[par], PDGs[i % Np]), Form("True %s (%i) in %s selection", pTCharge[i], PDGs[i], (i < Np) ? pTCharge[par] : pTCharge[par + Np]), kTH3D, {ptAxis, nsigmaTPCAxisOccupancy, multAxis});
596+
hMCpdg_nsigmaTOF[par - 2][i] = histos.add<TH3>(Form("test_mclabels/nsigmatof/%s/%s/pdg_%i", (i < Np) ? "pos" : "neg", pN[par], PDGs[i % Np]), Form("True %s (%i) in %s selection", pTCharge[i], PDGs[i], (i < Np) ? pTCharge[par] : pTCharge[par + Np]), kTH3D, {ptAxis, nsigmaTOFAxisOccupancy, multAxis});
594597
}
595598
}
596599
}
@@ -2817,6 +2820,7 @@ struct tofSpectra {
28172820
int pdgCode = mcParticle.pdgCode();
28182821
static_for<2, 4>([&](auto par) {
28192822
const auto& nsigmaTPCpar = o2::aod::pidutils::tpcNSigma<par>(track);
2823+
const auto& nsigmaTOFpar = o2::aod::pidutils::tofNSigma<par>(track);
28202824
bool isTPCpar = std::abs(nsigmaTPCpar) < trkselOptions.cfgCutNsigma;
28212825
// Precompute rapidity values to avoid redundant calculations
28222826
double rapiditypar = std::abs(track.rapidity(PID::getMass(par)));
@@ -2825,6 +2829,7 @@ struct tofSpectra {
28252829
static_for<0, 17>([&](auto i) {
28262830
if (pdgCode == PDGs[i]) {
28272831
hMCpdg_nsigmaTPC[par - 2][i]->Fill(track.pt(), nsigmaTPCpar, multiplicity);
2832+
hMCpdg_nsigmaTOF[par - 2][i]->Fill(track.pt(), nsigmaTOFpar, multiplicity);
28282833
}
28292834
});
28302835
}

0 commit comments

Comments
 (0)