56void PID::initializeHistograms()
58 TH1::AddDirectory(
false);
60 mMapHist[
"hdEdxTotVspPos"].emplace_back(std::make_unique<TH2F>(fmt::format(
"hdEdxTotVsP_Pos_{}",
name).
data(), (fmt::format(
"Q_{{Tot}} positive particles {}",
name) +
";#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Tot} (arb. unit)").
data(), 200,
bins.data(),
binNumber,
binsdEdxTot_Log.data()));
61 mMapHist[
"hdEdxTotVspNeg"].emplace_back(std::make_unique<TH2F>(fmt::format(
"hdEdxTotVsP_Neg_{}",
name).
data(), (fmt::format(
"Q_{{Tot}} negative particles {}",
name) +
";#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Tot} (arb. unit)").
data(), 200,
bins.data(),
binNumber,
binsdEdxTot_Log.data()));
62 mMapHist[
"hNClsPID"].emplace_back(std::make_unique<TH1F>(
"hNClsPID",
"Number of clusters (after cuts); # of clusters; counts", 160, 0, 160));
63 mMapHist[
"hNClsSubPID"].emplace_back(std::make_unique<TH1F>(
"hNClsSubPID",
"Number of clusters (after cuts); # of clusters; counts", 160, 0, 160));
65 mMapHist[
"hdEdxVsTgl"].emplace_back(std::make_unique<TH2F>(
"hdEdxVsTgl",
"dEdx (a.u.) vs tan#lambda; tan#lambda; dEdx (a.u.)", 60, -2, 2, 300, 0, 300));
68 if (logPtBinning.size() > 0) {
69 mMapHist[
"hdEdxTotVspBeforeCuts"].emplace_back(std::make_unique<TH2F>(
"hdEdxTotVspBeforeCuts",
"dEdx (a.u.) vs p (GeV/#it{c}) (before cuts); p (GeV/#it{c}); dEdx (a.u.)", logPtBinning.size() - 1, logPtBinning.data(),
binNumber,
binsdEdxTot_Log.data()));
70 mMapHist[
"hdEdxMaxVspBeforeCuts"].emplace_back(std::make_unique<TH2F>(
"hdEdxMaxVspBeforeCuts",
"dEdx_Max (a.u.) vs p (GeV/#it{c}) (before cuts); p (GeV/#it{c}); dEdx (a.u.)", logPtBinning.size() - 1, logPtBinning.data(),
binNumber,
binsdEdxMax_Log.data()));
72 if (!mTurnOffHistosForAsync) {
73 mMapHist[
"hdEdxVsPhiMipsAside"].emplace_back(std::make_unique<TH2F>(
"hdEdxVsPhiMipsAside",
"dEdx (a.u.) vs #phi (rad) of MIPs (A side); #phi (rad); dEdx (a.u.)", 180, 0., 2 * M_PI, 25, 35, 60));
74 mMapHist[
"hdEdxVsPhiMipsCside"].emplace_back(std::make_unique<TH2F>(
"hdEdxVsPhiMipsCside",
"dEdx (a.u.) vs #phi (rad) of MIPs (C side); #phi (rad); dEdx (a.u.)", 180, 0., 2 * M_PI, 25, 35, 60));
75 mMapHist[
"hdEdxVsPhi"].emplace_back(std::make_unique<TH2F>(
"hdEdxVsPhi",
"dEdx (a.u.) vs #phi (rad); #phi (rad); dEdx (a.u.)", 180, 0., 2 * M_PI, 300, 0, 300));
76 mMapHist[
"hdEdxVsncls"].emplace_back(std::make_unique<TH2F>(
"hdEdxVsncls",
"dEdx (a.u.) vs ncls; ncls; dEdx (a.u.)", 80, 0, 160, 300, 0, 300));
79 for (
size_t idEdxType = 0; idEdxType <
rocNames.size(); ++idEdxType) {
81 mMapHist[
"hdEdxTotVsp"].emplace_back(std::make_unique<TH2F>(fmt::format(
"hdEdxTotVsP_{}",
name).
data(), (fmt::format(
"Q_{{Tot}} {}",
name) +
";#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Tot} (arb. unit)").
data(), 200,
bins.data(),
binNumber,
binsdEdxTot_Log.data()));
82 mMapHist[
"hdEdxMaxVsp"].emplace_back(std::make_unique<TH2F>(fmt::format(
"hdEdxMaxVsP_{}",
name).
data(), (fmt::format(
"Q_{{Max}} {}",
name) +
";#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Max} (arb. unit)").
data(), 200,
bins.data(),
binNumber,
binsdEdxMax_Log.data()));
93 mMapHist[
"hMIPNclVsTgl"].emplace_back(std::make_unique<TH2F>(fmt::format(
"hMIPNclVsTgl_{}",
name).
data(), (fmt::format(
"rec. clusters {}",
name) +
";#tan(#lambda); rec clusters").
data(), 50, -2, 2,
nclMax[idEdxType] -
nclCuts[idEdxType],
nclCuts[idEdxType],
nclMax[idEdxType]));
94 mMapHist[
"hMIPNclVsTglSub"].emplace_back(std::make_unique<TH2F>(fmt::format(
"hMIPNclVsTglSub_{}",
name).
data(), (fmt::format(
"sub-thrs. clusters {}",
name) +
";#tan(#lambda);sub-thrs. clusters").
data(), 50, -2, 2, 20, 0, 20));
95 if (mGetdEdxVspHypoHist) {
96 mMapHist[
"hdEdxVspHypoPos"].emplace_back(std::make_unique<TH2F>(fmt::format(
"hdEdxVspHypoPos_{}",
name).
data(), (fmt::format(
"Q_{{Tot}} Pos {}",
name) +
";#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Tot} (arb. unit)").
data(), 200,
bins.data(),
binNumber,
binsdEdxTot_Log.data()));
97 mMapHist[
"hdEdxVspHypoNeg"].emplace_back(std::make_unique<TH2F>(fmt::format(
"hdEdxVspHypoNeg_{}",
name).
data(), (fmt::format(
"Q_{{Tot}} Neg {}",
name) +
";#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Tot} (arb. unit)").
data(), 200,
bins.data(),
binNumber,
binsdEdxTot_Log.data()));
122 const auto& dEdx = track.getdEdx();
123 const auto absCharge = track.getAbsCharge();
124 const auto pTPC = (absCharge > 0) ? (track.getP() / absCharge) : track.getP();
125 const auto tgl = track.getTgl();
126 const auto snp = track.getSnp();
127 const auto phi = track.getPhi();
128 const auto ncl = uint8_t(track.getNClusters());
130 const auto eta = track.getEta();
131 mMapHist[
"hdEdxTotVspBeforeCuts"][0]->Fill(pTPC, dEdx.dEdxTotTPC);
132 mMapHist[
"hdEdxMaxVspBeforeCuts"][0]->Fill(pTPC, dEdx.dEdxMaxTPC);
134 if (pTPC < mCutMinpTPC || pTPC > mCutMaxpTPC || ncl < mCutMinnCls) {
138 const std::vector<float> dEdxTot{dEdx.dEdxTotTPC, dEdx.dEdxTotIROC, dEdx.dEdxTotOROC1, dEdx.dEdxTotOROC2, dEdx.dEdxTotOROC3};
139 const std::vector<float> dEdxMax{dEdx.dEdxMaxTPC, dEdx.dEdxMaxIROC, dEdx.dEdxMaxOROC1, dEdx.dEdxMaxOROC2, dEdx.dEdxMaxOROC3};
140 const std::vector<uint8_t> dEdxNcl{
static_cast<uint8_t
>(dEdx.NHitsIROC + dEdx.NHitsOROC1 + dEdx.NHitsOROC2 + dEdx.NHitsOROC3), dEdx.NHitsIROC, dEdx.NHitsOROC1, dEdx.NHitsOROC2, dEdx.NHitsOROC3};
141 const std::vector<uint8_t> dEdxNclSub{
static_cast<uint8_t
>(dEdx.NHitsSubThresholdIROC + dEdx.NHitsSubThresholdOROC1 + dEdx.NHitsSubThresholdOROC2 + dEdx.NHitsSubThresholdOROC3 - (dEdx.NHitsIROC + dEdx.NHitsOROC1 + dEdx.NHitsOROC2 + dEdx.NHitsOROC3)),
static_cast<uint8_t
>(dEdx.NHitsSubThresholdIROC - dEdx.NHitsIROC),
static_cast<uint8_t
>(dEdx.NHitsSubThresholdOROC1 - dEdx.NHitsOROC1),
static_cast<uint8_t
>(dEdx.NHitsSubThresholdOROC2 - dEdx.NHitsOROC2),
static_cast<uint8_t
>(dEdx.NHitsSubThresholdOROC3 - dEdx.NHitsOROC3)};
142 mMapHist[
"hdEdxVsTgl"][0]->Fill(tgl, dEdxTot[0]);
144 if (dEdx.dEdxTotTPC <= 0.) {
147 if (std::abs(tgl) < mCutAbsTgl) {
148 if (!mTurnOffHistosForAsync) {
149 mMapHist[
"hdEdxVsPhi"][0]->Fill(phi, dEdxTot[0]);
150 mMapHist[
"hdEdxVsncls"][0]->Fill(ncl, dEdxTot[0]);
152 mMapHist[
"hNClsPID"][0]->Fill(dEdxNcl[0]);
153 mMapHist[
"hNClsSubPID"][0]->Fill(dEdxNclSub[0]);
155 if (track.getCharge() > 0) {
156 mMapHist[
"hdEdxTotVspPos"][0]->Fill(pTPC, dEdxTot[0]);
158 mMapHist[
"hdEdxTotVspNeg"][0]->Fill(pTPC, dEdxTot[0]);
161 for (
size_t idEdxType = 0; idEdxType <
rocNames.size(); ++idEdxType) {
164 if (track.hasCSideClusters()) {
174 if (std::abs(tgl) < mCutAbsTgl) {
175 mMapHist[
"hdEdxTotVsp"][idEdxType]->Fill(pTPC, dEdxTot[idEdxType]);
176 mMapHist[
"hdEdxMaxVsp"][idEdxType]->Fill(pTPC, dEdxMax[idEdxType]);
177 if (mGetdEdxVspHypoHist) {
178 const auto pidHypothesis = track.getPID().getID();
180 auto pidHist = mMapHist[(track.getCharge() > 0) ?
"hdEdxVspHypoPos" :
"hdEdxVspHypoNeg"][idEdxType].get();
181 pidHist->SetBinContent(pidHist->GetXaxis()->FindBin(pTPC), pidHist->GetYaxis()->FindBin(dEdxTot[idEdxType]), pidHypothesis + 1);
187 if (pTPC > mCutMinpTPCMIPs && pTPC < mCutMaxpTPCMIPs) {
188 mMapHist[
"hdEdxTotMIPVsTgl"][idEdxType]->Fill(tgl, dEdxTot[idEdxType]);
189 mMapHist[
"hdEdxMaxMIPVsTgl"][idEdxType]->Fill(tgl, dEdxMax[idEdxType]);
191 if (dEdxTot[idEdxType] < mCutMaxdEdxTot) {
192 mMapHist[
"hMIPNclVsTgl"][idEdxType]->Fill(tgl, dEdxNcl[idEdxType]);
193 mMapHist[
"hMIPNclVsTglSub"][idEdxType]->Fill(tgl, dEdxNclSub[idEdxType]);
196 if (std::abs(tgl) < mCutAbsTgl) {
197 if (!mTurnOffHistosForAsync) {
198 if (track.hasASideClustersOnly()) {
199 mMapHist[
"hdEdxVsPhiMipsAside"][0]->Fill(phi, dEdxTot[0]);
200 }
else if (track.hasCSideClustersOnly()) {
201 mMapHist[
"hdEdxVsPhiMipsCside"][0]->Fill(phi, dEdxTot[0]);
205 mMapHist[
"hdEdxTotMIP"][idEdxType]->Fill(dEdxTot[idEdxType]);
206 mMapHist[
"hdEdxMaxMIP"][idEdxType]->Fill(dEdxMax[idEdxType]);
208 mMapHist[
"hdEdxTotMIPVsNcl"][idEdxType]->Fill(dEdxNcl[idEdxType], dEdxTot[idEdxType]);
209 mMapHist[
"hdEdxMaxMIPVsNcl"][idEdxType]->Fill(dEdxNcl[idEdxType], dEdxMax[idEdxType]);
211 mMapHist[
"hdEdxTotMIPVsSec"][idEdxType]->Fill(sec, dEdxTot[idEdxType]);
212 mMapHist[
"hdEdxMaxMIPVsSec"][idEdxType]->Fill(sec, dEdxMax[idEdxType]);
214 mMapHist[
"hdEdxTotMIPVsSnp"][idEdxType]->Fill(snp, dEdxTot[idEdxType]);
215 mMapHist[
"hdEdxMaxMIPVsSnp"][idEdxType]->Fill(snp, dEdxMax[idEdxType]);