Skip to content

Commit 3fcf70d

Browse files
authored
[PWGLF] A vector was added to allow for the calibration factors to be modified (#10058)
1 parent 0712125 commit 3fcf70d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

PWGMM/UE/Tasks/dedxAnalysis.cxx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ struct DedxAnalysis {
8787
static constexpr std::string_view kDedxvsMomentumPos[4] = {"dEdx_vs_Momentum_all_Pos", "dEdx_vs_Momentum_Pi_v0_Pos", "dEdx_vs_Momentum_Pr_v0_Pos", "dEdx_vs_Momentum_El_v0_Pos"};
8888
static constexpr std::string_view kDedxvsMomentumNeg[4] = {"dEdx_vs_Momentum_all_Neg", "dEdx_vs_Momentum_Pi_v0_Neg", "dEdx_vs_Momentum_Pr_v0_Neg", "dEdx_vs_Momentum_El_v0_Neg"};
8989
static constexpr double EtaCut[9] = {-0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8};
90-
static constexpr double Correction[8] = {54.5281, 54.6548, 54.6513, 54.6781, 54.6167, 54.7384, 55.0047, 54.9592};
90+
Configurable<std::vector<float>> calibrationFactor{"calibrationFactor", {50.8263, 51.0122, 50.7456, 50.0372, 49.699, 50.2222, 50.7263, 50.8073}, "calibration factors"};
9191
ConfigurableAxis binP{"binP", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, ""};
9292

9393
void init(InitContext const&)
@@ -96,27 +96,27 @@ struct DedxAnalysis {
9696
// MIP for pions
9797
registryDeDx.add(
9898
"hdEdxMIP_vs_eta", "dE/dx", HistType::kTH2F,
99-
{{8, -0.8, 0.8, "#eta"}, {100, 0.0, 600.0, "dE/dx MIP (a. u.)"}});
99+
{{8, -0.8, 0.8, "#eta"}, {100, 0.0, 100.0, "dE/dx MIP (a. u.)"}});
100100
registryDeDx.add(
101101
"hdEdxMIP_vs_phi", "dE/dx", HistType::kTH2F,
102-
{{100, 0.0, 6.4, "#phi"}, {100, 0.0, 600.0, "dE/dx MIP (a. u.)"}});
102+
{{100, 0.0, 6.4, "#phi"}, {100, 0.0, 100.0, "dE/dx MIP (a. u.)"}});
103103

104104
} else {
105105
AxisSpec pAxis = {binP, "#it{p}/Z (GeV/c)"};
106106

107107
registryDeDx.add(
108108
"hdEdxMIP_vs_eta_calibrated", "dE/dx", HistType::kTH2F,
109-
{{8, -0.8, 0.8, "#eta"}, {10, 30.0, 70.0, "dE/dx MIP (a. u.)"}});
109+
{{8, -0.8, 0.8, "#eta"}, {100, 0.0, 100.0, "dE/dx MIP (a. u.)"}});
110110
registryDeDx.add(
111111
"hdEdxMIP_vs_phi", "dE/dx", HistType::kTH2F,
112-
{{100, 0.0, 6.4, "#phi"}, {10, 30.0, 70.0, "dE/dx MIP (a. u.)"}});
112+
{{100, 0.0, 6.4, "#phi"}, {100, 0.0, 100.0, "dE/dx MIP (a. u.)"}});
113113

114114
// De/Dx for ch and v0 particles
115115
for (int i = 0; i < 4; ++i) {
116116
registryDeDx.add(kDedxvsMomentumPos[i].data(), "dE/dx", HistType::kTH3F,
117-
{{pAxis}, {100, 0.0, 600.0, "dE/dx (a. u.)"}, {8, -0.8, 0.8, "#eta"}});
117+
{{pAxis}, {100, 0.0, 100.0, "dE/dx (a. u.)"}, {8, -0.8, 0.8, "#eta"}});
118118
registryDeDx.add(kDedxvsMomentumNeg[i].data(), "dE/dx", HistType::kTH3F,
119-
{{pAxis}, {100, 0.0, 600.0, "dE/dx (a. u.)"}, {8, -0.8, 0.8, "#eta"}});
119+
{{pAxis}, {100, 0.0, 100.0, "dE/dx (a. u.)"}, {8, -0.8, 0.8, "#eta"}});
120120
}
121121
}
122122
// Event Counter
@@ -317,7 +317,7 @@ struct DedxAnalysis {
317317
registryDeDx.fill(HIST("hdEdxMIP_vs_phi"), trk.phi(), trk.tpcSignal());
318318
for (int i = 0; i < 8; ++i) {
319319
if (trk.eta() > EtaCut[i] && trk.eta() < EtaCut[i + 1]) {
320-
registryDeDx.fill(HIST("hdEdxMIP_vs_eta_calibrated"), trk.eta(), trk.tpcSignal() * 50 / Correction[i]);
320+
registryDeDx.fill(HIST("hdEdxMIP_vs_eta_calibrated"), trk.eta(), trk.tpcSignal() * 50 / calibrationFactor->at(i));
321321
}
322322
}
323323
}
@@ -327,9 +327,9 @@ struct DedxAnalysis {
327327
for (int i = 0; i < 8; ++i) {
328328
if (trk.eta() > EtaCut[i] && trk.eta() < EtaCut[i + 1]) {
329329
if (signedP > 0) {
330-
registryDeDx.fill(HIST(kDedxvsMomentumPos[0]), signedP, trk.tpcSignal() * 50 / Correction[i], trk.eta());
330+
registryDeDx.fill(HIST(kDedxvsMomentumPos[0]), signedP, trk.tpcSignal() * 50 / calibrationFactor->at(i), trk.eta());
331331
} else {
332-
registryDeDx.fill(HIST(kDedxvsMomentumNeg[0]), std::abs(signedP), trk.tpcSignal() * 50 / Correction[i], trk.eta());
332+
registryDeDx.fill(HIST(kDedxvsMomentumNeg[0]), std::abs(signedP), trk.tpcSignal() * 50 / calibrationFactor->at(i), trk.eta());
333333
}
334334
}
335335
}
@@ -385,11 +385,11 @@ struct DedxAnalysis {
385385
for (int i = 0; i < 8; ++i) {
386386
if (negTrack.eta() > EtaCut[i] && negTrack.eta() < EtaCut[i + 1]) {
387387

388-
registryDeDx.fill(HIST(kDedxvsMomentumNeg[1]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / Correction[i], negTrack.eta());
388+
registryDeDx.fill(HIST(kDedxvsMomentumNeg[1]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / calibrationFactor->at(i), negTrack.eta());
389389
}
390390
if (posTrack.eta() > EtaCut[i] && posTrack.eta() < EtaCut[i + 1]) {
391391

392-
registryDeDx.fill(HIST(kDedxvsMomentumPos[1]), signedPpos, posTrack.tpcSignal() * 50 / Correction[i], posTrack.eta());
392+
registryDeDx.fill(HIST(kDedxvsMomentumPos[1]), signedPpos, posTrack.tpcSignal() * 50 / calibrationFactor->at(i), posTrack.eta());
393393
}
394394
}
395395
}
@@ -409,11 +409,11 @@ struct DedxAnalysis {
409409
for (int i = 0; i < 8; ++i) {
410410
if (negTrack.eta() > EtaCut[i] && negTrack.eta() < EtaCut[i + 1]) {
411411

412-
registryDeDx.fill(HIST(kDedxvsMomentumNeg[1]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / Correction[i], negTrack.eta());
412+
registryDeDx.fill(HIST(kDedxvsMomentumNeg[1]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / calibrationFactor->at(i), negTrack.eta());
413413
}
414414
if (posTrack.eta() > EtaCut[i] && posTrack.eta() < EtaCut[i + 1]) {
415415

416-
registryDeDx.fill(HIST(kDedxvsMomentumPos[2]), signedPpos, posTrack.tpcSignal() * 50 / Correction[i], posTrack.eta());
416+
registryDeDx.fill(HIST(kDedxvsMomentumPos[2]), signedPpos, posTrack.tpcSignal() * 50 / calibrationFactor->at(i), posTrack.eta());
417417
}
418418
}
419419
}
@@ -433,11 +433,11 @@ struct DedxAnalysis {
433433
for (int i = 0; i < 8; ++i) {
434434
if (negTrack.eta() > EtaCut[i] && negTrack.eta() < EtaCut[i + 1]) {
435435

436-
registryDeDx.fill(HIST(kDedxvsMomentumNeg[2]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / Correction[i], negTrack.eta());
436+
registryDeDx.fill(HIST(kDedxvsMomentumNeg[2]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / calibrationFactor->at(i), negTrack.eta());
437437
}
438438
if (posTrack.eta() > EtaCut[i] && posTrack.eta() < EtaCut[i + 1]) {
439439

440-
registryDeDx.fill(HIST(kDedxvsMomentumPos[1]), signedPpos, posTrack.tpcSignal() * 50 / Correction[i], posTrack.eta());
440+
registryDeDx.fill(HIST(kDedxvsMomentumPos[1]), signedPpos, posTrack.tpcSignal() * 50 / calibrationFactor->at(i), posTrack.eta());
441441
}
442442
}
443443
}
@@ -457,11 +457,11 @@ struct DedxAnalysis {
457457
for (int i = 0; i < 8; ++i) {
458458
if (negTrack.eta() > EtaCut[i] && negTrack.eta() < EtaCut[i + 1]) {
459459

460-
registryDeDx.fill(HIST(kDedxvsMomentumNeg[3]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / Correction[i], negTrack.eta());
460+
registryDeDx.fill(HIST(kDedxvsMomentumNeg[3]), std::abs(signedPneg), negTrack.tpcSignal() * 50 / calibrationFactor->at(i), negTrack.eta());
461461
}
462462
if (posTrack.eta() > EtaCut[i] && posTrack.eta() < EtaCut[i + 1]) {
463463

464-
registryDeDx.fill(HIST(kDedxvsMomentumPos[3]), signedPpos, posTrack.tpcSignal() * 50 / Correction[i], posTrack.eta());
464+
registryDeDx.fill(HIST(kDedxvsMomentumPos[3]), signedPpos, posTrack.tpcSignal() * 50 / calibrationFactor->at(i), posTrack.eta());
465465
}
466466
}
467467
}

0 commit comments

Comments
 (0)