Skip to content

Commit cb9f6cd

Browse files
authored
Use constexpr for histogram naming (#4798)
1 parent d1c23a8 commit cb9f6cd

4 files changed

Lines changed: 109 additions & 88 deletions

File tree

Analysis/Tasks/PWGLF/spectraTOF.cxx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@ using namespace o2;
2121
using namespace o2::framework;
2222
using namespace o2::framework::expressions;
2323

24-
const int Np = 9;
25-
const TString pN[Np] = {"El", "Mu", "Pi", "Ka", "Pr", "De", "Tr", "He", "Al"};
26-
const TString pT[Np] = {"#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
2724
struct TOFSpectraTask {
25+
static constexpr int Np = 9;
26+
static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
27+
static constexpr const char* hp[Np] = {"p/El", "p/Mu", "p/Pi", "p/Ka", "p/Pr", "p/De", "p/Tr", "p/He", "p/Al"};
28+
static constexpr const char* hpt[Np] = {"pt/El", "pt/Mu", "pt/Pi", "pt/Ka", "pt/Pr", "pt/De", "pt/Tr", "pt/He", "pt/Al"};
2829
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
2930

3031
void init(o2::framework::InitContext&)
3132
{
3233
histos.add("p/Unselected", "Unselected;#it{p} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
3334
histos.add("pt/Unselected", "Unselected;#it{p}_{T} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
3435
for (int i = 0; i < Np; i++) {
35-
histos.add(Form("p/%s", pN[i].Data()), Form("%s;#it{p} (GeV/#it{c})", pT[i].Data()), kTH1F, {{100, 0, 20}});
36-
histos.add(Form("pt/%s", pN[i].Data()), Form("%s;#it{p}_{T} (GeV/#it{c})", pT[i].Data()), kTH1F, {{100, 0, 20}});
36+
histos.add(hp[i], Form("%s;#it{p} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}});
37+
histos.add(hpt[i], Form("%s;#it{p}_{T} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}});
3738
}
3839
histos.add("electronbeta/hp_El", ";#it{p} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
3940
histos.add("electronbeta/hpt_El", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
@@ -43,10 +44,12 @@ struct TOFSpectraTask {
4344
histos.add("electronbeta/hp_betasigma_El", ";#it{p} (GeV/#it{c});(#beta - #beta_{e})/#sigma;Tracks", kTH2D, {{100, 0, 20}, {100, -5, 5}});
4445
}
4546

47+
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
48+
Configurable<float> cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"};
4649
Configurable<float> nsigmacut{"nsigmacut", 3, "Value of the Nsigma cut"};
4750

48-
Filter trackFilter = aod::track::isGlobalTrack == true;
49-
51+
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
52+
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::isGlobalTrack == true) && (aod::track::tofSignal > 0.f);
5053
using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTOF, aod::pidRespTOFbeta, aod::TrackSelection>>;
5154
void process(TrackCandidates::iterator const& track)
5255
{
@@ -59,8 +62,8 @@ struct TOFSpectraTask {
5962
if (abs(nsigma[i]) > nsigmacut.value) {
6063
continue;
6164
}
62-
histos.fill(Form("p/%s", pN[i].Data()), track.p());
63-
histos.fill(Form("pt/%s", pN[i].Data()), track.pt());
65+
histos.fill(hp[i], track.p());
66+
histos.fill(hpt[i], track.pt());
6467
}
6568
//
6669
if (TMath::Abs(track.separationbetael() < 1.f)) {

Analysis/Tasks/PWGLF/spectraTPC.cxx

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ using namespace o2;
2020
using namespace o2::framework;
2121
using namespace o2::framework::expressions;
2222

23-
const int Np = 9;
24-
const TString pN[Np] = {"El", "Mu", "Pi", "Ka", "Pr", "De", "Tr", "He", "Al"};
25-
const TString pT[Np] = {"#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
26-
2723
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
2824
{
2925
std::vector<ConfigParamSpec> options{
@@ -54,50 +50,20 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
5450
h->GetXaxis()->Set(nbins, binp); \
5551
}
5652

57-
struct TPCPIDQASignalwTOFTask {
58-
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
59-
60-
void init(o2::framework::InitContext&)
61-
{
62-
for (int i = 0; i < Np; i++) {
63-
histos.add("signal/htpcsignal" + pN[i], ";#it{p} (GeV/#it{c});TPC Signal;N_{#sigma}^{TPC}(" + pT[i] + ")", kTH3D, {{1000, 0.001, 20}, {1000, 0, 1000}, {20, -10, 10}});
64-
makelogaxis(histos.get<TH3>("hexp" + pN[i]));
65-
}
66-
}
67-
68-
// Filters
69-
CANDIDATE_SELECTION
70-
71-
Filter trackFilterTOF = (aod::track::tofSignal > 0); // Skip tracks without TOF
72-
using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTPC, aod::pidRespTOF, aod::TrackSelection>>;
73-
void process(TrackCandidates::iterator const& track)
74-
{
75-
// const float mom = track.p();
76-
const float mom = track.tpcInnerParam();
77-
histos.fill("htpcsignalEl", mom, track.tpcSignal(), track.tofNSigmaEl());
78-
histos.fill("htpcsignalMu", mom, track.tpcSignal(), track.tofNSigmaMu());
79-
histos.fill("htpcsignalPi", mom, track.tpcSignal(), track.tofNSigmaPi());
80-
histos.fill("htpcsignalKa", mom, track.tpcSignal(), track.tofNSigmaKa());
81-
histos.fill("htpcsignalPr", mom, track.tpcSignal(), track.tofNSigmaPr());
82-
histos.fill("htpcsignalDe", mom, track.tpcSignal(), track.tofNSigmaDe());
83-
histos.fill("htpcsignalTr", mom, track.tpcSignal(), track.tofNSigmaTr());
84-
histos.fill("htpcsignalHe", mom, track.tpcSignal(), track.tofNSigmaHe());
85-
histos.fill("htpcsignalAl", mom, track.tpcSignal(), track.tofNSigmaAl());
86-
}
87-
};
88-
53+
constexpr int Np = 9;
8954
struct TPCSpectraTask {
55+
static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
56+
static constexpr const char* hp[Np] = {"p/El", "p/Mu", "p/Pi", "p/Ka", "p/Pr", "p/De", "p/Tr", "p/He", "p/Al"};
57+
static constexpr const char* hpt[Np] = {"pt/El", "pt/Mu", "pt/Pi", "pt/Ka", "pt/Pr", "pt/De", "pt/Tr", "pt/He", "pt/Al"};
9058
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
91-
HistogramRegistry pt{"pt", {}, OutputObjHandlingPolicy::AnalysisObject};
92-
HistogramRegistry p{"pt", {}, OutputObjHandlingPolicy::AnalysisObject};
9359

9460
void init(o2::framework::InitContext&)
9561
{
9662
histos.add("p/Unselected", "Unselected;#it{p} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
9763
histos.add("pt/Unselected", "Unselected;#it{p}_{T} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
9864
for (int i = 0; i < Np; i++) {
99-
histos.add("p/" + pN[i], pT[i] + ";#it{p} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
100-
histos.add("pt/" + pN[i], pT[i] + ";#it{p}_{T} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
65+
histos.add(hp[i], Form("%s;#it{p} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}});
66+
histos.add(hpt[i], Form("%s;#it{p}_{T} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}});
10167
}
10268
}
10369

@@ -112,18 +78,54 @@ struct TPCSpectraTask {
11278
const float nsigma[Np] = {track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(),
11379
track.tpcNSigmaKa(), track.tpcNSigmaPr(), track.tpcNSigmaDe(),
11480
track.tpcNSigmaTr(), track.tpcNSigmaHe(), track.tpcNSigmaAl()};
115-
p.fill("Unselected", track.p());
116-
pt.fill("Unselected", track.pt());
81+
histos.fill("p/Unselected", track.p());
82+
histos.fill("pt/Unselected", track.pt());
11783
for (int i = 0; i < Np; i++) {
11884
if (abs(nsigma[i]) > nsigmacut.value) {
11985
continue;
12086
}
121-
p.fill(pN[i], track.p());
122-
pt.fill(pN[i], track.pt());
87+
histos.fill(hp[i], track.p());
88+
histos.fill(hpt[i], track.pt());
12389
}
12490
}
12591
};
12692

93+
struct TPCPIDQASignalwTOFTask {
94+
static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
95+
static constexpr const char* htpcsignal[Np] = {"tpcsignal/El", "tpcsignal/Mu", "tpcsignal/Pi",
96+
"tpcsignal/Ka", "tpcsignal/Pr", "tpcsignal/De",
97+
"tpcsignal/Tr", "tpcsignal/He", "tpcsignal/Al"};
98+
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
99+
100+
void init(o2::framework::InitContext&)
101+
{
102+
for (int i = 0; i < Np; i++) {
103+
histos.add(htpcsignal[i], Form(";#it{p} (GeV/#it{c});TPC Signal;N_{#sigma}^{TPC}(%s)", pT[i]), kTH3D, {{1000, 0.001, 20}, {1000, 0, 1000}, {20, -10, 10}});
104+
makelogaxis(histos.get<TH3>(htpcsignal[i]));
105+
}
106+
}
107+
108+
// Filters
109+
CANDIDATE_SELECTION
110+
111+
Filter trackFilterTOF = (aod::track::tofSignal > 0.f); // Skip tracks without TOF
112+
using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTPC, aod::pidRespTOF, aod::TrackSelection>>;
113+
void process(TrackCandidates::iterator const& track)
114+
{
115+
// const float mom = track.p();
116+
const float mom = track.tpcInnerParam();
117+
histos.fill(htpcsignal[0], mom, track.tpcSignal(), track.tofNSigmaEl());
118+
histos.fill(htpcsignal[1], mom, track.tpcSignal(), track.tofNSigmaMu());
119+
histos.fill(htpcsignal[2], mom, track.tpcSignal(), track.tofNSigmaPi());
120+
histos.fill(htpcsignal[3], mom, track.tpcSignal(), track.tofNSigmaKa());
121+
histos.fill(htpcsignal[4], mom, track.tpcSignal(), track.tofNSigmaPr());
122+
histos.fill(htpcsignal[5], mom, track.tpcSignal(), track.tofNSigmaDe());
123+
histos.fill(htpcsignal[6], mom, track.tpcSignal(), track.tofNSigmaTr());
124+
histos.fill(htpcsignal[7], mom, track.tpcSignal(), track.tofNSigmaHe());
125+
histos.fill(htpcsignal[8], mom, track.tpcSignal(), track.tofNSigmaAl());
126+
}
127+
};
128+
127129
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
128130
{
129131
int TPCwTOF = cfgc.options().get<int>("add-tof-histos");

Analysis/Tasks/pidTOF.cxx

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,18 @@ struct pidTOFTaskBeta {
135135
}
136136
};
137137

138-
const int Np = 9;
139-
const TString pN[Np] = {"El", "Mu", "Pi", "Ka", "Pr", "De", "Tr", "He", "Al"};
140-
const TString pT[Np] = {"#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
141138
struct pidTOFTaskQA {
139+
static constexpr int Np = 9;
140+
static constexpr const char* hexpected[Np] = {"expected/El", "expected/Mu", "expected/Pi",
141+
"expected/Ka", "expected/Pr", "expected/De",
142+
"expected/Tr", "expected/He", "expected/Al"};
143+
static constexpr const char* hexpected_diff[Np] = {"expected_diff/El", "expected_diff/Mu", "expected_diff/Pi",
144+
"expected_diff/Ka", "expected_diff/Pr", "expected_diff/De",
145+
"expected_diff/Tr", "expected_diff/He", "expected_diff/Al"};
146+
static constexpr const char* hnsigma[Np] = {"nsigma/El", "nsigma/Mu", "nsigma/Pi",
147+
"nsigma/Ka", "nsigma/Pr", "nsigma/De",
148+
"nsigma/Tr", "nsigma/He", "nsigma/Al"};
149+
static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
142150
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::QAObject};
143151

144152
Configurable<int> nBinsP{"nBinsP", 400, "Number of bins for the momentum"};
@@ -165,22 +173,22 @@ struct pidTOFTaskQA {
165173
void init(o2::framework::InitContext&)
166174
{
167175
// Event properties
168-
histos.add("event/hvertexz", ";Vtx_{z} (cm);Entries", HistType::kTH1F, {{100, -20, 20}});
176+
histos.add("event/vertexz", ";Vtx_{z} (cm);Entries", HistType::kTH1F, {{100, -20, 20}});
169177
histos.add("event/colltime", ";Collision time (ps);Entries", HistType::kTH1F, {{100, -2000, 2000}});
170-
histos.add("event/htofsignal", ";#it{p} (GeV/#it{c});TOF Signal", HistType::kTH2F, {{nBinsP, MinP, MaxP}, {10000, 0, 2e6}});
171-
makelogaxis(histos.get<TH2>("event/htofsignal"));
172-
histos.add("event/htofbeta", ";#it{p} (GeV/#it{c});TOF #beta", HistType::kTH2F, {{nBinsP, MinP, MaxP}, {1000, 0, 2}});
173-
makelogaxis(histos.get<TH2>("event/htofbeta"));
178+
histos.add("event/tofsignal", ";#it{p} (GeV/#it{c});TOF Signal", HistType::kTH2F, {{nBinsP, MinP, MaxP}, {10000, 0, 2e6}});
179+
makelogaxis(histos.get<TH2>("event/tofsignal"));
180+
histos.add("event/tofbeta", ";#it{p} (GeV/#it{c});TOF #beta", HistType::kTH2F, {{nBinsP, MinP, MaxP}, {1000, 0, 2}});
181+
makelogaxis(histos.get<TH2>("event/tofbeta"));
174182
for (int i = 0; i < Np; i++) {
175183
// Exp signal
176-
histos.add("expected/" + pN[i], Form(";#it{p} (GeV/#it{c});t_{exp}(%s)", pT[i].Data()), HistType::kTH2F, {{nBinsP, MinP, MaxP}, {1000, 0, 2e6}});
177-
makelogaxis(histos.get<TH2>("expected/" + pN[i]));
184+
histos.add(hexpected[i], Form(";#it{p} (GeV/#it{c});t_{exp}(%s)", pT[i]), HistType::kTH2F, {{nBinsP, MinP, MaxP}, {1000, 0, 2e6}});
185+
makelogaxis(histos.get<TH2>(hexpected[i]));
178186
// T-Texp
179-
histos.add("timediff/" + pN[i], Form(";#it{p} (GeV/#it{c});(t-t_{evt}-t_{exp}(%s))", pT[i].Data()), HistType::kTH2F, {{nBinsP, MinP, MaxP}, {100, -1000, 1000}});
180-
makelogaxis(histos.get<TH2>("timediff/" + pN[i]));
187+
histos.add(hexpected_diff[i], Form(";#it{p} (GeV/#it{c});(t-t_{evt}-t_{exp}(%s))", pT[i]), HistType::kTH2F, {{nBinsP, MinP, MaxP}, {100, -1000, 1000}});
188+
makelogaxis(histos.get<TH2>(hexpected_diff[i]));
181189
// NSigma
182-
histos.add("nsigma/" + pN[i], Form(";#it{p} (GeV/#it{c});N_{#sigma}^{TOF}(%s)", pT[i].Data()), HistType::kTH2F, {{nBinsP, MinP, MaxP}, {200, -10, 10}});
183-
makelogaxis(histos.get<TH2>("nsigma/" + pN[i]));
190+
histos.add(hnsigma[i], Form(";#it{p} (GeV/#it{c});N_{#sigma}^{TOF}(%s)", pT[i]), HistType::kTH2F, {{nBinsP, MinP, MaxP}, {200, -10, 10}});
191+
makelogaxis(histos.get<TH2>(hnsigma[i]));
184192
}
185193
}
186194
#undef makelogaxis
@@ -197,22 +205,22 @@ struct pidTOFTaskQA {
197205
}
198206
const float tof = t.tofSignal() - collision.collisionTime();
199207
//
200-
histos.fill("event/htofsignal", t.p(), t.tofSignal());
201-
histos.fill("event/htofbeta", t.p(), t.beta());
208+
histos.fill("event/tofsignal", t.p(), t.tofSignal());
209+
histos.fill("event/tofbeta", t.p(), t.beta());
202210
//
203211
const float exp[Np] = {t.tofExpSignalEl(), t.tofExpSignalMu(), t.tofExpSignalPi(),
204212
t.tofExpSignalKa(), t.tofExpSignalPr(), t.tofExpSignalDe(),
205213
t.tofExpSignalTr(), t.tofExpSignalHe(), t.tofExpSignalAl()};
206214
for (int i = 0; i < Np; i++) {
207-
histos.fill("expected/" + pN[i], t.p(), exp[i]);
208-
histos.fill("timediff/" + pN[i], t.p(), tof - exp[i]);
215+
histos.fill(hexpected[i], t.p(), exp[i]);
216+
histos.fill(hexpected_diff[i], t.p(), tof - exp[i]);
209217
}
210218
//
211219
const float nsigma[Np] = {t.tofNSigmaEl(), t.tofNSigmaMu(), t.tofNSigmaPi(),
212220
t.tofNSigmaKa(), t.tofNSigmaPr(), t.tofNSigmaDe(),
213221
t.tofNSigmaTr(), t.tofNSigmaHe(), t.tofNSigmaAl()};
214222
for (int i = 0; i < Np; i++) {
215-
histos.fill("nsigma/" + pN[i], t.p(), nsigma[i]);
223+
histos.fill(hnsigma[i], t.p(), nsigma[i]);
216224
}
217225
}
218226
}

Analysis/Tasks/pidTPC.cxx

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,18 @@ struct pidTPCTask {
111111
}
112112
};
113113

114-
const int Np = 9;
115-
const TString pN[Np] = {"El", "Mu", "Pi", "Ka", "Pr", "De", "Tr", "He", "Al"};
116-
const TString pT[Np] = {"#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
117114
struct pidTPCTaskQA {
115+
static constexpr int Np = 9;
116+
static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
117+
static constexpr const char* hexpected[Np] = {"expected/El", "expected/Mu", "expected/Pi",
118+
"expected/Ka", "expected/Pr", "expected/De",
119+
"expected/Tr", "expected/He", "expected/Al"};
120+
static constexpr const char* hexpected_diff[Np] = {"expected_diff/El", "expected_diff/Mu", "expected_diff/Pi",
121+
"expected_diff/Ka", "expected_diff/Pr", "expected_diff/De",
122+
"expected_diff/Tr", "expected_diff/He", "expected_diff/Al"};
123+
static constexpr const char* hnsigma[Np] = {"nsigma/El", "nsigma/Mu", "nsigma/Pi",
124+
"nsigma/Ka", "nsigma/Pr", "nsigma/De",
125+
"nsigma/Tr", "nsigma/He", "nsigma/Al"};
118126
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::QAObject};
119127

120128
Configurable<int> nBinsP{"nBinsP", 400, "Number of bins for the momentum"};
@@ -142,19 +150,19 @@ struct pidTPCTaskQA {
142150
}
143151

144152
// Event properties
145-
histos.add("event/hvertexz", ";Vtx_{z} (cm);Entries", kTH1F, {{100, -20, 20}});
146-
histos.add("event/htpcsignal", ";#it{p} (GeV/#it{c});TPC Signal", kTH2F, {{nBinsP, MinP, MaxP}, {1000, 0, 1000}});
147-
makelogaxis(histos.get<TH2>("event/htpcsignal"));
153+
histos.add("event/vertexz", ";Vtx_{z} (cm);Entries", kTH1F, {{100, -20, 20}});
154+
histos.add("event/tpcsignal", ";#it{p} (GeV/#it{c});TPC Signal", kTH2F, {{nBinsP, MinP, MaxP}, {1000, 0, 1000}});
155+
makelogaxis(histos.get<TH2>("event/tpcsignal"));
148156
for (int i = 0; i < Np; i++) {
149157
// Exp signal
150-
histos.add("expected/" + pN[i], Form(";#it{p} (GeV/#it{c});d#it{E}/d#it{x}_(%s)", pT[i].Data()), kTH2F, {{nBinsP, MinP, MaxP}, {1000, 0, 1000}});
151-
makelogaxis(histos.get<TH2>("expected/" + pN[i]));
158+
histos.add(hexpected[i], Form(";#it{p} (GeV/#it{c});d#it{E}/d#it{x}_(%s)", pT[i]), kTH2F, {{nBinsP, MinP, MaxP}, {1000, 0, 1000}});
159+
makelogaxis(histos.get<TH2>(hexpected[i]));
152160
// Signal - Expected signal
153-
histos.add("expected_diff/" + pN[i], Form(";#it{p} (GeV/#it{c});;d#it{E}/d#it{x} - d#it{E}/d#it{x}(%s)", pT[i].Data()), kTH2F, {{nBinsP, MinP, MaxP}, {1000, -500, 500}});
154-
makelogaxis(histos.get<TH2>("expected_diff/" + pN[i]));
161+
histos.add(hexpected_diff[i], Form(";#it{p} (GeV/#it{c});;d#it{E}/d#it{x} - d#it{E}/d#it{x}(%s)", pT[i]), kTH2F, {{nBinsP, MinP, MaxP}, {1000, -500, 500}});
162+
makelogaxis(histos.get<TH2>(hexpected_diff[i]));
155163
// NSigma
156-
histos.add("nsigma/" + pN[i], Form(";#it{p} (GeV/#it{c});N_{#sigma}^{TPC}(%s)", pT[i].Data()), kTH2F, {{nBinsP, MinP, MaxP}, {200, -10, 10}});
157-
makelogaxis(histos.get<TH2>("nsigma/" + pN[i]));
164+
histos.add(hnsigma[i], Form(";#it{p} (GeV/#it{c});N_{#sigma}^{TPC}(%s)", pT[i]), kTH2F, {{nBinsP, MinP, MaxP}, {200, -10, 10}});
165+
makelogaxis(histos.get<TH2>(hnsigma[i]));
158166
}
159167
#undef makelogaxis
160168
}
@@ -165,21 +173,21 @@ struct pidTPCTaskQA {
165173
for (auto t : tracks) {
166174
// const float mom = t.p();
167175
const float mom = t.tpcInnerParam();
168-
histos.fill("event/htpcsignal", mom, t.tpcSignal());
176+
histos.fill("event/tpcsignal", mom, t.tpcSignal());
169177
//
170178
const float exp[Np] = {t.tpcExpSignalEl(), t.tpcExpSignalMu(), t.tpcExpSignalPi(),
171179
t.tpcExpSignalKa(), t.tpcExpSignalPr(), t.tpcExpSignalDe(),
172180
t.tpcExpSignalTr(), t.tpcExpSignalHe(), t.tpcExpSignalAl()};
173181
for (int i = 0; i < Np; i++) {
174-
histos.fill("expected/" + pN[i], mom, exp[i]);
175-
histos.fill("expected_diff/" + pN[i], mom, t.tpcSignal() - exp[i]);
182+
histos.fill(hexpected[i], mom, exp[i]);
183+
histos.fill(hexpected_diff[i], mom, t.tpcSignal() - exp[i]);
176184
}
177185
//
178186
const float nsigma[Np] = {t.tpcNSigmaEl(), t.tpcNSigmaMu(), t.tpcNSigmaPi(),
179187
t.tpcNSigmaKa(), t.tpcNSigmaPr(), t.tpcNSigmaDe(),
180188
t.tpcNSigmaTr(), t.tpcNSigmaHe(), t.tpcNSigmaAl()};
181189
for (int i = 0; i < Np; i++) {
182-
histos.fill("nsigma/" + pN[i], t.p(), nsigma[i]);
190+
histos.fill(hnsigma[i], t.p(), nsigma[i]);
183191
}
184192
}
185193
}

0 commit comments

Comments
 (0)