Skip to content

Commit 1448ff6

Browse files
shahor02wiechula
authored andcommitted
Optional TRD/TOF tracks request for PV used for interpolation
1 parent c09a35f commit 1448ff6

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Detectors/TPC/calibration/SpacePoints/include/SpacePoints/SpacePointsCalibConfParam.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct SpacePointsCalibConfParam : public o2::conf::ConfigurableParamHelper<Spac
3838
float maxITSChi2 = 20.f; ///< cut on ITS reduced chi2
3939
float maxTRDChi2 = 10.f; ///< cut on TRD reduced chi2
4040
float minPtNoOuterPoint = 0.8f; ///< minimum pt for ITS-TPC tracks to be considered for extrapolation
41+
int minTOFTRDPVContributors = 0; ///< min contributors from TRD or TOF (fast detectors) to consider tracks of this PV
4142
bool ignoreNonPVContrib = true; ///< flag if tracks which did not contribute to the PV should be ignored or not
4243
bool enableTrackDownsampling = false; ///< flag if track sampling shall be enabled or not
4344
float tsalisThreshold = 1.f; ///< in case the sampling functions returns a value smaller than this the track is discarded (1. means no downsampling)

Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,30 @@ void TrackInterpolation::prepareInputTrackSample(const o2::globaltracking::RecoC
149149
auto vtxRefs = mRecoCont->getPrimaryVertexMatchedTrackRefs(); // references from vertex to these track IDs
150150
int nv = vtxRefs.size() - 1;
151151
GTrackID::mask_t allowedSources = GTrackID::getSourcesMask("ITS-TPC,ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
152+
constexpr std::array<int, 3> SrcFast = {int(GTrackID::ITSTPCTRD), int(GTrackID::ITSTPCTOF), int(GTrackID::ITSTPCTRDTOF)};
152153

153154
for (int iv = 0; iv < nv; iv++) {
154155
LOGP(debug, "processing PV {} of {}", iv, nv);
155156

156157
const auto& vtref = vtxRefs[iv];
157158
auto pv = pvvec[iv];
159+
if (mParams->minTOFTRDPVContributors > 0) { // we want only PVs constrained by fast detectors
160+
int nfound = 0;
161+
bool usePV = false;
162+
for (uint32_t is = 0; is < SrcFast.size() && !usePV; is++) {
163+
int src = SrcFast[is], idMin = vtref.getFirstEntryOfSource(src), idMax = idMin + vtref.getEntriesOfSource(src);
164+
for (int i = idMin; i < idMax; i++) {
165+
if (trackIndex[i].isPVContributor() && (++nfound == mParams->minTOFTRDPVContributors)) {
166+
usePV = true;
167+
break;
168+
}
169+
}
170+
}
171+
if (!usePV) {
172+
continue;
173+
}
174+
}
175+
158176
for (int is = GTrackID::NSources; is >= 0; is--) {
159177
if (!allowedSources[is]) {
160178
continue;

0 commit comments

Comments
 (0)