|
16 | 16 |
|
17 | 17 | // root includes |
18 | 18 | #include "TFile.h" |
| 19 | +#include "TRandom3.h" |
19 | 20 |
|
20 | 21 | // o2 includes |
21 | 22 | #include "DataFormatsTPC/TrackTPC.h" |
@@ -85,6 +86,13 @@ void Tracks::initializeHistograms() |
85 | 86 | for (const auto type : types) { |
86 | 87 | 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(), 250, -10., 10.); |
87 | 88 | } |
| 89 | + // DCA vs variables Histograms |
| 90 | + mMapHist["hDCArVsPtPos"] = std::make_unique<TH2F>("hDCArVsPtPos", "DCAr Pos;#it{p}_{T}T (GeV/#it{c});DCAr (cm)", logPtBinning.size() - 1, logPtBinning.data(), 250, -10., 10.); |
| 91 | + mMapHist["hDCArVsEtaPos"] = std::make_unique<TH2F>("hDCArVsEtaPos", "DCAr Pos;#eta;DCAr (cm)", 400, -2., 2., 250, -10., 10.); |
| 92 | + mMapHist["hDCArVsNClsPos"] = std::make_unique<TH2F>("hDCArVsNClsPos", "DCAr Pos;NClusters;DCAr (cm)", 400, -0.5, 399.5, 250, -10., 10.); |
| 93 | + mMapHist["hDCArVsPtNeg"] = std::make_unique<TH2F>("hDCArVsPtNeg", "DCAr Neg;#it{p}_{T}T (GeV/#it{c});DCAr (cm)", logPtBinning.size() - 1, logPtBinning.data(), 250, -10., 10.); |
| 94 | + mMapHist["hDCArVsEtaNeg"] = std::make_unique<TH2F>("hDCArVsEtaNeg", "DCAr Neg;#eta;DCAr (cm)", 400, -2., 2., 250, -10., 10.); |
| 95 | + mMapHist["hDCArVsNClsNeg"] = std::make_unique<TH2F>("hDCArVsNClsNeg", "DCAr Neg;NClusters;DCAr (cm)", 400, -0.5, 399.5, 250, -10., 10.); |
88 | 96 | } |
89 | 97 | //______________________________________________________________________________ |
90 | 98 | void Tracks::resetHistograms() |
@@ -130,23 +138,46 @@ bool Tracks::processTrack(const o2::tpc::TrackTPC& track) |
130 | 138 | auto propagator = o2::base::Propagator::Instance(true); |
131 | 139 | const int type = (track.getQ2Pt() < 0) + 2 * track.hasCSideClustersOnly(); |
132 | 140 | auto dcaHist = mMapHist[fmt::format("hDCAr_{}", types[type]).data()].get(); |
| 141 | + const std::string signType((sign < 0) ? "Neg" : "Pos"); |
| 142 | + auto dcaHistPT = mMapHist["hDCArVsPt" + signType].get(); |
| 143 | + auto dcaHistEta = mMapHist["hDCArVsEtaPos" + signType].get(); |
| 144 | + auto dcaHistNCluster = mMapHist["hDCArVsNClsPos" + signType].get(); |
133 | 145 |
|
134 | | - if (propagator->getMatLUT() && propagator->hasMagFieldSet()) { |
135 | | - // ---| fill DCA histos |--- |
136 | | - o2::gpu::gpustd::array<float, 2> dca; |
137 | | - const o2::math_utils::Point3D<float> refPoint{0, 0, 0}; |
138 | | - o2::track::TrackPar propTrack(track); |
139 | | - if (propagator->propagateToDCABxByBz(refPoint, propTrack, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrLUT, &dca)) { |
140 | | - const auto phi = o2::math_utils::to02PiGen(track.getPhi()); |
141 | | - dcaHist->Fill(phi, dca[0]); |
142 | | - } |
143 | | - } else { |
144 | | - static bool reported = false; |
145 | | - if (!reported) { |
146 | | - LOGP(error, "o2::base::Propagator not properly initialized, MatLUT ({}) and / or Field ({}) missing, will not fill DCA histograms", (void*)propagator->getMatLUT(), (void*)propagator->hasMagFieldSet()); |
147 | | - reported = true; |
| 146 | + // set-up sampling for the DCA calculation |
| 147 | + Double_t sampleProb = 2; |
| 148 | + |
| 149 | + if (mSamplingFractionDCAr > 0) { // for now no SEED is given. |
| 150 | + TRandom3 randomGenerator(0); |
| 151 | + sampleProb = randomGenerator.Uniform(1); |
| 152 | + } |
| 153 | + |
| 154 | + if (sampleProb > (Double_t)(1. - mSamplingFractionDCAr)) { |
| 155 | + |
| 156 | + if (propagator->getMatLUT() && propagator->hasMagFieldSet()) { |
| 157 | + // ---| fill DCA histos |--- |
| 158 | + o2::gpu::gpustd::array<float, 2> dca; |
| 159 | + const o2::math_utils::Point3D<float> refPoint{0, 0, 0}; |
| 160 | + o2::track::TrackPar propTrack(track); |
| 161 | + if (propagator->propagateToDCABxByBz(refPoint, propTrack, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrLUT, &dca)) { |
| 162 | + const auto phi = o2::math_utils::to02PiGen(track.getPhi()); |
| 163 | + dcaHistPT->Fill(pt, dca[0]); |
| 164 | + if (pt > mCutMinPtDCAr) { |
| 165 | + dcaHist->Fill(phi, dca[0]); |
| 166 | + dcaHistEta->Fill(eta, dca[0]); |
| 167 | + dcaHistNCluster->Fill(nCls, dca[0]); |
| 168 | + } |
| 169 | + } else { |
| 170 | + static bool reported = false; |
| 171 | + if (!reported) { |
| 172 | + LOGP(error, "o2::base::Propagator not properly initialized, MatLUT ({}) and / or Field ({}) missing, will not fill DCA histograms", (void*)propagator->getMatLUT(), (void*)propagator->hasMagFieldSet()); |
| 173 | + reported = true; |
| 174 | + } |
| 175 | + dcaHist->SetTitle(fmt::format("DCAr {} o2::base::Propagator not properly initialized", types[type]).data()); |
| 176 | + dcaHistPT->SetTitle(fmt::format("DCAr p_{T} {} o2::base::Propagator not properly initialized", signType).data()); |
| 177 | + dcaHistEta->SetTitle(fmt::format("DCAr eta {} o2::base::Propagator not properly initialized", signType).data()); |
| 178 | + dcaHistNCluster->SetTitle(fmt::format("DCAr nClusters {} o2::base::Propagator not properly initialized", signType).data()); |
| 179 | + } |
148 | 180 | } |
149 | | - dcaHist->SetTitle(fmt::format("DCAr {} o2::base::Propagator not properly initialized", types[type]).data()); |
150 | 181 | } |
151 | 182 |
|
152 | 183 | if (hasASideOnly == 1) { |
|
0 commit comments