|
21 | 21 | // o2 includes |
22 | 22 | #include "DataFormatsTPC/TrackTPC.h" |
23 | 23 | #include "DataFormatsTPC/dEdxInfo.h" |
| 24 | +#include "GPUCommonArray.h" |
| 25 | +#include "DetectorsBase/Propagator.h" |
| 26 | +#include "DataFormatsParameters/GRPMagField.h" |
| 27 | +#include "TGeoManager.h" |
24 | 28 | #include "TPCQC/Tracks.h" |
25 | 29 | #include "TPCQC/Helpers.h" |
26 | 30 |
|
27 | 31 | ClassImp(o2::tpc::qc::Tracks); |
28 | 32 |
|
29 | 33 | using namespace o2::tpc::qc; |
30 | | - |
| 34 | +// DCA histograms |
| 35 | +const std::vector<std::string_view> types{"A_Pos", "A_Neg", "C_Pos", "C_Neg"}; |
31 | 36 | //______________________________________________________________________________ |
32 | 37 | void Tracks::initializeHistograms() |
33 | 38 | { |
@@ -78,6 +83,12 @@ void Tracks::initializeHistograms() |
78 | 83 | mMapHist["hPhiAsideRatio"] = std::make_unique<TH1F>("hPhiAsideRatio", "Azimuthal angle, A side, ratio neg./pos. ;phi", 360, 0., 2 * M_PI); |
79 | 84 | mMapHist["hPhiCsideRatio"] = std::make_unique<TH1F>("hPhiCsideRatio", "Azimuthal angle, C side, ratio neg./pos. ;phi", 360, 0., 2 * M_PI); |
80 | 85 | mMapHist["hPtRatio"] = std::make_unique<TH1F>("hPtRatio", "Transverse momentum, ratio neg./pos. ;p_T", logPtBinning.size() - 1, logPtBinning.data()); |
| 86 | + |
| 87 | + // DCA Histograms |
| 88 | + for (const auto type : types) { |
| 89 | + 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(), 100, -3., 3.); |
| 90 | + mMapHist[fmt::format("hDCAz_{}", type).data()] = std::make_unique<TH2F>(fmt::format("hDCAz_{}", type).data(), fmt::format("DCAz {};phi;DCAr (cm)", type).data(), 360, 0, o2::math_utils::twoPid(), 100, -3., 3.); |
| 91 | + } |
81 | 92 | } |
82 | 93 | //______________________________________________________________________________ |
83 | 94 | void Tracks::resetHistograms() |
@@ -117,6 +128,45 @@ bool Tracks::processTrack(const o2::tpc::TrackTPC& track) |
117 | 128 | mMapHist["hNClustersAfterCuts"]->Fill(nCls); |
118 | 129 | mMapHist["hEta"]->Fill(eta); |
119 | 130 |
|
| 131 | + auto& ccdbmgr = o2::ccdb::BasicCCDBManager::instance(); |
| 132 | + ccdbmgr.setURL("https://alice-ccdb.cern.ch"); |
| 133 | + auto runDuration = ccdbmgr.getRunDuration(runNumber); |
| 134 | + auto tRun = runDuration.first + (runDuration.second - runDuration.first) / 2; // time stamp for the middle of the run duration |
| 135 | + ccdbmgr.setTimestamp(tRun); |
| 136 | + |
| 137 | + // CTP orbit reset time |
| 138 | + auto orbitResetTimeNS = ccdbmgr.get<std::vector<int64_t>>("CTP/Calib/OrbitReset"); |
| 139 | + int64_t orbitResetTimeMS = (*orbitResetTimeNS)[0] * 1e-3; |
| 140 | + LOGP(info, "Orbit reset time in MS is {}", orbitResetTimeMS); |
| 141 | + |
| 142 | + auto geoAligned = ccdbmgr.get<TGeoManager>("GLO/Config/GeometryAligned"); |
| 143 | + auto magField = ccdbmgr.get<o2::parameters::GRPMagField>("GLO/Config/GRPMagField"); |
| 144 | + const o2::base::MatLayerCylSet* matLut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdbmgr.get<o2::base::MatLayerCylSet>("GLO/Param/MatLUT")); |
| 145 | + auto propagator = o2::base::Propagator::Instance(); |
| 146 | + propagator->setMatLUT(matLut); |
| 147 | + //---| propagate to 0,0,0 |--- |
| 148 | + o2::gpu::gpustd::array<float, 2> dca; |
| 149 | + const o2::math_utils::Point3D<float> refPoint{0, 0, 0}; |
| 150 | + //auto propTrack = TrackTPC(track); |
| 151 | + o2::track::TrackPar propTrack(track); // Should be cheaper than the one above |
| 152 | + bool useThisTrack = true; |
| 153 | + if (!propagator->propagateToDCABxByBz(refPoint, propTrack, 0.5, o2::base::Propagator::MatCorrType::USEMatCorrLUT, &dca)) { |
| 154 | + useThisTrack = false; |
| 155 | + } |
| 156 | + ///fine grained propagation most probably not needed |
| 157 | + if (!propagator->propagateToDCABxByBz(refPoint, propTrack, 0.005, o2::base::Propagator::MatCorrType::USEMatCorrLUT, &dca)) { |
| 158 | + useThisTrack = false; |
| 159 | + } |
| 160 | + |
| 161 | + if (useThisTrack) |
| 162 | + { |
| 163 | + // ---| fill histos |--- |
| 164 | + const int type = (track.getQ2Pt() < 0) + 2 * track.hasCSideClustersOnly(); |
| 165 | + const auto phi = o2::math_utils::to02PiGen(track.getPhi()); |
| 166 | + mMapHist[fmt::format("hDCAr_{}", types[type]).data()]->Fill(phi, dca[0]); |
| 167 | + mMapHist[fmt::format("hDCAz_{}", types[type]).data()]->Fill(phi, dca[1]); |
| 168 | + } |
| 169 | + |
120 | 170 | if (hasASideOnly == 1) { |
121 | 171 | mMapHist["hPhiAside"]->Fill(phi); |
122 | 172 | } else if (hasCSideOnly == 1) { |
|
0 commit comments