63 template <
typename TR>
64 int process(
const TR& tracks,
const gsl::span<o2d::GlobalTrackID> gids,
const gsl::span<InteractionCandidate> intCand,
65 std::vector<PVertex>& vertices, std::vector<o2d::VtxTrackIndex>& vertexTrackIDs, std::vector<V2TRef>& v2tRefs,
66 const gsl::span<const o2::MCCompLabel> lblTracks, std::vector<o2::MCEventLabel>& lblVtx);
67 template <
typename TR>
68 int process(
const TR& tracks,
const gsl::span<o2d::GlobalTrackID> gids,
const gsl::span<o2::InteractionRecord> intRec,
69 std::vector<PVertex>& vertices, std::vector<o2d::VtxTrackIndex>& vertexTrackIDs, std::vector<V2TRef>& v2tRefs,
70 const gsl::span<const o2::MCCompLabel> lblTracks, std::vector<o2::MCEventLabel>& lblVtx);
72 int processFromExternalPool(
const std::vector<TrackVF>& pool, std::vector<PVertex>& vertices, std::vector<o2d::VtxTrackIndex>& vertexTrackIDs, std::vector<V2TRef>& v2tRefs);
88 void setBz(
float bz) { mBz = bz; }
104 mMeanVertexSeed = *
v;
110 mITSROFrameLengthMUS =
v;
114 template <
typename TR>
143 static constexpr int DBS_UNDEF = -2, DBS_NOISE = -1, DBS_INCHECK = -10;
146 int runVertexing(gsl::span<o2d::GlobalTrackID> gids,
const gsl::span<InteractionCandidate> intCand,
147 std::vector<PVertex>& vertices, std::vector<o2d::VtxTrackIndex>& vertexTrackIDs, std::vector<V2TRef>& v2tRefs,
148 gsl::span<const o2::MCCompLabel> lblTracks, std::vector<o2::MCEventLabel>& lblVtx);
149 void createMCLabels(gsl::span<const o2::MCCompLabel> lblTracks,
const std::vector<uint32_t>& trackIDs,
const std::vector<V2TRef>& v2tRefs, std::vector<o2::MCEventLabel>& lblVtx);
150 void reduceDebris(std::vector<PVertex>& vertices, std::vector<int>& timeSort,
const std::vector<o2::MCEventLabel>& lblVtx);
152 void finalizeVertex(
const VertexingInput& input,
const PVertex& vtx, std::vector<PVertex>& vertices, std::vector<V2TRef>& v2tRefs, std::vector<uint32_t>& trackIDs,
SeedHistoTZ* histo =
nullptr);
157 float findZSeedHistoPeak()
const;
158 void applyConstraint(
VertexSeed& vtxSeed)
const;
162 void applyMADSelection(std::vector<PVertex>& vertices, std::vector<int>& timeSort,
const std::vector<V2TRef>& v2tRefs,
const std::vector<uint32_t>& trackIDs);
163 void applITSOnlyFractionCut(std::vector<PVertex>& vertices, std::vector<int>& timeSort,
const std::vector<V2TRef>& v2tRefs,
const std::vector<uint32_t>& trackIDs);
164 void applInteractionValidation(std::vector<PVertex>& vertices, std::vector<int>& timeSort,
const gsl::span<InteractionCandidate> intCand,
int minContrib);
166 template <
typename TR>
167 void createTracksPool(
const TR& tracks, gsl::span<const o2d::GlobalTrackID> gids);
169 int findVertices(
const VertexingInput& input, std::vector<PVertex>& vertices, std::vector<uint32_t>& trackIDs, std::vector<V2TRef>& v2tRefs);
170 void reAttach(std::vector<PVertex>& vertices, std::vector<int>& timeSort, std::vector<uint32_t>& trackIDs, std::vector<V2TRef>& v2tRefs);
172 std::pair<int, int> getBestIR(
const PVertex& vtx,
const gsl::span<InteractionCandidate> intCand,
int& currEntry)
const;
174 int dbscan_RangeQuery(
int idxs, std::vector<int>& cand, std::vector<int>& status);
175 void dbscan_clusterize();
176 void doDBScanDump(
const VertexingInput& input, gsl::span<const o2::MCCompLabel> lblTracks);
177 void doVtxDump(std::vector<PVertex>& vertices, std::vector<uint32_t> trackIDsLoc, std::vector<V2TRef>& v2tRefsLoc, gsl::span<const o2::MCCompLabel> lblTracks);
178 void doDBGPoolDump(gsl::span<const o2::MCCompLabel> lblTracks);
182 std::array<int16_t, o2::constants::lhc::LHCMaxBunches> mClosestBunchAbove{-1};
183 std::array<int16_t, o2::constants::lhc::LHCMaxBunches> mClosestBunchBelow{-1};
186 std::array<float, 3> mXYConstraintInvErr = {1.0f, 0.f, 1.0f};
188 std::vector<TrackVF> mTracksPool;
189 std::vector<TimeZCluster> mTimeZClusters;
190 float mITSROFrameLengthMUS = 0;
193 float mDBScanDeltaT = 0.;
194 float mDBSMaxZ2InvCorePoint = 0;
195 bool mValidateWithIR =
false;
199 std::vector<int> mRefitTrackIDs{};
204 std::vector<int> mSrcVec{};
205 const PVertexerParams* mPVParams =
nullptr;
207 static constexpr float kDefTukey = 5.0f;
208 static constexpr float kHugeF = 1.e12;
209 static constexpr float kAlmost0F = 1e-12;
210 static constexpr double kAlmost0D = 1e-16;
212 int mNKilledBCValid = 0;
213 int mNKilledIntCand = 0;
214 int mNKilledDebris = 0;
215 int mNKilledQuality = 0;
216 int mNKilledITSOnly = 0;
217 size_t mNTZClustersIni = 0;
218 size_t mTotTrials = 0;
219 size_t mMaxTrialPerCluster = 0;
220 float mMaxTDiffDebris = 0;
221 float mMaxTDiffDebrisExtra = 0;
222 float mMaxTDiffDebrisFiducial = 0;
223 float mMaxZDiffDebrisFiducial = 0;
224 float mMaxMultRatDebrisFiducial = 0;
225 long mLongestClusterTimeMS = 0;
226 int mLongestClusterMult = 0;
227 bool mPoolDumpProduced =
false;
228 bool mITSOnly =
false;
229 TStopwatch mTimeDBScan;
230 TStopwatch mTimeVertexing;
231 TStopwatch mTimeDebris;
232 TStopwatch mTimeMADSel;
233 TStopwatch mTimeReAttach;
234 std::string mPoolDumpDirectory{};
235#ifdef _PV_DEBUG_TREE_
236 std::unique_ptr<TFile> mDebugDumpFile;
237 std::unique_ptr<TTree> mDebugDBScanTree;
238 std::unique_ptr<TTree> mDebugPoolTree;
239 std::unique_ptr<TTree> mDebugVtxTree;
240 std::unique_ptr<TTree> mDebugVtxCompTree;
242 std::vector<TrackVFDump> mDebugDumpDBSTrc;
243 std::vector<GTrackID> mDebugDumpDBSGID;
244 std::vector<o2::MCCompLabel> mDebugDumpDBSTrcMC;
247 std::vector<TrackVFDump> mDebugDumpVtxTrc;
248 std::vector<GTrackID> mDebugDumpVtxGID;
249 std::vector<o2::MCCompLabel> mDebugDumpVtxTrcMC;
251 std::vector<PVtxCompDump> mDebugDumpPVComp;
252 std::vector<o2::MCEventLabel> mDebugDumpPVCompLbl0;
253 std::vector<o2::MCEventLabel> mDebugDumpPVCompLbl1;