45void Tracks::initializeHistograms()
48 TH1::AddDirectory(
false);
51 mMapHist[
"hNClustersBeforeCuts"] = std::make_unique<TH1F>(
"hNClustersBeforeCuts",
"Number of clusters (before cuts);# TPC clusters",
binsClus.
max, 0,
binsClus.
max);
54 mMapHist[
"hPhiAside"] = std::make_unique<TH1F>(
"hPhiAside",
"Azimuthal angle, A side;#phi", 360, 0., 2 * M_PI);
55 mMapHist[
"hPhiCside"] = std::make_unique<TH1F>(
"hPhiCside",
"Azimuthal angle, C side;#phi", 360, 0., 2 * M_PI);
56 mMapHist[
"hPt"] = std::make_unique<TH1F>(
"hPt",
"Transverse momentum;#it{p}_{T} (GeV/#it{c})", logPtBinning.size() - 1, logPtBinning.data());
57 mMapHist[
"hSign"] = std::make_unique<TH1F>(
"hSign",
"Sign of electric charge;charge sign", 3, -1.5, 1.5);
58 if (!mTurnOffHistosForAsync) {
61 mMapHist[
"hPhiAsideNeg"] = std::make_unique<TH1F>(
"hPhiAsideNeg",
"Azimuthal angle, A side, neg. tracks;#phi", 360, 0., 2 * M_PI);
62 mMapHist[
"hPhiAsidePos"] = std::make_unique<TH1F>(
"hPhiAsidePos",
"Azimuthal angle, A side, pos. tracks;#phi", 360, 0., 2 * M_PI);
63 mMapHist[
"hPhiCsideNeg"] = std::make_unique<TH1F>(
"hPhiCsideNeg",
"Azimuthal angle, C side, neg. tracks;#phi", 360, 0., 2 * M_PI);
64 mMapHist[
"hPhiCsidePos"] = std::make_unique<TH1F>(
"hPhiCsidePos",
"Azimuthal angle, C side, pos. tracks;#phi", 360, 0., 2 * M_PI);
67 mMapHist[
"hPhiAsideRatio"] = std::make_unique<TH1F>(
"hPhiAsideRatio",
"Azimuthal angle, A side, ratio neg./pos.;#phi", 360, 0., 2 * M_PI);
68 mMapHist[
"hPhiCsideRatio"] = std::make_unique<TH1F>(
"hPhiCsideRatio",
"Azimuthal angle, C side, ratio neg./pos.;#phi", 360, 0., 2 * M_PI);
69 mMapHist[
"hPtRatio"] = std::make_unique<TH1F>(
"hPtRatio",
"Transverse momentum, ratio neg./pos. ;#it{p}_{T}", logPtBinning.size() - 1, logPtBinning.data());
70 mMapHist[
"hPhiBothSides"] = std::make_unique<TH1F>(
"hPhiBothSides",
"Azimuthal angle, both sides clusters;#phi", 360, 0., 2 * M_PI);
71 mMapHist[
"hPtNeg"] = std::make_unique<TH1F>(
"hPtNeg",
"Transverse momentum, neg. tracks;#it{p}_{T} (GeV/#it{c})", logPtBinning.size() - 1, logPtBinning.data());
72 mMapHist[
"hPtPos"] = std::make_unique<TH1F>(
"hPtPos",
"Transverse momentum, pos. tracks;#it{p}_{T} (GeV/#it{c})", logPtBinning.size() - 1, logPtBinning.data());
74 mMapHist[
"hEtaBeforeCuts"] = std::make_unique<TH1F>(
"hEtaBeforeCuts",
"Pseudorapidity (before cuts);#eta", 400, -2., 2.);
75 mMapHist[
"hPtBeforeCuts"] = std::make_unique<TH1F>(
"hPtBeforeCuts",
"Transverse momentum (before cuts);#it{p}_{T} (GeV/#it{c})", logPtBinning.size() - 1, logPtBinning.data());
76 mMapHist[
"hQOverPt"] = std::make_unique<TH1F>(
"hQOverPt",
"Charge over transverse momentum;q/#it{p}_{T}", 400, -20., 20.);
79 mMapHist[
"h2DNClustersPhiAside"] = std::make_unique<TH2F>(
"h2DNClustersPhiAside",
"Number of clusters vs. #phi, A side ;#phi;# TPC clusters", 360, 0., 2 * M_PI,
binsClus.
bins,
binsClus.
min,
binsClus.
max);
80 mMapHist[
"h2DNClustersPhiCside"] = std::make_unique<TH2F>(
"h2DNClustersPhiCside",
"Number of clusters vs. #phi, C side ;#phi;# TPC clusters", 360, 0., 2 * M_PI,
binsClus.
bins,
binsClus.
min,
binsClus.
max);
82 mMapHist[
"h2DEtaPhi"] = std::make_unique<TH2F>(
"h2DEtaPhi",
"Tracks in #eta vs. #phi;#phi;#eta", 360, 0., 2 * M_PI,
binsEta.
bins,
binsEta.
min,
binsEta.
max);
83 mMapHist[
"h2DNClustersEtaBeforeCuts"] = std::make_unique<TH2F>(
"h2DNClustersEtaBeforeCuts",
"NClusters vs. #eta (before cuts);#eta;# TPC clusters", 400, -2., 2., 200, -0.5, 199.5);
84 mMapHist[
"h2DNClustersPtBeforeCuts"] = std::make_unique<TH2F>(
"h2DNClustersPtBeforeCuts",
"NClusters vs. #it{p}_{T} (before cuts);#it{p}_{T} (GeV/#it{c});# TPC clusters", logPtBinning.size() - 1, logPtBinning.data(), 200, -0.5, 199.5);
85 mMapHist[
"h2DEtaPhiBeforeCuts"] = std::make_unique<TH2F>(
"h2DEtaPhiBeforeCuts",
"Tracks in #eta vs. #phi (before cuts);#phi;#eta", 360, 0., 2 * M_PI, 400, -2., 2.);
86 if (!mTurnOffHistosForAsync) {
87 mMapHist[
"h2DQOverPtPhiAside"] = std::make_unique<TH2F>(
"h2DQOverPtPhiAside",
"Charger over #it{p}_{T} vs. #phi, A side;#phi;q/#it{p}_{T}", 360, 0., 2 * M_PI, 400, -20., 20.);
88 mMapHist[
"h2DQOverPtPhiCside"] = std::make_unique<TH2F>(
"h2DQOverPtPhiCside",
"Charger over #it{p}_{T} vs. #phi, C side;#phi;q/#it{p}_{T}", 360, 0., 2 * M_PI, 400, -20., 20.);
89 mMapHist[
"h2DEtaPhiNeg"] = std::make_unique<TH2F>(
"h2DEtaPhiNeg",
"Negative tracks in #eta vs. #phi;#phi;#eta", 360, 0., 2 * M_PI,
binsEta.
bins,
binsEta.
min,
binsEta.
max);
90 mMapHist[
"h2DEtaPhiPos"] = std::make_unique<TH2F>(
"h2DEtaPhiPos",
"Positive tracks in #eta vs. #phi;#phi;#eta", 360, 0., 2 * M_PI,
binsEta.
bins,
binsEta.
min,
binsEta.
max);
92 mMapHist[
"hEtaVsPtPos"] = std::make_unique<TH2F>(
"hEtaVsPtPos",
"#eta vs. #it{p}_{T} (Pos.);#it{p}_{T} (GeV/#it{c});#eta", logPtBinning.size() - 1, logPtBinning.data(),
binsEta.
bins,
binsEta.
min,
binsEta.
max);
93 mMapHist[
"hEtaVsPtNeg"] = std::make_unique<TH2F>(
"hEtaVsPtNeg",
"#eta vs. #it{p}_{T} (Neg.);#it{p}_{T} (GeV/#it{c});#eta", logPtBinning.size() - 1, logPtBinning.data(),
binsEta.
bins,
binsEta.
min,
binsEta.
max);
94 mMapHist[
"hPhiVsPtPos"] = std::make_unique<TH2F>(
"hPhiVsPtPos",
"#phi vs. #it{p}_{T} (Pos.);#it{p}_{T} (GeV/#it{c});#phi", logPtBinning.size() - 1, logPtBinning.data(), 360, 0., 2 * M_PI);
95 mMapHist[
"hPhiVsPtNeg"] = std::make_unique<TH2F>(
"hPhiVsPtNeg",
"#phi vs. #it{p}_{T} (Neg.);#it{p}_{T} (GeV/#it{c});#phi", logPtBinning.size() - 1, logPtBinning.data(), 360, 0., 2 * M_PI);
99 mMapHist[fmt::format(
"hDCAr_{}",
type).data()] = std::make_unique<TH2F>(fmt::format(
"hDCAr_{}",
type).
data(), fmt::format(
"DCAr {};#phi;DCAr (cm)",
type).
data(), 360, 0, o2::math_utils::twoPid(),
binsDCAr.
bins,
binsDCAr.
min,
binsDCAr.
max);
100 mMapHist[fmt::format(
"hDCAr_{}_pTmin",
type).data()] = std::make_unique<TH2F>(fmt::format(
"hDCAr_{}_pTmin",
type).
data(), fmt::format(
"DCAr {} #it{{p}}_{{T}}^{{min}};#phi;DCAr (cm)",
type).
data(), 360, 0, o2::math_utils::twoPid(),
binsDCAr.
bins,
binsDCAr.
min,
binsDCAr.
max);
126 const auto eta = track.getEta();
127 const auto phi = track.getPhi();
128 const auto pt = track.getPt();
129 const auto sign = track.getSign();
130 const auto qOverPt = track.getQ2Pt();
131 const auto nCls = track.getNClusterReferences();
132 const auto dEdxTot = track.getdEdx().dEdxTotTPC;
133 const auto hasASideOnly = track.hasASideClustersOnly();
134 const auto hasCSideOnly = track.hasCSideClustersOnly();
136 const auto absEta = std::abs(eta);
139 mMapHist[
"hNClustersBeforeCuts"]->Fill(nCls);
140 mMapHist[
"hEtaBeforeCuts"]->Fill(eta);
141 mMapHist[
"hPtBeforeCuts"]->Fill(pt);
142 mMapHist[
"h2DNClustersEtaBeforeCuts"]->Fill(eta, nCls);
143 mMapHist[
"h2DNClustersPtBeforeCuts"]->Fill(pt, nCls);
144 mMapHist[
"h2DEtaPhiBeforeCuts"]->Fill(phi, eta);
147 if (absEta < mCutAbsEta && nCls > mCutMinnCls && dEdxTot > mCutMindEdxTot) {
150 mMapHist[
"hNClustersAfterCuts"]->Fill(nCls);
151 mMapHist[
"hEta"]->Fill(eta);
157 const int type = (track.getQ2Pt() < 0) + 2 * track.hasCSideClustersOnly();
158 auto dcaHist = mMapHist[fmt::format(
"hDCAr_{}",
types[
type]).data()].get();
159 auto dcaHist_pTmin = mMapHist[fmt::format(
"hDCAr_{}_pTmin",
types[
type]).data()].get();
160 const std::string signType((sign < 0) ?
"Neg" :
"Pos");
161 auto dcaHistPT = mMapHist[
"hDCArVsPt" + signType].get();
162 auto dcaHistEta = mMapHist[
"hDCArVsEta" + signType].get();
163 auto dcaHistNCluster = mMapHist[
"hDCArVsNCls" + signType].get();
164 auto dcaHistEta_pTmin = mMapHist[
"hDCArVsEta" + signType +
"_pTmin"].get();
165 auto dcaHistNCluster_pTmin = mMapHist[
"hDCArVsNCls" + signType +
"_pTmin"].get();
168 Double_t sampleProb = 2;
170 if (mSamplingFractionDCAr > 0) {
171 TRandom3 randomGenerator(0);
172 sampleProb = randomGenerator.Uniform(1);
175 bool isDcaCalculated =
false;
176 float dcaValue = -999;
178 if (sampleProb > (Double_t)(1. - mSamplingFractionDCAr)) {
180 if (propagator->getMatLUT() && propagator->hasMagFieldSet()) {
184 if (propagator->propagateToDCABxByBz(mPositionOfPV, propTrack, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrLUT, &dca)) {
186 dcaHistPT->Fill(pt, dca[0]);
187 dcaHist->Fill(phi, dca[0]);
188 dcaHistEta->Fill(eta, dca[0]);
189 dcaHistNCluster->Fill(nCls, dca[0]);
190 if (pt > mCutMinPtDCAr) {
191 dcaHist_pTmin->Fill(phi, dca[0]);
192 dcaHistEta_pTmin->Fill(eta, dca[0]);
193 dcaHistNCluster_pTmin->Fill(nCls, dca[0]);
196 isDcaCalculated =
true;
199 static bool reported =
false;
201 LOGP(error,
"o2::base::Propagator not properly initialized, MatLUT ({}) and / or Field ({}) missing, will not fill DCA histograms", (
void*)propagator->getMatLUT(), propagator->hasMagFieldSet());
202 dcaHist->SetTitle(fmt::format(
"DCAr {} o2::base::Propagator not properly initialized",
types[
type]).
data());
203 dcaHistPT->SetTitle(fmt::format(
"DCAr #it{{p}}_{{T}} {} o2::base::Propagator not properly initialized", signType).
data());
204 dcaHist_pTmin->SetTitle(fmt::format(
"DCAr {} #it{{p}}_{{T}}^{{min}} o2::base::Propagator not properly initialized",
types[
type]).
data());
205 dcaHistEta->SetTitle(fmt::format(
"DCAr #eta {} o2::base::Propagator not properly initialized", signType).
data());
206 dcaHistNCluster->SetTitle(fmt::format(
"DCAr nClusters {} o2::base::Propagator not properly initialized", signType).
data());
207 dcaHistEta_pTmin->SetTitle(fmt::format(
"DCAr #eta {} #it{{p}}_{{T}}^{{min}} o2::base::Propagator not properly initialized", signType).
data());
208 dcaHistNCluster_pTmin->SetTitle(fmt::format(
"DCAr nClusters {} #it{{p}}_{{T}}^{{min}} o2::base::Propagator not properly initialized", signType).
data());
214 if (mUseCutMaxAbsDCArOnHistos && !isDcaCalculated) {
217 static bool reported =
false;
219 LOGP(error,
"o2::base::Propagator not properly initialized, MatLUT ({}) and / or Field ({}) missing, will not fill apply DCAr selection on histograms", (
void*)propagator->getMatLUT(), propagator->hasMagFieldSet());
220 mMapHist[
"hPhiAside"]->SetTitle(
"hPhiAside o2::base::Propagator not properly initialized");
221 mMapHist[
"hPhiCside"]->SetTitle(
"hPhiCside o2::base::Propagator not properly initialized");
222 mMapHist[
"hPhiBothSides"]->SetTitle(
"hPhiBothSides o2::base::Propagator not properly initialized");
223 mMapHist[
"hPt"]->SetTitle(
"hPt o2::base::Propagator not properly initialized");
224 mMapHist[
"hSign"]->SetTitle(
"hSign o2::base::Propagator not properly initialized");
225 mMapHist[
"hQOverPt"]->SetTitle(
"hQOverPt o2::base::Propagator not properly initialized");
226 mMapHist[
"hEtaNeg"]->SetTitle(
"hEtaNeg o2::base::Propagator not properly initialized");
227 mMapHist[
"hPhiAsideNeg"]->SetTitle(
"hPhiAsideNeg o2::base::Propagator not properly initialized");
228 mMapHist[
"hPhiCsideNeg"]->SetTitle(
"hPhiCsideNeg o2::base::Propagator not properly initialized");
229 mMapHist[
"hEtaPos"]->SetTitle(
"hEtaPos o2::base::Propagator not properly initialized");
230 mMapHist[
"hPtPos"]->SetTitle(
"hPtPos o2::base::Propagator not properly initialized");
231 mMapHist[
"hPhiAsidePos"]->SetTitle(
"hPhiAsidePos o2::base::Propagator not properly initialized");
232 mMapHist[
"hPhiCsidePos"]->SetTitle(
"hPhiCsidePos o2::base::Propagator not properly initialized");
233 mMapHist[
"h2DNClustersEta"]->SetTitle(
"h2DNClustersEta o2::base::Propagator not properly initialized");
234 mMapHist[
"h2DNClustersPhiAside"]->SetTitle(
"h2DNClustersPhiAside o2::base::Propagator not properly initialized");
235 mMapHist[
"h2DQOverPtPhiAside"]->SetTitle(
"h2DQOverPtPhiAside o2::base::Propagator not properly initialized");
236 mMapHist[
"h2DNClustersPhiCside"]->SetTitle(
"h2DNClustersPhiCside o2::base::Propagator not properly initialized");
237 mMapHist[
"h2DQOverPtPhiCside"]->SetTitle(
"h2DQOverPtPhiCside o2::base::Propagator not properly initialized");
238 mMapHist[
"h2DNClustersPt"]->SetTitle(
"h2DNClustersPt o2::base::Propagator not properly initialized");
239 mMapHist[
"h2DEtaPhi"]->SetTitle(
"h2DEtaPhi o2::base::Propagator not properly initialized");
240 mMapHist[
"h2DEtaPhiNeg"]->SetTitle(
"h2DEtaPhiNeg o2::base::Propagator not properly initialized");
241 mMapHist[
"hEtaVsPtNeg"]->SetTitle(
"hEtaVsPtNeg o2::base::Propagator not properly initialized");
242 mMapHist[
"hPhiVsPtNeg"]->SetTitle(
"hPhiVsPtNeg o2::base::Propagator not properly initialized");
243 mMapHist[
"h2DEtaPhiPos"]->SetTitle(
"h2DEtaPhiPos o2::base::Propagator not properly initialized");
244 mMapHist[
"hEtaVsPtPos"]->SetTitle(
"hEtaVsPtPos o2::base::Propagator not properly initialized");
245 mMapHist[
"hPhiVsPtPos"]->SetTitle(
"hPhiVsPtPos o2::base::Propagator not properly initialized");
250 if (mUseCutMaxAbsDCArOnHistos && (std::abs(dcaValue) > mCutMaxAbsDCAr)) {
254 if (hasASideOnly == 1) {
255 mMapHist[
"hPhiAside"]->Fill(phi);
256 }
else if (hasCSideOnly == 1) {
257 mMapHist[
"hPhiCside"]->Fill(phi);
259 if (!mTurnOffHistosForAsync) {
260 mMapHist[
"hPhiBothSides"]->Fill(phi);
264 mMapHist[
"hPt"]->Fill(pt);
265 mMapHist[
"hSign"]->Fill(sign);
266 mMapHist[
"hQOverPt"]->Fill(qOverPt);
269 if (!mTurnOffHistosForAsync) {
270 mMapHist[
"hEtaNeg"]->Fill(eta);
271 mMapHist[
"hPtNeg"]->Fill(pt);
273 if (!mTurnOffHistosForAsync) {
274 if (hasASideOnly == 1) {
275 mMapHist[
"hPhiAsideNeg"]->Fill(phi);
276 }
else if (hasCSideOnly == 1) {
277 mMapHist[
"hPhiCsideNeg"]->Fill(phi);
281 if (!mTurnOffHistosForAsync) {
282 mMapHist[
"hEtaPos"]->Fill(eta);
283 mMapHist[
"hPtPos"]->Fill(pt);
285 if (!mTurnOffHistosForAsync) {
286 if (hasASideOnly == 1) {
287 mMapHist[
"hPhiAsidePos"]->Fill(phi);
288 }
else if (hasCSideOnly == 1) {
289 mMapHist[
"hPhiCsidePos"]->Fill(phi);
295 mMapHist[
"h2DNClustersEta"]->Fill(eta, nCls);
297 if (hasASideOnly == 1) {
298 mMapHist[
"h2DNClustersPhiAside"]->Fill(phi, nCls);
299 if (!mTurnOffHistosForAsync) {
300 mMapHist[
"h2DQOverPtPhiAside"]->Fill(phi, qOverPt);
302 }
else if (hasCSideOnly == 1) {
303 mMapHist[
"h2DNClustersPhiCside"]->Fill(phi, nCls);
304 if (!mTurnOffHistosForAsync) {
305 mMapHist[
"h2DQOverPtPhiCside"]->Fill(phi, qOverPt);
309 mMapHist[
"h2DNClustersPt"]->Fill(pt, nCls);
310 mMapHist[
"h2DEtaPhi"]->Fill(phi, eta);
312 if (!mTurnOffHistosForAsync) {
314 mMapHist[
"h2DEtaPhiNeg"]->Fill(phi, eta);
315 mMapHist[
"hEtaVsPtNeg"]->Fill(pt, eta);
316 mMapHist[
"hPhiVsPtNeg"]->Fill(pt, phi);
318 mMapHist[
"h2DEtaPhiPos"]->Fill(phi, eta);
319 mMapHist[
"hEtaVsPtPos"]->Fill(pt, eta);
320 mMapHist[
"hPhiVsPtPos"]->Fill(pt, phi);