Skip to content

Commit 7ae9e82

Browse files
RD0407alibuild
andauthored
[PWGLF] Update PWGLF/Tasks/Nuspex/spectraTOF.cxx (#9522)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 0175c6c commit 7ae9e82

File tree

1 file changed

+81
-11
lines changed

1 file changed

+81
-11
lines changed

PWGLF/Tasks/Nuspex/spectraTOF.cxx

Lines changed: 81 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ struct tofSpectra { // o2-linter: disable=name/struct
8686

8787
struct : ConfigurableGroup {
8888
Configurable<float> cfgCutEtaMax{"cfgCutEtaMax", 0.8f, "Max eta range for tracks"};
89-
Configurable<float> cfgCutNsigma{"cfgCutNsigma", 10.0f, "nsigma cut range for tracks"};
89+
Configurable<float> cfgCutNsigma{"cfgCutNsigma", 100.0f, "nsigma cut range for tracks"};
9090
Configurable<float> cfgCutEtaMin{"cfgCutEtaMin", -0.8f, "Min eta range for tracks"};
9191
Configurable<float> cfgCutY{"cfgCutY", 0.5f, "Y range for tracks"};
9292
Configurable<int> lastRequiredTrdCluster{"lastRequiredTrdCluster", 5, "Last cluster to require in TRD for track selection. -1 does not require any TRD cluster"};
@@ -134,7 +134,7 @@ struct tofSpectra { // o2-linter: disable=name/struct
134134
Configurable<float> maxChi2PerClusterITS{"maxChi2PerClusterITS", 36.f, "Additional cut on the maximum value of the chi2 per cluster in the ITS"};
135135
Configurable<float> maxDcaXYFactor{"maxDcaXYFactor", 1.f, "Additional cut on the maximum value of the DCA xy (multiplicative factor)"};
136136
Configurable<float> maxDcaZ{"maxDcaZ", 2.f, "Additional cut on the maximum value of the DCA z"};
137-
Configurable<float> minTPCNClsFound{"minTPCNClsFound", 0.f, "Additional cut on the minimum value of the number of found clusters in the TPC"};
137+
Configurable<float> minTPCNClsFound{"minTPCNClsFound", 100.f, "Additional cut on the minimum value of the number of found clusters in the TPC"};
138138
Configurable<bool> makeTHnSparseChoice{"makeTHnSparseChoice", false, "choose if produce thnsparse"}; // RD
139139
Configurable<bool> enableTPCTOFvsEtaHistograms{"enableTPCTOFvsEtaHistograms", false, "choose if produce TPC tof vs Eta"};
140140
Configurable<bool> includeCentralityMC{"includeCentralityMC", true, "choose if include Centrality to MC"};
@@ -459,6 +459,18 @@ struct tofSpectra { // o2-linter: disable=name/struct
459459
histos.add("MC/fake/neg", "Fake negative tracks", kTH1D, {ptAxis});
460460
histos.add("MC/no_collision/pos", "No collision pos track", kTH1D, {ptAxis});
461461
histos.add("MC/no_collision/neg", "No collision neg track", kTH1D, {ptAxis});
462+
histos.add("MC/withPID/pi/pos/prm/pt/num", "recons. MC #pi^{+}", kTHnSparseD, {ptAxis, impParamAxis});
463+
histos.add("MC/withPID/pi/neg/prm/pt/num", "recons. MC #pi^{-}", kTHnSparseD, {ptAxis, impParamAxis});
464+
histos.add("MC/withPID/ka/pos/prm/pt/num", "recons. MC K^{+}", kTHnSparseD, {ptAxis, impParamAxis});
465+
histos.add("MC/withPID/ka/neg/prm/pt/num", "recons. MC K^{-}", kTHnSparseD, {ptAxis, impParamAxis});
466+
histos.add("MC/withPID/pr/pos/prm/pt/num", "recons. MC p", kTHnSparseD, {ptAxis, impParamAxis});
467+
histos.add("MC/withPID/pr/neg/prm/pt/num", "recons. MC #bar{p}", kTHnSparseD, {ptAxis, impParamAxis});
468+
histos.add("MC/withPID/pi/pos/prm/pt/numtof", "recons. MC #pi^{+}", kTHnSparseD, {ptAxis, impParamAxis});
469+
histos.add("MC/withPID/pi/neg/prm/pt/numtof", "recons. MC #pi^{-}", kTHnSparseD, {ptAxis, impParamAxis});
470+
histos.add("MC/withPID/ka/pos/prm/pt/numtof", "recons. MC K^{+}", kTHnSparseD, {ptAxis, impParamAxis});
471+
histos.add("MC/withPID/ka/neg/prm/pt/numtof", "recons. MC K^{-}", kTHnSparseD, {ptAxis, impParamAxis});
472+
histos.add("MC/withPID/pr/pos/prm/pt/numtof", "recons. MC p", kTHnSparseD, {ptAxis, impParamAxis});
473+
histos.add("MC/withPID/pr/neg/prm/pt/numtof", "recons. MC #bar{p}", kTHnSparseD, {ptAxis, impParamAxis});
462474
if (doprocessMCgen) {
463475
histos.add("MC/test/pi/pos/prm/pt/den", "generated MC #pi^{+}", kTHnSparseD, {ptAxis, impParamAxis});
464476
histos.add("MC/test/pi/neg/prm/pt/den", "generated MC #pi^{-}", kTHnSparseD, {ptAxis, impParamAxis});
@@ -745,6 +757,7 @@ struct tofSpectra { // o2-linter: disable=name/struct
745757
}
746758
const auto& nsigmaTOF = o2::aod::pidutils::tofNSigma<id>(track);
747759
const auto& nsigmaTPC = o2::aod::pidutils::tpcNSigma<id>(track);
760+
748761
// const auto id = track.sign() > 0 ? id : id + Np;
749762
const float multiplicity = getMultiplicity(collision);
750763
if (multiplicityEstimator == MultCodes::kNoMultiplicity) {
@@ -1347,10 +1360,13 @@ struct tofSpectra { // o2-linter: disable=name/struct
13471360
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr> const& tracks)
13481361
{
13491362
// Event selection criteria
1350-
if (!collision.sel8() || std::abs(collision.posZ()) > 10 || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder) ||
1363+
/*if (!collision.sel8() || std::abs(collision.posZ()) > 10 || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder) ||
13511364
!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) ||
13521365
!collision.selection_bit(aod::evsel::kNoSameBunchPileup) ||
13531366
!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) {
1367+
return;
1368+
}*/
1369+
if (!isEventSelected<true, true>(collision)) {
13541370
return;
13551371
}
13561372
histos.fill(HIST("test_occupancy/event/vertexz"), collision.posZ());
@@ -1364,10 +1380,12 @@ struct tofSpectra { // o2-linter: disable=name/struct
13641380

13651381
for (const auto& track : tracks) {
13661382
// Track selection criteria
1367-
if (track.tpcNClsCrossedRows() < 70 || track.tpcChi2NCl() > 4 || track.tpcChi2NCl() < 0.5 ||
1368-
track.itsChi2NCl() > 36 || std::abs(track.dcaXY()) > 0.05 || std::abs(track.dcaZ()) > 2.0 ||
1369-
std::abs(track.eta()) > 0.8 || track.tpcCrossedRowsOverFindableCls() < 0.8 || track.tpcNClsFound() < 100 ||
1370-
!(o2::aod::track::ITSrefit) || !(o2::aod::track::TPCrefit)) {
1383+
/* if (track.tpcNClsCrossedRows() < minNCrossedRowsTPC || track.tpcChi2NCl() > maxChi2PerClusterTPC || track.tpcChi2NCl() > maxChi2PerClusterTPC ||
1384+
track.itsChi2NCl() > maxChi2PerClusterITS || std::abs(track.dcaXY()) > maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f)) || std::abs(track.dcaZ()) > maxDcaZ.value || track.eta() < trkselOptions.cfgCutEtaMin || track.eta() > trkselOptions.cfgCutEtaMax || track.tpcCrossedRowsOverFindableCls() < minNCrossedRowsOverFindableClustersTPC || track.tpcNClsFound() < minTPCNClsFound ||
1385+
!(o2::aod::track::ITSrefit) || !(o2::aod::track::TPCrefit)) {
1386+
continue;
1387+
}*/
1388+
if (!isTrackSelected<true>(track, collision)) {
13711389
continue;
13721390
}
13731391
const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track);
@@ -1438,7 +1456,7 @@ struct tofSpectra { // o2-linter: disable=name/struct
14381456
histos.fill(HIST("test_occupancy/tpcCount"), tpcCount);
14391457
histos.fill(HIST("test_occupancy/tofCount"), tofCount);
14401458
} // process function
1441-
PROCESS_SWITCH(tofSpectra, processOccupancy, "check for occupancy plots", false);
1459+
PROCESS_SWITCH(tofSpectra, processOccupancy, "check for occupancy plots", true);
14421460

14431461
void processStandard(CollisionCandidates::iterator const& collision,
14441462
TrackCandidates const& tracks)
@@ -1659,6 +1677,7 @@ struct tofSpectra { // o2-linter: disable=name/struct
16591677

16601678
const auto& mcCollision = collision.mcCollision_as<GenMCCollisions>();
16611679
float multiplicity = getMultiplicityMC(mcCollision);
1680+
int occupancy = collision.trackOccupancyInTimeRange();
16621681
//************************************RD**************************************************
16631682
if (includeCentralityMC) {
16641683
multiplicity = mcCollision.impactParameter();
@@ -1804,6 +1823,22 @@ struct tofSpectra { // o2-linter: disable=name/struct
18041823
if (!passesDCAxyCut(track)) { // Skipping tracks that don't pass the standard cuts
18051824
return;
18061825
}
1826+
int pdgCode = mcParticle.pdgCode();
1827+
const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track);
1828+
const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track);
1829+
const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track);
1830+
1831+
bool isPionTPC = std::abs(nsigmaTPCPi) < trkselOptions.cfgCutNsigma;
1832+
bool isKaonTPC = std::abs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma;
1833+
bool isProtonTPC = std::abs(nsigmaTPCPr) < trkselOptions.cfgCutNsigma;
1834+
1835+
const auto& nsigmaTOFPi = o2::aod::pidutils::tofNSigma<2>(track);
1836+
const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track);
1837+
const auto& nsigmaTOFPr = o2::aod::pidutils::tofNSigma<4>(track);
1838+
1839+
bool isPionTOF = std::abs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma;
1840+
bool isKaonTOF = std::abs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma;
1841+
bool isProtonTOF = std::abs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma;
18071842

18081843
if (!mcParticle.isPhysicalPrimary()) {
18091844
if (mcParticle.getProcess() == 4) {
@@ -1834,10 +1869,25 @@ struct tofSpectra { // o2-linter: disable=name/struct
18341869
}
18351870
} else {
18361871
if (includeCentralityMC) {
1837-
histos.fill(HIST(hpt_num_prm[i]), track.pt(), multiplicity, track.dcaXY());
1872+
histos.fill(HIST(hpt_num_prm[i]), track.pt(), multiplicity, track.dcaXY(), occupancy);
18381873
} else {
18391874
histos.fill(HIST(hpt_num_prm[i]), track.pt(), multiplicity);
18401875
}
1876+
if (isPionTPC || isKaonTPC || isProtonTPC) {
1877+
if (pdgCode == 2212) {
1878+
histos.fill(HIST("MC/withPID/pr/pos/prm/pt/num"), track.pt(), multiplicity);
1879+
} else if (pdgCode == -2212) {
1880+
histos.fill(HIST("MC/withPID/pr/neg/prm/pt/num"), track.pt(), multiplicity);
1881+
} else if (pdgCode == 211) {
1882+
histos.fill(HIST("MC/withPID/pi/pos/prm/pt/num"), track.pt(), multiplicity);
1883+
} else if (pdgCode == -211) {
1884+
histos.fill(HIST("MC/withPID/pi/neg/prm/pt/num"), track.pt(), multiplicity);
1885+
} else if (pdgCode == 321) {
1886+
histos.fill(HIST("MC/withPID/ka/pos/prm/pt/num"), track.pt(), multiplicity);
1887+
} else if (pdgCode == -321) {
1888+
histos.fill(HIST("MC/withPID/ka/neg/prm/pt/num"), track.pt(), multiplicity);
1889+
}
1890+
}
18411891
if (track.hasTRD() && trkselOptions.lastRequiredTrdCluster > 0) {
18421892
int lastLayer = 0;
18431893
for (int l = 7; l >= 0; l--) {
@@ -1851,8 +1901,23 @@ struct tofSpectra { // o2-linter: disable=name/struct
18511901
}
18521902
}
18531903
if (track.hasTOF()) {
1904+
if (isPionTOF || isKaonTOF || isProtonTOF) {
1905+
if (pdgCode == 2212) {
1906+
histos.fill(HIST("MC/withPID/pr/pos/prm/pt/numtof"), track.pt(), multiplicity);
1907+
} else if (pdgCode == -2212) {
1908+
histos.fill(HIST("MC/withPID/pr/neg/prm/pt/numtof"), track.pt(), multiplicity);
1909+
} else if (pdgCode == 211) {
1910+
histos.fill(HIST("MC/withPID/pi/pos/prm/pt/numtof"), track.pt(), multiplicity);
1911+
} else if (pdgCode == -211) {
1912+
histos.fill(HIST("MC/withPID/pi/neg/prm/pt/numtof"), track.pt(), multiplicity);
1913+
} else if (pdgCode == 321) {
1914+
histos.fill(HIST("MC/withPID/ka/pos/prm/pt/numtof"), track.pt(), multiplicity);
1915+
} else if (pdgCode == -321) {
1916+
histos.fill(HIST("MC/withPID/ka/neg/prm/pt/numtof"), track.pt(), multiplicity);
1917+
}
1918+
}
18541919
if (includeCentralityMC) {
1855-
histos.fill(HIST(hpt_numtof_prm[i]), track.pt(), multiplicity, track.dcaXY());
1920+
histos.fill(HIST(hpt_numtof_prm[i]), track.pt(), multiplicity, track.dcaXY(), occupancy);
18561921
} else {
18571922
histos.fill(HIST(hpt_numtof_prm[i]), track.pt(), multiplicity);
18581923
}
@@ -1899,7 +1964,11 @@ struct tofSpectra { // o2-linter: disable=name/struct
18991964
histos.fill(HIST(hpt_den_mat[i]), mcParticle.pt(), multiplicity);
19001965
}
19011966
} else {
1902-
histos.fill(HIST(hpt_den_prm[i]), mcParticle.pt(), multiplicity);
1967+
if (includeCentralityMC) {
1968+
histos.fill(HIST(hpt_den_prm[i]), mcParticle.pt(), multiplicity);
1969+
} else {
1970+
histos.fill(HIST(hpt_den_prm[i]), mcParticle.pt(), multiplicity);
1971+
}
19031972
}
19041973
}
19051974

@@ -1989,6 +2058,7 @@ struct tofSpectra { // o2-linter: disable=name/struct
19892058
SliceCache cache;
19902059
void processMC(soa::Join<aod::Tracks, aod::TracksExtra,
19912060
aod::TracksDCA, aod::McTrackLabels,
2061+
aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,
19922062
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr,
19932063
aod::TrackSelection> const& tracks,
19942064
aod::McParticles const& mcParticles,

0 commit comments

Comments
 (0)