Skip to content

Commit 0c67fa6

Browse files
committed
added configurable enablePureDCAHistogram for enabling pure DCA histogram based on nsigmaTPCKa cut
1 parent 6f7fe59 commit 0c67fa6

File tree

1 file changed

+66
-65
lines changed

1 file changed

+66
-65
lines changed

PWGLF/Tasks/Nuspex/spectraTOF.cxx

Lines changed: 66 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
///
1919

2020
// O2 includes
21+
// o2-linter: disable=all
2122
#include <string>
2223
#include <vector>
2324
#include "ReconstructionDataFormats/Track.h"
@@ -40,7 +41,6 @@
4041
#include "PWGLF/DataModel/mcCentrality.h"
4142
#include "Common/Core/RecoDecay.h"
4243
#include "TPDGCode.h"
43-
#include "Framework/PhysicsConstants.h"
4444
using namespace o2;
4545
using namespace o2::track;
4646
using namespace o2::framework;
@@ -1060,23 +1060,23 @@ struct tofSpectra {
10601060
}
10611061
}
10621062
}
1063-
}
1064-
}
1065-
const bool isInPtRangeForPhi = track.pt() < 1.1f && track.pt() > 0.9f;
1066-
if (track.sign() > 0) {
1067-
histos.fill(HIST(hdcaxy[id]), track.pt(), track.dcaXY());
1068-
histos.fill(HIST(hdcaz[id]), track.pt(), track.dcaZ());
1069-
if (isInPtRangeForPhi) {
1070-
if (enableDCAxyphiHistograms) {
1071-
histos.fill(HIST(hdcaxyphi[id]), track.phi(), track.dcaXY());
1072-
}
1073-
}
1074-
} else {
1075-
histos.fill(HIST(hdcaxy[id + Np]), track.pt(), track.dcaXY());
1076-
histos.fill(HIST(hdcaz[id + Np]), track.pt(), track.dcaZ());
1077-
if (isInPtRangeForPhi) {
1078-
if (enableDCAxyphiHistograms) {
1079-
histos.fill(HIST(hdcaxyphi[id + Np]), track.phi(), track.dcaXY());
1063+
} else {
1064+
if (track.sign() > 0) {
1065+
histos.fill(HIST(hdcaxy[id]), track.pt(), track.dcaXY());
1066+
histos.fill(HIST(hdcaz[id]), track.pt(), track.dcaZ());
1067+
if (isInPtRangeForPhi) {
1068+
if (enableDCAxyphiHistograms) {
1069+
histos.fill(HIST(hdcaxyphi[id]), track.phi(), track.dcaXY());
1070+
}
1071+
}
1072+
} else {
1073+
histos.fill(HIST(hdcaxy[id + Np]), track.pt(), track.dcaXY());
1074+
histos.fill(HIST(hdcaz[id + Np]), track.pt(), track.dcaZ());
1075+
if (isInPtRangeForPhi) {
1076+
if (enableDCAxyphiHistograms) {
1077+
histos.fill(HIST(hdcaxyphi[id + Np]), track.phi(), track.dcaXY());
1078+
}
1079+
}
10801080
}
10811081
}
10821082
}
@@ -1491,9 +1491,9 @@ struct tofSpectra {
14911491
if (mcParticle.isPhysicalPrimary()) {
14921492
if (isTPCPion && rapidityPi <= trkselOptions.cfgCutY) {
14931493
if (usePDGcode) {
1494-
if (pdgCode == o2::constants::physics::Pdg::kPiPlus) {
1494+
if (pdgCode == 211) {
14951495
histos.fill(HIST("nsigmatpc/mc_closure/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity);
1496-
} else if (pdgCode == o2::constants::physics::Pdg::kPiMinus) {
1496+
} else if (pdgCode == -211) {
14971497
histos.fill(HIST("nsigmatpc/mc_closure/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity);
14981498
}
14991499
} else {
@@ -1503,9 +1503,9 @@ struct tofSpectra {
15031503
}
15041504
if (isTPCKaon && rapidityKa <= trkselOptions.cfgCutY) {
15051505
if (usePDGcode) {
1506-
if (pdgCode == o2::constants::physics::Pdg::kKPlus) {
1506+
if (pdgCode == 321) {
15071507
histos.fill(HIST("nsigmatpc/mc_closure/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity);
1508-
} else if (pdgCode == o2::constants::physics::Pdg::kKMinus) {
1508+
} else if (pdgCode == -321) {
15091509
histos.fill(HIST("nsigmatpc/mc_closure/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity);
15101510
}
15111511
} else {
@@ -1515,9 +1515,9 @@ struct tofSpectra {
15151515
}
15161516
if (isTPCProton && rapidityPr <= trkselOptions.cfgCutY) {
15171517
if (usePDGcode) {
1518-
if (pdgCode == o2::constants::physics::Pdg::kProton) {
1518+
if (pdgCode == 2212) {
15191519
histos.fill(HIST("nsigmatpc/mc_closure/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity);
1520-
} else if (pdgCode == o2::constants::physics::Pdg::kProtonBar) {
1520+
} else if (pdgCode == -2212) {
15211521
histos.fill(HIST("nsigmatpc/mc_closure/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity);
15221522
}
15231523
} else {
@@ -1529,9 +1529,9 @@ struct tofSpectra {
15291529
// TOF Selection and Histogram Filling
15301530
if (isTOFPion && rapidityPi <= trkselOptions.cfgCutY) {
15311531
if (usePDGcode) {
1532-
if (pdgCode == o2::constants::physics::Pdg::kPiPlus) {
1532+
if (pdgCode == 211) {
15331533
histos.fill(HIST("nsigmatof/mc_closure/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity);
1534-
} else if (pdgCode == o2::constants::physics::Pdg::kPiMinus) {
1534+
} else if (pdgCode == -211) {
15351535
histos.fill(HIST("nsigmatof/mc_closure/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity);
15361536
}
15371537
} else {
@@ -1541,9 +1541,9 @@ struct tofSpectra {
15411541
}
15421542
if (isTOFKaon && rapidityKa <= trkselOptions.cfgCutY) {
15431543
if (usePDGcode) {
1544-
if (pdgCode == o2::constants::physics::Pdg::kKPlus) {
1544+
if (pdgCode == 321) {
15451545
histos.fill(HIST("nsigmatof/mc_closure/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity);
1546-
} else if (pdgCode == o2::constants::physics::Pdg::kKMinus) {
1546+
} else if (pdgCode == -321) {
15471547
histos.fill(HIST("nsigmatof/mc_closure/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity);
15481548
}
15491549
} else {
@@ -1553,9 +1553,9 @@ struct tofSpectra {
15531553
}
15541554
if (isTOFProton && rapidityPr <= trkselOptions.cfgCutY) {
15551555
if (usePDGcode) {
1556-
if (pdgCode == o2::constants::physics::Pdg::kProton) {
1556+
if (pdgCode == 2212) {
15571557
histos.fill(HIST("nsigmatof/mc_closure/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity);
1558-
} else if (pdgCode == o2::constants::physics::Pdg::kProtonBar) {
1558+
} else if (pdgCode == -2212) {
15591559
histos.fill(HIST("nsigmatof/mc_closure/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity);
15601560
}
15611561
} else {
@@ -1906,18 +1906,19 @@ struct tofSpectra {
19061906
if (std::abs(mcParticle.y()) > trkselOptions.cfgCutY) {
19071907
return;
19081908
}
1909+
if (enablePureDCAHistogram) {
1910+
const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track);
1911+
const bool isKaonTPC = std::abs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma;
19091912

1910-
const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track);
1911-
const bool isKaonTPC = std::abs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma;
1913+
const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track);
1914+
const bool isKaonTOF = std::abs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma;
19121915

1913-
const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track);
1914-
const bool isKaonTOF = std::abs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma;
1915-
if (enablePureDCAHistogram) {
19161916
// Filling DCA info with the TPC+TOF PID
19171917
bool isDCAPureSample = (std::sqrt(nsigmaTOFKa * nsigmaTOFKa + nsigmaTPCKa * nsigmaTPCKa) < 2.f);
19181918
if (track.pt() <= 0.4) {
19191919
isDCAPureSample = (nsigmaTPCKa < 1.f);
19201920
}
1921+
19211922
if (isDCAPureSample) {
19221923
if (enableDCAvsmotherHistograms) {
19231924
hDcaXYMC[i]->Fill(track.pt(), track.dcaXY());
@@ -2110,7 +2111,7 @@ struct tofSpectra {
21102111
histos.fill(HIST(hpt_num_prm[i]), track.pt(), multiplicity);
21112112
}
21122113
if (isPionTPC || isKaonTPC || isProtonTPC) {
2113-
if (pdgCode == o2::constants::physics::Pdg::kProton) {
2114+
if (pdgCode == 2212) {
21142115
if (isImpactParam) {
21152116
histos.fill(HIST("MC/withPID/pr/pos/prm/pt/num"), track.pt(), impParam);
21162117
if (!mcParticle.isPhysicalPrimary()) {
@@ -2130,7 +2131,7 @@ struct tofSpectra {
21302131
}
21312132
}
21322133
}
2133-
} else if (pdgCode == o2::constants::physics::Pdg::kProtonBar) {
2134+
} else if (pdgCode == -2212) {
21342135
if (isImpactParam) {
21352136
histos.fill(HIST("MC/withPID/pr/neg/prm/pt/num"), track.pt(), impParam);
21362137
if (!mcParticle.isPhysicalPrimary()) {
@@ -2150,7 +2151,7 @@ struct tofSpectra {
21502151
}
21512152
}
21522153
}
2153-
} else if (pdgCode == o2::constants::physics::Pdg::kPiPlus) {
2154+
} else if (pdgCode == 211) {
21542155
if (isImpactParam) {
21552156
histos.fill(HIST("MC/withPID/pi/pos/prm/pt/num"), track.pt(), impParam);
21562157
if (!mcParticle.isPhysicalPrimary()) {
@@ -2170,7 +2171,7 @@ struct tofSpectra {
21702171
}
21712172
}
21722173
}
2173-
} else if (pdgCode == o2::constants::physics::Pdg::kPiMinus) {
2174+
} else if (pdgCode == -211) {
21742175
if (isImpactParam) {
21752176
histos.fill(HIST("MC/withPID/pi/neg/prm/pt/num"), track.pt(), impParam);
21762177
if (!mcParticle.isPhysicalPrimary()) {
@@ -2190,7 +2191,7 @@ struct tofSpectra {
21902191
}
21912192
}
21922193
}
2193-
} else if (pdgCode == o2::constants::physics::Pdg::kKPlus) {
2194+
} else if (pdgCode == 321) {
21942195
if (isImpactParam) {
21952196
histos.fill(HIST("MC/withPID/ka/pos/prm/pt/num"), track.pt(), impParam);
21962197
if (!mcParticle.isPhysicalPrimary()) {
@@ -2210,7 +2211,7 @@ struct tofSpectra {
22102211
}
22112212
}
22122213
}
2213-
} else if (pdgCode == o2::constants::physics::Pdg::kKMinus) {
2214+
} else if (pdgCode == -321) {
22142215
if (isImpactParam) {
22152216
histos.fill(HIST("MC/withPID/ka/neg/prm/pt/num"), track.pt(), impParam);
22162217
if (!mcParticle.isPhysicalPrimary()) {
@@ -2247,7 +2248,7 @@ struct tofSpectra {
22472248
if (track.hasTOF()) {
22482249
if (isPionTOF || isKaonTOF || isProtonTOF) {
22492250
// Proton (positive)
2250-
if (pdgCode == o2::constants::physics::Pdg::kProton) {
2251+
if (pdgCode == 2212) {
22512252
if (isImpactParam) {
22522253
histos.fill(HIST("MC/withPID/pr/pos/prm/pt/numtof"), track.pt(), impParam);
22532254
} else {
@@ -2261,7 +2262,7 @@ struct tofSpectra {
22612262
histos.fill(HIST("MC/withPID/pr/pos/prm/pt/numtof_matched"), track.pt(), multiplicity);
22622263
}
22632264
}
2264-
} else if (pdgCode == o2::constants::physics::Pdg::kProtonBar) {
2265+
} else if (pdgCode == -2212) {
22652266
if (isImpactParam) {
22662267
histos.fill(HIST("MC/withPID/pr/neg/prm/pt/numtof"), track.pt(), impParam);
22672268
} else {
@@ -2274,7 +2275,7 @@ struct tofSpectra {
22742275
histos.fill(HIST("MC/withPID/pr/neg/prm/pt/numtof_matched"), track.pt(), multiplicity);
22752276
}
22762277
}
2277-
} else if (pdgCode == o2::constants::physics::Pdg::kPiPlus) {
2278+
} else if (pdgCode == 211) {
22782279
if (isImpactParam) {
22792280
histos.fill(HIST("MC/withPID/pi/pos/prm/pt/numtof"), track.pt(), impParam);
22802281
} else {
@@ -2288,7 +2289,7 @@ struct tofSpectra {
22882289
histos.fill(HIST("MC/withPID/pi/pos/prm/pt/numtof_matched"), track.pt(), multiplicity);
22892290
}
22902291
}
2291-
} else if (pdgCode == o2::constants::physics::Pdg::kPiMinus) {
2292+
} else if (pdgCode == -211) {
22922293
if (isImpactParam) {
22932294
histos.fill(HIST("MC/withPID/pi/neg/prm/pt/numtof"), track.pt(), impParam);
22942295
} else {
@@ -2302,7 +2303,7 @@ struct tofSpectra {
23022303
histos.fill(HIST("MC/withPID/pi/neg/prm/pt/numtof_matched"), track.pt(), multiplicity);
23032304
}
23042305
}
2305-
} else if (pdgCode == o2::constants::physics::Pdg::kKPlus) {
2306+
} else if (pdgCode == 321) {
23062307
if (isImpactParam) {
23072308
histos.fill(HIST("MC/withPID/ka/pos/prm/pt/numtof"), track.pt(), impParam);
23082309
} else {
@@ -2316,7 +2317,7 @@ struct tofSpectra {
23162317
histos.fill(HIST("MC/withPID/ka/pos/prm/pt/numtof_matched"), track.pt(), multiplicity);
23172318
}
23182319
}
2319-
} else if (pdgCode == o2::constants::physics::Pdg::kKMinus) {
2320+
} else if (pdgCode == -321) {
23202321
if (isImpactParam) {
23212322
histos.fill(HIST("MC/withPID/ka/neg/prm/pt/numtof"), track.pt(), impParam);
23222323
} else {
@@ -2660,17 +2661,17 @@ struct tofSpectra {
26602661
continue;
26612662
}
26622663

2663-
if (pdgCode == o2::constants::physics::Pdg::kProton) {
2664+
if (pdgCode == 2212) {
26642665
histos.fill(HIST("MC/test/pr/pos/prm/pt/den"), pt, multiplicity);
2665-
} else if (pdgCode == o2::constants::physics::Pdg::kProtonBar) {
2666+
} else if (pdgCode == -2212) {
26662667
histos.fill(HIST("MC/test/pr/neg/prm/pt/den"), pt, multiplicity);
2667-
} else if (pdgCode == o2::constants::physics::Pdg::kPiPlus) {
2668+
} else if (pdgCode == 211) {
26682669
histos.fill(HIST("MC/test/pi/pos/prm/pt/den"), pt, multiplicity);
2669-
} else if (pdgCode == o2::constants::physics::Pdg::kPiMinus) {
2670+
} else if (pdgCode == -211) {
26702671
histos.fill(HIST("MC/test/pi/neg/prm/pt/den"), pt, multiplicity);
2671-
} else if (pdgCode == o2::constants::physics::Pdg::kKPlus) {
2672+
} else if (pdgCode == 321) {
26722673
histos.fill(HIST("MC/test/ka/pos/prm/pt/den"), pt, multiplicity);
2673-
} else if (pdgCode == o2::constants::physics::Pdg::kKMinus) {
2674+
} else if (pdgCode == -321) {
26742675
histos.fill(HIST("MC/test/ka/neg/prm/pt/den"), pt, multiplicity);
26752676
}
26762677
}
@@ -2741,33 +2742,33 @@ struct tofSpectra {
27412742
const bool isProtonTOF = track.hasTOF() && std::abs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma;
27422743

27432744
if (isPionTPC || isKaonTPC || isProtonTPC) {
2744-
if (pdgCode == o2::constants::physics::Pdg::kProton) {
2745+
if (pdgCode == 2212) {
27452746
histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/num"), pt, multiplicity);
2746-
} else if (pdgCode == o2::constants::physics::Pdg::kProtonBar) {
2747+
} else if (pdgCode == -2212) {
27472748
histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/num"), pt, multiplicity);
2748-
} else if (pdgCode == o2::constants::physics::Pdg::kPiPlus) {
2749+
} else if (pdgCode == 211) {
27492750
histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/num"), pt, multiplicity);
2750-
} else if (pdgCode == o2::constants::physics::Pdg::kPiMinus) {
2751+
} else if (pdgCode == -211) {
27512752
histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/num"), pt, multiplicity);
2752-
} else if (pdgCode == o2::constants::physics::Pdg::kKPlus) {
2753+
} else if (pdgCode == 321) {
27532754
histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/num"), pt, multiplicity);
2754-
} else if (pdgCode == o2::constants::physics::Pdg::kKMinus) {
2755+
} else if (pdgCode == -321) {
27552756
histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/num"), pt, multiplicity);
27562757
}
27572758
}
27582759

27592760
if (isPionTOF || isKaonTOF || isProtonTOF) {
2760-
if (pdgCode == o2::constants::physics::Pdg::kProton) {
2761+
if (pdgCode == 2212) {
27612762
histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/numtof"), pt, multiplicity);
2762-
} else if (pdgCode == o2::constants::physics::Pdg::kProtonBar) {
2763+
} else if (pdgCode == -2212) {
27632764
histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/numtof"), pt, multiplicity);
2764-
} else if (pdgCode == o2::constants::physics::Pdg::kPiPlus) {
2765+
} else if (pdgCode == 211) {
27652766
histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/numtof"), pt, multiplicity);
2766-
} else if (pdgCode == o2::constants::physics::Pdg::kPiMinus) {
2767+
} else if (pdgCode == -211) {
27672768
histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/numtof"), pt, multiplicity);
2768-
} else if (pdgCode == o2::constants::physics::Pdg::kKPlus) {
2769+
} else if (pdgCode == 321) {
27692770
histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/numtof"), pt, multiplicity);
2770-
} else if (pdgCode == o2::constants::physics::Pdg::kKMinus) {
2771+
} else if (pdgCode == -321) {
27712772
histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/numtof"), pt, multiplicity);
27722773
}
27732774
}

0 commit comments

Comments
 (0)