Skip to content

Commit 4490d68

Browse files
author
Maximilian Korwieser
committed
Add functionality to set the coordinates of PV.
1 parent c1509f8 commit 4490d68

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ class Tracks
8181
mUseCutMaxAbsDCArOnHistos = useCutMaxAbsDCArOnHistos;
8282
}
8383

84+
// Set PV position
85+
void setPVposition(const o2::math_utils::Point3D<float> meanVtxPoint3D)
86+
{
87+
mXpositionOfPV = meanVtxPoint3D.X();
88+
mYpositionOfPV = meanVtxPoint3D.Y();
89+
mZpositionOfPV = meanVtxPoint3D.Z();
90+
}
91+
8492
/// get ratios of 1D histograms
8593
std::unordered_map<std::string, std::unique_ptr<TH1>>& getMapHist() { return mMapHist; }
8694
const std::unordered_map<std::string, std::unique_ptr<TH1>>& getMapHist() const { return mMapHist; }
@@ -94,6 +102,9 @@ class Tracks
94102
bool mTurnOffHistosForAsync = false; // Decide whether to turn off some histograms for async to reduce memory
95103
float mCutMaxAbsDCAr = 1.f; // maximum DCAr
96104
bool mUseCutMaxAbsDCArOnHistos = false; // Decide whether to use the cut on maximum DCAr for the histograms
105+
float mXpositionOfPV = 0.f; // x-position of the PV
106+
float mYpositionOfPV = 0.f; // y-position of the PV
107+
float mZpositionOfPV = 0.f; // z-position of the PV
97108

98109
std::unordered_map<std::string, std::unique_ptr<TH1>> mMapHist;
99110
std::vector<TH1F> mHist1D{}; ///< Initialize vector of 1D histograms

Detectors/TPC/qc/src/Tracks.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ bool Tracks::processTrack(const o2::tpc::TrackTPC& track)
180180
if (propagator->getMatLUT() && propagator->hasMagFieldSet()) {
181181
// ---| fill DCA histos |---
182182
o2::gpu::gpustd::array<float, 2> dca;
183-
const o2::math_utils::Point3D<float> refPoint{0, 0, 0};
183+
const o2::math_utils::Point3D<float> refPoint{mXpositionOfPV, mYpositionOfPV, mZpositionOfPV}; // inlcude option to fetch this information form the CCDB instead of assuming collision at nominal interaction point
184+
// LOGP(error, "DeBugOutput: mXpositionOfPV({%.2f}), mYpositionOfPV({%.2f}), mZpositionOfPV({%i})", mXpositionOfPV, mYpositionOfPV, mZpositionOfPV);
184185
o2::track::TrackPar propTrack(track);
185186
if (propagator->propagateToDCABxByBz(refPoint, propTrack, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrLUT, &dca)) {
186187
const auto phi = o2::math_utils::to02PiGen(track.getPhi());

0 commit comments

Comments
 (0)