Skip to content

Commit b955856

Browse files
committed
Revert "TPC: Add DCAr histograms to TPC QC Tracks component (#11909)"
This reverts commit c04eccc.
1 parent 5ab054a commit b955856

5 files changed

Lines changed: 13 additions & 69 deletions

File tree

Detectors/Base/include/DetectorsBase/Propagator.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace parameters
3434
{
3535
class GRPObject;
3636
class GRPMagField;
37-
} // namespace parameters
37+
}
3838

3939
namespace dataformats
4040
{
@@ -45,7 +45,7 @@ namespace field
4545
{
4646
class MagFieldFast;
4747
class MagneticField;
48-
} // namespace field
48+
}
4949

5050
namespace gpu
5151
{
@@ -134,7 +134,6 @@ class PropagatorImpl
134134
GPUd() void setGPUField(const o2::gpu::GPUTPCGMPolynomialField* field) { mGPUField = field; }
135135
GPUd() const o2::gpu::GPUTPCGMPolynomialField* getGPUField() const { return mGPUField; }
136136
GPUd() void setBz(value_type bz) { mBz = bz; }
137-
GPUd() bool hasMagFieldSet() const { return mField != nullptr; }
138137

139138
GPUd() void estimateLTFast(o2::track::TrackLTIntegral& lt, const o2::track::TrackParametrization<value_type>& trc) const;
140139

Detectors/TPC/qc/include/TPCQC/Helpers.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "TH2F.h"
2323

2424
#include <vector>
25-
#include <string>
2625
#include "TPCBase/CalDet.h"
2726

2827
namespace o2
@@ -59,10 +58,6 @@ void setStyleHistogram(TH1& histo);
5958
void setStyleHistogramsInMap(std::unordered_map<std::string_view, std::vector<std::unique_ptr<TH1>>>& mapOfvectors);
6059
// set nice style of histograms in a map
6160
void setStyleHistogramsInMap(std::unordered_map<std::string_view, std::unique_ptr<TH1>>& mapOfHisto);
62-
// set nice style of histograms in a map of vectors
63-
void setStyleHistogramsInMap(std::unordered_map<std::string, std::vector<std::unique_ptr<TH1>>>& mapOfvectors);
64-
// set nice style of histograms in a map
65-
void setStyleHistogramsInMap(std::unordered_map<std::string, std::unique_ptr<TH1>>& mapOfHisto);
6661
/// Check if at least one pad in refPedestal and pedestal differs by 3*refNoise to see if new ZS calibration data should be uploaded to the FECs.
6762
/// @param refPedestal
6863
/// @param refNoise
@@ -75,4 +70,4 @@ bool newZSCalib(const o2::tpc::CalDet<float>& refPedestal, const o2::tpc::CalDet
7570
} // namespace tpc
7671
} // namespace o2
7772

78-
#endif
73+
#endif

Detectors/TPC/qc/include/TPCQC/Tracks.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include <vector>
2121
#include <string_view>
22-
#include <string>
2322
#include <unordered_map>
2423
#include <memory>
2524

@@ -28,6 +27,9 @@
2827
#include "TH1F.h"
2928
#include "TH2F.h"
3029

30+
// o2 includes
31+
#include "DataFormatsTPC/Defs.h"
32+
3133
namespace o2
3234
{
3335
namespace tpc
@@ -75,7 +77,6 @@ class Tracks
7577
mCutMinnCls = nClusterCut;
7678
mCutMindEdxTot = dEdxTot;
7779
}
78-
7980
// Just for backward compatibility with crrent QC, temporary, will be removed in the next PR
8081
/// get 1D histograms
8182
std::vector<TH1F>& getHistograms1D() { return mHist1D; }
@@ -92,14 +93,14 @@ class Tracks
9293
const std::vector<TH1F>& getHistogramRatios1D() const { return mHistRatio1D; }
9394

9495
/// get ratios of 1D histograms
95-
std::unordered_map<std::string, std::unique_ptr<TH1>>& getMapHist() { return mMapHist; }
96-
const std::unordered_map<std::string, std::unique_ptr<TH1>>& getMapHist() const { return mMapHist; }
96+
std::unordered_map<std::string_view, std::unique_ptr<TH1>>& getMapHist() { return mMapHist; }
97+
const std::unordered_map<std::string_view, std::unique_ptr<TH1>>& getMapHist() const { return mMapHist; }
9798

9899
private:
99100
float mCutAbsEta = 1.f; // Eta cut
100101
int mCutMinnCls = 60; // minimum N clusters
101102
float mCutMindEdxTot = 20.f; // dEdxTot min value
102-
std::unordered_map<std::string, std::unique_ptr<TH1>> mMapHist;
103+
std::unordered_map<std::string_view, std::unique_ptr<TH1>> mMapHist;
103104
std::vector<TH1F> mHist1D{}; ///< Initialize vector of 1D histograms
104105
std::vector<TH2F> mHist2D{}; ///< Initialize vector of 2D histograms
105106
std::vector<TH1F> mHistRatio1D{}; ///< Initialize vector of ratios of 1D histograms

Detectors/TPC/qc/src/Helpers.cxx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,6 @@ void helpers::setStyleHistogramsInMap(std::unordered_map<std::string_view, std::
9999
helpers::setStyleHistogram(*(keyValue.second));
100100
}
101101
}
102-
103-
//______________________________________________________________________________
104-
void helpers::setStyleHistogramsInMap(std::unordered_map<std::string, std::vector<std::unique_ptr<TH1>>>& mapOfvectors)
105-
{
106-
for (const auto& keyValue : mapOfvectors) {
107-
for (auto& hist : keyValue.second) {
108-
helpers::setStyleHistogram(*hist);
109-
}
110-
}
111-
}
112-
113-
//______________________________________________________________________________
114-
void helpers::setStyleHistogramsInMap(std::unordered_map<std::string, std::unique_ptr<TH1>>& mapOfHisto)
115-
{
116-
for (const auto& keyValue : mapOfHisto) {
117-
helpers::setStyleHistogram(*(keyValue.second));
118-
}
119-
}
120-
121102
//______________________________________________________________________________
122103
bool helpers::newZSCalib(const o2::tpc::CalDet<float>& refPedestal, const o2::tpc::CalDet<float>& refNoise, const o2::tpc::CalDet<float>& pedestal)
123104
{
@@ -138,4 +119,4 @@ bool helpers::newZSCalib(const o2::tpc::CalDet<float>& refPedestal, const o2::tp
138119
}
139120

140121
return false;
141-
}
122+
}

Detectors/TPC/qc/src/Tracks.cxx

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,18 @@
1616

1717
// root includes
1818
#include "TFile.h"
19+
#include "TMathBase.h"
1920

2021
// o2 includes
2122
#include "DataFormatsTPC/TrackTPC.h"
2223
#include "DataFormatsTPC/dEdxInfo.h"
23-
#include "GPUCommonArray.h"
24-
#include "DetectorsBase/Propagator.h"
2524
#include "TPCQC/Tracks.h"
2625
#include "TPCQC/Helpers.h"
2726

2827
ClassImp(o2::tpc::qc::Tracks);
2928

3029
using namespace o2::tpc::qc;
31-
// DCA histograms
32-
const std::vector<std::string_view> types{"A_Pos", "A_Neg", "C_Pos", "C_Neg"};
30+
3331
//______________________________________________________________________________
3432
void Tracks::initializeHistograms()
3533
{
@@ -80,11 +78,6 @@ void Tracks::initializeHistograms()
8078
mMapHist["hPhiAsideRatio"] = std::make_unique<TH1F>("hPhiAsideRatio", "Azimuthal angle, A side, ratio neg./pos. ;phi", 360, 0., 2 * M_PI);
8179
mMapHist["hPhiCsideRatio"] = std::make_unique<TH1F>("hPhiCsideRatio", "Azimuthal angle, C side, ratio neg./pos. ;phi", 360, 0., 2 * M_PI);
8280
mMapHist["hPtRatio"] = std::make_unique<TH1F>("hPtRatio", "Transverse momentum, ratio neg./pos. ;p_T", logPtBinning.size() - 1, logPtBinning.data());
83-
84-
// DCA Histograms
85-
for (const auto type : types) {
86-
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-
}
8881
}
8982
//______________________________________________________________________________
9083
void Tracks::resetHistograms()
@@ -107,7 +100,7 @@ bool Tracks::processTrack(const o2::tpc::TrackTPC& track)
107100
const auto hasASideOnly = track.hasASideClustersOnly();
108101
const auto hasCSideOnly = track.hasCSideClustersOnly();
109102

110-
const auto absEta = std::abs(eta);
103+
double absEta = TMath::Abs(eta);
111104

112105
// ===| histogram filling before cuts |===
113106
mMapHist["hNClustersBeforeCuts"]->Fill(nCls);
@@ -124,31 +117,6 @@ bool Tracks::processTrack(const o2::tpc::TrackTPC& track)
124117
mMapHist["hNClustersAfterCuts"]->Fill(nCls);
125118
mMapHist["hEta"]->Fill(eta);
126119

127-
//---| propagate to 0,0,0 |---
128-
//
129-
// propagator instance must be configured before (LUT, MagField)
130-
auto propagator = o2::base::Propagator::Instance(true);
131-
const int type = (track.getQ2Pt() < 0) + 2 * track.hasCSideClustersOnly();
132-
auto dcaHist = mMapHist[fmt::format("hDCAr_{}", types[type]).data()].get();
133-
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;
148-
}
149-
dcaHist->SetTitle(fmt::format("DCAr {} o2::base::Propagator not properly initialized", types[type]).data());
150-
}
151-
152120
if (hasASideOnly == 1) {
153121
mMapHist["hPhiAside"]->Fill(phi);
154122
} else if (hasCSideOnly == 1) {

0 commit comments

Comments
 (0)