|
33 | 33 | #include "StrangenessTracking/StrangenessTracker.h" |
34 | 34 | #include "DataFormatsTPC/TrackTPC.h" |
35 | 35 | #include <numeric> |
| 36 | +#include <unordered_map> |
36 | 37 | #include <algorithm> |
37 | 38 | #include "GPUO2InterfaceRefit.h" |
38 | 39 | #include "DataFormatsTPC/PIDResponse.h" |
39 | 40 |
|
| 41 | +// uncomment this to enable filling rejection records |
| 42 | +// #define _FILL_SV_POOL_REJECTIONS_ |
| 43 | + |
40 | 44 | namespace o2 |
41 | 45 | { |
42 | 46 | namespace tpc |
@@ -77,6 +81,34 @@ class SVertexer |
77 | 81 | AntiHyperhydrog4, |
78 | 82 | NHypV0 }; |
79 | 83 |
|
| 84 | + // reasons for a track considered in buildT2V not to enter the POS/NEG pools (bit = 0x1 << reason) |
| 85 | + enum PoolRejection : int { |
| 86 | + RejTPCExcluded, // TPC-only tracks excluded by mExcludeTPCtracks |
| 87 | + RejTPCMaxX, // TPC track X > mTPCTrackMaxX |
| 88 | + RejTPCTimeCorr, // correctTPCTrack failed for the unconstrained TPC track clone |
| 89 | + RejTPCPhotonNCls, // photon tune: too few TPC clusters |
| 90 | + RejTPCPhotonDPV, // photon tune: Z too far from the vertex |
| 91 | + RejTPCPhotonRD2, // photon tune: circle too far from the beam line |
| 92 | + RejPVContributor, // PV contributor while maxPVContributors < 1 |
| 93 | + RejMinDCAToPV, // |DCA| to mean vertex < minDCAToPV (and not a heavy ionizing particle) |
| 94 | + RejShortITSOnly, // short ITS-only track (see mITSSAminNclu, mRejectITSonlyOBtrack) |
| 95 | + NPoolRejections |
| 96 | + }; |
| 97 | + |
| 98 | + // key of the mPoolRejections map: (vertexID << 32) | GIndex.getRaw() |
| 99 | + static uint64_t getPoolRejectionKey(GIndex gid, int iv) |
| 100 | + { |
| 101 | + return (uint64_t(iv) << 32) | uint64_t(gid.getRaw()); |
| 102 | + } |
| 103 | + |
| 104 | + // inverse of getPoolRejectionKey: returns the track GIndex and the vertex ID |
| 105 | + static std::pair<GIndex, int> rejectionKey2GidIv(uint64_t k) |
| 106 | + { |
| 107 | + GIndex gid; |
| 108 | + gid.setRaw(static_cast<GIndex::Base_t>(k & 0xffffffff)); |
| 109 | + return {gid, int(k >> 32)}; |
| 110 | + } |
| 111 | + |
80 | 112 | enum HypCascade { |
81 | 113 | XiMinus, |
82 | 114 | OmegaMinus, |
@@ -123,6 +155,7 @@ class SVertexer |
123 | 155 | int getN3Bodies() const { return mN3Bodies; } |
124 | 156 | int getNStrangeTracks() const { return mNStrangeTracks; } |
125 | 157 | auto& getMeanVertex() const { return mMeanVertex; } |
| 158 | + const auto& getPoolRejections() const { return mPoolRejections; } // empty unless compiled with _FILL_SV_POOL_REJECTIONS_ |
126 | 159 | void setMeanVertex(const o2::dataformats::MeanVertexObject* v) |
127 | 160 | { |
128 | 161 | if (v == nullptr) { |
@@ -158,7 +191,13 @@ class SVertexer |
158 | 191 | void setupThreads(); |
159 | 192 | void buildT2V(const o2::globaltracking::RecoContainer& recoTracks); |
160 | 193 | void updateTimeDependentParams(); |
161 | | - bool acceptTrack(const GIndex gid, const o2::track::TrackParCov& trc) const; |
| 194 | + bool acceptTrack(const GIndex gid, const o2::track::TrackParCov& trc, PoolRejection& reason) const; |
| 195 | + void flagPoolRejection(GIndex gid, int iv, PoolRejection reason) |
| 196 | + { |
| 197 | +#ifdef _FILL_SV_POOL_REJECTIONS_ |
| 198 | + mPoolRejections[getPoolRejectionKey(gid, iv)] |= uint16_t(0x1 << reason); |
| 199 | +#endif |
| 200 | + } |
162 | 201 | bool processTPCTrack(const o2::tpc::TrackTPC& trTPC, GIndex gid, int vtxid); |
163 | 202 | float correctTPCTrack(TrackCand& trc, const o2::tpc::TrackTPC& tTPC, float tmus, float tmusErr) const; |
164 | 203 |
|
@@ -186,6 +225,7 @@ class SVertexer |
186 | 225 | std::vector<std::vector<Decay3BodyIndex>> m3bodyIdxTmp; |
187 | 226 | std::array<std::vector<TrackCand>, 2> mTracksPool{}; // pools of positive and negative seeds sorted in min VtxID |
188 | 227 | std::array<std::vector<int>, 2> mVtxFirstTrack{}; // 1st pos. and neg. track of the pools for each vertex |
| 228 | + std::unordered_map<uint64_t, uint16_t> mPoolRejections{}; // key: (vertexID << 32) | GIndex.getRaw(); value: bit pattern (0x1<<PoolRejection) of reasons for not entering the pools (filled only if _FILL_SV_POOL_REJECTIONS_ is defined) |
189 | 229 |
|
190 | 230 | o2::dataformats::VertexBase mMeanVertex{{0., 0., 0.}, {0.1 * 0.1, 0., 0.1 * 0.1, 0., 0., 6. * 6.}}; |
191 | 231 | const SVertexerParams* mSVParams = nullptr; |
|
0 commit comments