Project
Loading...
Searching...
No Matches
SVertexer.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15#ifndef O2_S_VERTEXER_H
16#define O2_S_VERTEXER_H
17
18#include "gsl/span"
35#include <numeric>
36#include <algorithm>
37#include "GPUO2InterfaceRefit.h"
39
40namespace o2
41{
42namespace tpc
43{
44class VDriftCorrFact;
45}
46namespace gpu
47{
48class TPCFastTransformPOD;
49}
50
51namespace vertexing
52{
53
55{
56 public:
69
79
85
97
98 static constexpr int POS = 0, NEG = 1;
102 float minR = 0; // track lowest point r
103 bool hasTPC = false;
104 int8_t nITSclu = -1;
105 bool compatibleProton = false; // dE/dx compatibility with proton hypothesis (FIXME: use better, uint8_t compat mask?)
106 bool hasITS() const
107 {
108 return nITSclu > 0;
109 }
110 };
111
112 SVertexer(bool enabCascades = true, bool enab3body = false) : mEnableCascades{enabCascades}, mEnable3BodyDecays{enab3body}
113 {
114 }
115
116 void setEnableCascades(bool v) { mEnableCascades = v; }
117 void setEnable3BodyDecays(bool v) { mEnable3BodyDecays = v; }
118 void init();
121 int getNV0s() const { return mNV0s; }
122 int getNCascades() const { return mNCascades; }
123 int getN3Bodies() const { return mN3Bodies; }
124 int getNStrangeTracks() const { return mNStrangeTracks; }
125 auto& getMeanVertex() const { return mMeanVertex; }
127 {
128 if (v == nullptr) {
129 return;
130 }
131 mMeanVertex = v->getMeanVertex();
132 }
133
134 void setNThreads(int n);
135 int getNThreads() const { return mNThreads; }
136 void setUseMC(bool v) { mUseMC = v; }
137 bool getUseMC() const { return mUseMC; }
138
139 void setTPCTBin(int nbc)
140 {
141 // set TPC time bin in BCs
142 mMUS2TPCBin = 1.f / (nbc * o2::constants::lhc::LHCBunchSpacingMUS);
143 }
148
149 std::array<size_t, 3> getNFitterCalls() const;
151
152 private:
153 template <class TVI, class TCI, class T3I, class TR>
154 void extractPVReferences(const TVI& v0s, TR& vtx2V0Refs, const TCI& cascades, TR& vtx2CascRefs, const T3I& vtxs3, TR& vtx2body3Refs);
155 bool checkV0(const TrackCand& seed0, const TrackCand& seed1, int iP, int iN, int ithread);
156 int checkCascades(const V0Index& v0Idx, const V0& v0, float rv0, std::array<float, 3> pV0, float p2V0, int avoidTrackID, int posneg, VBracket v0vlist, int ithread);
157 int check3bodyDecays(const V0Index& v0Idx, const V0& v0, float rv0, std::array<float, 3> pV0, float p2V0, int avoidTrackID, int posneg, VBracket v0vlist, int ithread);
158 void setupThreads();
159 void buildT2V(const o2::globaltracking::RecoContainer& recoTracks);
160 void updateTimeDependentParams();
161 bool acceptTrack(const GIndex gid, const o2::track::TrackParCov& trc) const;
162 bool processTPCTrack(const o2::tpc::TrackTPC& trTPC, GIndex gid, int vtxid);
163 float correctTPCTrack(TrackCand& trc, const o2::tpc::TrackTPC& tTPC, float tmus, float tmusErr) const;
164
165 uint64_t getPairIdx(GIndex id1, GIndex id2) const
166 {
167 return (uint64_t(id1) << 32) | id2;
168 }
169 const o2::globaltracking::RecoContainer* mRecoCont = nullptr;
170 GIndex::mask_t mSrc{};
171
172 const o2::tpc::ClusterNativeAccess* mTPCClusterIdxStruct = nullptr;
173 gsl::span<const o2::tpc::TrackTPC> mTPCTracksArray;
174 gsl::span<const o2::tpc::TPCClRefElem> mTPCTrackClusIdx;
175 gsl::span<const unsigned char> mTPCRefitterShMap;
176 gsl::span<const unsigned int> mTPCRefitterOccMap;
177 const o2::gpu::TPCFastTransformPOD* mTPCCorrMaps = nullptr;
178 std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mTPCRefitter;
180 gsl::span<const PVertex> mPVertices;
181 std::vector<std::vector<V0>> mV0sTmp;
182 std::vector<std::vector<Cascade>> mCascadesTmp;
183 std::vector<std::vector<Decay3Body>> m3bodyTmp;
184 std::vector<std::vector<V0Index>> mV0sIdxTmp;
185 std::vector<std::vector<CascadeIndex>> mCascadesIdxTmp;
186 std::vector<std::vector<Decay3BodyIndex>> m3bodyIdxTmp;
187 std::array<std::vector<TrackCand>, 2> mTracksPool{}; // pools of positive and negative seeds sorted in min VtxID
188 std::array<std::vector<int>, 2> mVtxFirstTrack{}; // 1st pos. and neg. track of the pools for each vertex
189
190 o2::dataformats::VertexBase mMeanVertex{{0., 0., 0.}, {0.1 * 0.1, 0., 0.1 * 0.1, 0., 0., 6. * 6.}};
191 const SVertexerParams* mSVParams = nullptr;
192 std::array<SVertexHypothesis, NHypV0> mV0Hyps;
193 std::array<SVertexHypothesis, NHypCascade> mCascHyps;
194 std::array<SVertex3Hypothesis, NHyp3body> m3bodyHyps;
195 std::vector<DCAFitterN<2>> mFitterV0;
196 std::vector<DCAFitterN<2>> mFitterCasc;
197 std::vector<DCAFitterN<3>> mFitter3body;
198
199 PIDResponse mPIDresponse;
200
201 int mNThreads = 1;
202 int mNV0s = 0, mNCascades = 0, mN3Bodies = 0, mNStrangeTracks = 0;
203 float mBz = 0;
204 float mMinR2ToMeanVertex = 0;
205 float mMaxDCAXY2ToMeanVertex = 0;
206 float mMaxDCAXY2ToMeanVertexV0Casc = 0;
207 float mMaxDCAXY2ToMeanVertex3bodyV0 = 0;
208 float mMinR2DiffV0Casc = 0;
209 float mMaxR2ToMeanVertexCascV0 = 0;
210 float mMinPt2V0 = 1e-6;
211 float mMaxTgl2V0 = 2. * 2.;
212 float mMinPt2Casc = 1e-4;
213 float mMaxTgl2Casc = 2. * 2.;
214 float mMinPt23Body = 1e-4;
215 float mMaxTgl23Body = 2.f * 2.f;
216 float mMUS2TPCBin = 1.f / (8 * o2::constants::lhc::LHCBunchSpacingMUS);
217 float mTPCBin2Z = 0;
218 float mTPCVDrift = 0;
219 float mTPCVDriftCorrFact = 1.;
220 float mTPCVDriftRef = 0;
221 float mTPCDriftTimeOffset = 0;
222
223 bool mEnableCascades = true;
224 bool mEnable3BodyDecays = false;
225 bool mUseMC = false;
226};
227
228} // namespace vertexing
229} // namespace o2
230
231#endif
Helper class to read the binary format of TPC ClusterNative.
Defintions for N-prongs secondary vertex fit.
Wrapper container for different reconstructed object types.
Class to refer to the 1st entry and N elements of some group in the continuous container.
V0 or Cascade and 3-body decay hypothesis checker.
Configurable params for secondary vertexer.
Extention of GlobalTrackID by flags relevant for verter-track association.
Referenc on track indices contributing to the vertex, with possibility chose tracks from specific sou...
TO BE DONE: extend to generic N body vertex.
Definition Decay3Body.h:26
PID response class.
Definition PIDResponse.h:39
o2::tpc::PIDResponse PIDResponse
Definition SVertexer.h:68
void setEnableCascades(bool v)
Definition SVertexer.h:116
std::array< size_t, 3 > getNFitterCalls() const
void setEnable3BodyDecays(bool v)
Definition SVertexer.h:117
void setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD *maph)
o2::math_utils::Bracket< int > VBracket
Definition SVertexer.h:67
o2::strangeness_tracking::StrangenessTracker * getStrangenessTracker()
Definition SVertexer.h:147
void process(const o2::globaltracking::RecoContainer &recoTracks, o2::framework::ProcessingContext &pc)
Definition SVertexer.cxx:42
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
static constexpr int POS
Definition SVertexer.h:98
void setMeanVertex(const o2::dataformats::MeanVertexObject *v)
Definition SVertexer.h:126
static constexpr int NEG
Definition SVertexer.h:98
void setTPCTBin(int nbc)
Definition SVertexer.h:139
void setStrangenessTracker(o2::strangeness_tracking::StrangenessTracker *tracker)
Definition SVertexer.h:146
int getNStrangeTracks() const
Definition SVertexer.h:124
void setSources(GIndex::mask_t src)
Definition SVertexer.h:150
SVertexer(bool enabCascades=true, bool enab3body=false)
Definition SVertexer.h:112
void produceOutput(o2::framework::ProcessingContext &pc)
Definition SVertexer.cxx:87
auto & getMeanVertex() const
Definition SVertexer.h:125
GLdouble n
Definition glcorearb.h:1982
GLenum src
Definition glcorearb.h:1767
const GLdouble * v
Definition glcorearb.h:832
GLfloat v0
Definition glcorearb.h:811
constexpr double LHCBunchSpacingMUS
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...