Belle II Software  release-06-02-00
TagVertex.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <analysis/dataobjects/TagVertex.h>
10 
11 using namespace Belle2;
12 
13 static const double realNaN = std::numeric_limits<double>::quiet_NaN();
14 static const TVector3 vecNaN(realNaN, realNaN, realNaN);
15 
16 TVector3 TagVertex::getTagVertex() const
17 {
18  return m_tagVertex;
19 }
20 
22 {
23  return m_tagVertexErrMatrix;
24 }
25 
27 {
28  return m_tagVertexPval;
29 }
30 
31 const Particle* TagVertex::getVtxFitParticle(unsigned int trackIndex) const
32 {
33  if (trackIndex >= m_vtxFitParticles.size())
34  return 0;
35  return m_vtxFitParticles.at(trackIndex);
36 }
37 
38 const MCParticle* TagVertex::getVtxFitMCParticle(unsigned int trackIndex) const
39 {
40  if (trackIndex >= m_vtxFitMCParticles.size())
41  return 0;
42  return m_vtxFitMCParticles.at(trackIndex);
43 }
44 
45 float TagVertex::getDeltaT() const
46 {
47  return m_deltaT;
48 }
49 
51 {
52  return m_deltaTErr;
53 }
54 
55 TVector3 TagVertex::getMCTagVertex() const
56 {
57  return m_mcTagV;
58 }
59 
61 {
62  return m_mcPDG;
63 }
64 
66 {
67  return m_mcDeltaTau;
68 }
69 
71 {
72  return m_mcDeltaT;
73 }
74 
76 {
77  return m_FitType;
78 }
79 
80 std::string TagVertex::getConstraintType() const
81 {
82  return m_constraintType;
83 }
84 
86 {
87  if (m_constraintType == "noConstraint") return vecNaN;
88  return m_constraintCenter;
89 }
90 
91 TMatrixDSym TagVertex::getConstraintCov() const
92 {
93  return m_constraintCov;
94 }
95 
97 {
98  return m_NTracks;
99 }
100 
102 {
103  return m_NFitTracks;
104 }
105 
106 float TagVertex::getTagVl() const
107 {
108  return m_tagVl;
109 }
110 
112 {
113  return m_truthTagVl;
114 }
115 
117 {
118  return m_tagVlErr;
119 }
120 
121 float TagVertex::getTagVol() const
122 {
123  return m_tagVol;
124 }
125 
127 {
128  return m_truthTagVol;
129 }
130 
132 {
133  return m_tagVolErr;
134 }
135 
137 {
138  return m_tagVNDF;
139 }
140 
142 {
143  return m_tagVChi2;
144 }
145 
147 {
148  return m_tagVChi2IP;
149 }
150 
151 TVector3 TagVertex::getVtxFitTrackPosition(unsigned int trackIndex) const
152 {
153  if (m_vtxFitParticles.size() <= trackIndex) return vecNaN;
154  return m_vtxFitParticles.at(trackIndex)->getTrackFitResult()->getPosition();
155 }
156 
157 
158 TVector3 TagVertex::getVtxFitTrackP(unsigned int trackIndex) const
159 {
160  if (m_vtxFitParticles.size() <= trackIndex) return vecNaN;
161  return m_vtxFitParticles.at(trackIndex)->getMomentum();
162 }
163 
164 double TagVertex::getVtxFitTrackPComponent(unsigned int trackIndex, unsigned int component) const
165 {
166  if (m_vtxFitParticles.size() <= trackIndex || component > 2) return realNaN;
167  return m_vtxFitParticles.at(trackIndex)->getMomentum()[component];
168 }
169 
170 double TagVertex::getVtxFitTrackZ0(unsigned int trackIndex) const
171 {
172  if (m_vtxFitParticles.size() <= trackIndex) return realNaN;
173  return m_vtxFitParticles.at(trackIndex)->getTrackFitResult()->getZ0();
174 }
175 
176 double TagVertex::getVtxFitTrackD0(unsigned int trackIndex) const
177 {
178  if (m_vtxFitParticles.size() <= trackIndex) return realNaN;
179  return m_vtxFitParticles.at(trackIndex)->getTrackFitResult()->getD0();
180 }
181 
182 double TagVertex::getRaveWeight(unsigned int trackIndex) const
183 {
184  if (m_raveWeights.size() <= trackIndex) return realNaN;
185  return m_raveWeights.at(trackIndex);
186 }
187 
189 {
190  return m_fitTruthStatus;
191 }
192 
194 {
195  return m_rollbackStatus;
196 }
197 
198 void TagVertex::setTagVertex(const TVector3& tagVertex)
199 {
200  m_tagVertex = tagVertex;
201 }
202 
203 void TagVertex::setTagVertexErrMatrix(const TMatrixDSym& TagVertexErrMatrix)
204 {
205  m_tagVertexErrMatrix = TagVertexErrMatrix;
206 }
207 
208 void TagVertex::setTagVertexPval(float TagVertexPval)
209 {
210  m_tagVertexPval = TagVertexPval;
211 }
212 
213 void TagVertex::setDeltaT(float DeltaT)
214 {
215  m_deltaT = DeltaT;
216 }
217 
218 void TagVertex::setDeltaTErr(float DeltaTErr)
219 {
220  m_deltaTErr = DeltaTErr;
221 }
222 
223 void TagVertex::setMCTagVertex(const TVector3& mcTagVertex)
224 {
225  m_mcTagV = mcTagVertex;
226 }
227 
228 void TagVertex::setMCTagBFlavor(int mcTagBFlavor)
229 {
230  m_mcPDG = mcTagBFlavor;
231 }
232 
233 void TagVertex::setMCDeltaTau(float mcDeltaTau)
234 {
235  m_mcDeltaTau = mcDeltaTau;
236 }
237 
238 void TagVertex::setMCDeltaT(float mcDeltaT)
239 {
240  m_mcDeltaT = mcDeltaT;
241 }
242 
243 void TagVertex::setFitType(float FitType)
244 {
245  m_FitType = FitType;
246 }
247 
248 void TagVertex::setNTracks(int NTracks)
249 {
250  m_NTracks = NTracks;
251 }
252 
253 void TagVertex::setTagVl(float TagVl)
254 {
255  m_tagVl = TagVl;
256 }
257 
258 void TagVertex::setTruthTagVl(float TruthTagVl)
259 {
260  m_truthTagVl = TruthTagVl;
261 }
262 
263 void TagVertex::setTagVlErr(float TagVlErr)
264 {
265  m_tagVlErr = TagVlErr;
266 }
267 
268 void TagVertex::setTagVol(float TagVol)
269 {
270  m_tagVol = TagVol;
271 }
272 
273 void TagVertex::setTruthTagVol(float TruthTagVol)
274 {
275  m_truthTagVol = TruthTagVol;
276 }
277 
278 void TagVertex::setTagVolErr(float TagVolErr)
279 {
280  m_tagVolErr = TagVolErr;
281 }
282 
283 void TagVertex::setTagVNDF(float TagVNDF)
284 {
285  m_tagVNDF = TagVNDF;
286 }
287 
288 void TagVertex::setTagVChi2(float TagVChi2)
289 {
290  m_tagVChi2 = TagVChi2;
291 }
292 
293 void TagVertex::setTagVChi2IP(float TagVChi2IP)
294 {
295  m_tagVChi2IP = TagVChi2IP;
296 }
297 
298 void TagVertex::setVertexFitParticles(const std::vector<const Particle*>& vtxFitParticles)
299 {
300  m_vtxFitParticles = vtxFitParticles;
301  m_NFitTracks = vtxFitParticles.size();
302 }
303 
304 void TagVertex::setVertexFitMCParticles(const std::vector<const MCParticle*>& vtxFitMCParticles)
305 {
306  m_vtxFitMCParticles = vtxFitMCParticles;
307 }
308 
309 void TagVertex::setRaveWeights(const std::vector<double>& raveWeights)
310 {
311  m_raveWeights = raveWeights;
312 }
313 
314 void TagVertex::setConstraintCenter(const TVector3& constraintCenter)
315 {
316  m_constraintCenter = constraintCenter;
317 }
318 
319 void TagVertex::setConstraintCov(const TMatrixDSym& constraintCov)
320 {
321  m_constraintCov.ResizeTo(constraintCov);
322  m_constraintCov = constraintCov;
323 }
324 
325 void TagVertex::setConstraintType(const std::string& constraintType)
326 {
327  m_constraintType = constraintType;
328 }
329 
331 {
332  TMatrixDSym temp(3);
333  m_tagVertexErrMatrix.ResizeTo(temp);
334  m_tagVertexErrMatrix = temp;
335 }
336 
338 {
339  TMatrixDSym temp(3);
340  m_constraintCov.ResizeTo(temp);
341  m_constraintCov = temp;
342 }
343 
344 void TagVertex::setFitTruthStatus(int truthStatus)
345 {
346  m_fitTruthStatus = truthStatus;
347 }
348 
349 void TagVertex::setRollBackStatus(int backStatus)
350 {
351  m_rollbackStatus = backStatus;
352 }
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Class to store reconstructed particles.
Definition: Particle.h:74
int m_fitTruthStatus
status of the fit when fitted with the truth info of the tracks
Definition: TagVertex.h:426
TMatrixDSym m_constraintCov
covariance matrix associated to the constraint, ie size of the constraint
Definition: TagVertex.h:425
std::string getConstraintType() const
get the constraint type used in the tag fit
Definition: TagVertex.cc:80
int m_NFitTracks
Number of tracks used by Rave to fit the vertex.
Definition: TagVertex.h:421
TVector3 getVtxFitTrackP(unsigned int trackIndex) const
Returns the momentum vector of the tag track indexed by trackindex.
Definition: TagVertex.cc:158
float getDeltaTErr() const
Returns DeltaTErr.
Definition: TagVertex.cc:50
TVector3 getConstraintCenter() const
Returns the position of the constraint, ie centre of the constraint ellipse.
Definition: TagVertex.cc:85
TMatrixDSym getConstraintCov() const
Get the covariance matrix of the constraint for the tag fit.
Definition: TagVertex.cc:91
void resetConstraintCov()
Resets 3x3 constraint error matrix All elements are set to 0.0.
Definition: TagVertex.cc:337
void setConstraintType(const std::string &constraintType)
Set the type of the constraint for the tag fit.
Definition: TagVertex.cc:325
float getTruthTagVl() const
Returns the MC tagV component in the boost direction.
Definition: TagVertex.cc:111
int getMCTagBFlavor() const
Returns generated Btag PDG code.
Definition: TagVertex.cc:60
double getVtxFitTrackPComponent(unsigned int trackIndex, unsigned int component) const
Returns one of the 3 components of the momentum of tag track indexed by trackindex.
Definition: TagVertex.cc:164
float getDeltaT() const
Returns DeltaT.
Definition: TagVertex.cc:45
TVector3 getVtxFitTrackPosition(unsigned int trackIndex) const
Returns the position vector (X, Y, Z) of the tag track indexed by trackindex.
Definition: TagVertex.cc:151
float m_tagVertexPval
Btag vertex P value.
Definition: TagVertex.h:401
void setTagVlErr(float TagVlErr)
Set the error of the tagV component in the boost direction.
Definition: TagVertex.cc:263
std::vector< double > m_raveWeights
weights of each track in the Rave tag vtx fit
Definition: TagVertex.h:422
void setTagVertex(const TVector3 &TagVertex)
Set BTag Vertex.
Definition: TagVertex.cc:198
float m_tagVlErr
Error of the tagV component in the boost direction
Definition: TagVertex.h:412
float getTagVolErr() const
Returns the error of the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.cc:131
std::vector< const Particle * > m_vtxFitParticles
pointers to the tracks used by rave to fit the vertex
Definition: TagVertex.h:419
float getTagVl() const
Returns the tagV component in the boost direction.
Definition: TagVertex.cc:106
void setTruthTagVl(float TruthTagVl)
Set the MC tagV component in the boost direction.
Definition: TagVertex.cc:258
double getVtxFitTrackZ0(unsigned int trackIndex) const
Returns the longitudinal distance from the IP to the POCA of the tag track indexed by trackIndex.
Definition: TagVertex.cc:170
float getMCDeltaT() const
Returns mc DeltaT (in kin.
Definition: TagVertex.cc:70
float getTagVol() const
Returns the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.cc:121
TVector3 m_tagVertex
Btag vertex.
Definition: TagVertex.h:399
const Particle * getVtxFitParticle(unsigned int trackIndex) const
Returns a ptr to the particle constructed from the tag vtx track indexed by trackIndex.
Definition: TagVertex.cc:31
TMatrixDSym m_tagVertexErrMatrix
Btag vertex (3x3) error matrix.
Definition: TagVertex.h:400
int m_NTracks
Number of tracks used in the fit.
Definition: TagVertex.h:409
void setTruthTagVol(float TruthTagVol)
Set the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.cc:273
float m_mcDeltaT
generated Delta t approximated: true Delta L divided by Upsilon(4S)'s boost
Definition: TagVertex.h:407
void setMCTagBFlavor(int mcTagBFlavor)
Set generated Btag PDG code.
Definition: TagVertex.cc:228
float m_truthTagVl
MC tagV component in the boost direction
Definition: TagVertex.h:411
TVector3 getMCTagVertex() const
Returns generated BTag Vertex.
Definition: TagVertex.cc:55
int getRollBackStatus() const
Get the status of the fit performed with the rolled back tracks.
Definition: TagVertex.cc:193
float m_tagVNDF
Number of degrees of freedom in the tag vertex fit.
Definition: TagVertex.h:416
std::vector< const MCParticle * > m_vtxFitMCParticles
pointers to the MC p'cles corresponding to the tracks in the tag vtx fit
Definition: TagVertex.h:420
void setTagVolErr(float TagVolErr)
Set the error of the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.cc:278
float m_tagVChi2
chi^2 value of the tag vertex fit result
Definition: TagVertex.h:417
int getNFitTracks() const
Returns number of tracks used in the fit (not counting the ones removed because they come from Kshort...
Definition: TagVertex.cc:101
void setTagVNDF(float TagVNDF)
Set the number of degrees of freedom in the tag vertex fit.
Definition: TagVertex.cc:283
float getTagVlErr() const
Returns the error of the tagV component in the boost direction.
Definition: TagVertex.cc:116
int getFitTruthStatus() const
Get the status of the fit performed with the truth info of the tracks.
Definition: TagVertex.cc:188
void setDeltaTErr(float DeltaTErr)
Set DeltaTErr.
Definition: TagVertex.cc:218
TVector3 getTagVertex() const
Returns BTag Vertex.
Definition: TagVertex.cc:16
float m_deltaT
Delta t.
Definition: TagVertex.h:402
float m_tagVolErr
Error of the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.h:415
void setNTracks(int nTracks)
Set number of tracks used in the fit.
Definition: TagVertex.cc:248
void setTagVChi2(float TagVChi2)
Set the chi^2 value of the tag vertex fit result.
Definition: TagVertex.cc:288
void setMCDeltaT(float mcDeltaT)
Set generated DeltaT (in kin.
Definition: TagVertex.cc:238
void setRollBackStatus(int backStatus)
Set the status of the fit performed with the rolled back tracks.
Definition: TagVertex.cc:349
void setVertexFitMCParticles(const std::vector< const MCParticle * > &vtxFitMCParticles)
Set a vector of pointers to the MC p'cles corresponding to the tracks in the tag vtx fit.
Definition: TagVertex.cc:304
float getMCDeltaTau() const
Returns generated DeltaTau.
Definition: TagVertex.cc:65
float getTruthTagVol() const
Returns the MC tagV component in the direction orthogonal to the boost.
Definition: TagVertex.cc:126
void setMCTagVertex(const TVector3 &mcTagVertex)
Set generated BTag Vertex.
Definition: TagVertex.cc:223
void setTagVol(float TagVol)
Set the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.cc:268
void setDeltaT(float DeltaT)
Set DeltaT.
Definition: TagVertex.cc:213
int getFitType() const
Returns fit algo type.
Definition: TagVertex.cc:75
float getTagVNDF() const
Returns the number of degrees of freedom in the tag vertex fit.
Definition: TagVertex.cc:136
std::string m_constraintType
Type of the constraint used for the tag vertex fit (noConstraint, IP, Boost, Tube)
Definition: TagVertex.h:423
float m_tagVl
tagV component in the boost direction
Definition: TagVertex.h:410
float m_mcDeltaTau
generated Delta t: difference between signal and tag flight times
Definition: TagVertex.h:406
void setRaveWeights(const std::vector< double > &raveWeights)
Set the weights used by Rave in the tag vtx fit.
Definition: TagVertex.cc:309
void setTagVertexPval(float TagVertexPval)
Set BTag Vertex P value.
Definition: TagVertex.cc:208
const MCParticle * getVtxFitMCParticle(unsigned int trackIndex) const
Returns a ptr to the MC particle matched to the tag vtx track indexed by trackIndex.
Definition: TagVertex.cc:38
TMatrixDSym getTagVertexErrMatrix() const
Returns BTag Vertex (3x3) error matrix.
Definition: TagVertex.cc:21
float m_deltaTErr
Delta t error.
Definition: TagVertex.h:403
void setMCDeltaTau(float mcDeltaTau)
Set generated DeltaT.
Definition: TagVertex.cc:233
float m_tagVChi2IP
IP component of chi^2 value of the tag vertex fit result.
Definition: TagVertex.h:418
void setTagVl(float TagVl)
Set the tagV component in the boost direction.
Definition: TagVertex.cc:253
void setTagVertexErrMatrix(const TMatrixDSym &TagVertexErrMatrix)
Set BTag Vertex (3x3) error matrix.
Definition: TagVertex.cc:203
int m_mcPDG
generated tag side B flavor (PDG code)
Definition: TagVertex.h:405
float getTagVChi2() const
Returns the chi^2 value of the tag vertex fit result.
Definition: TagVertex.cc:141
float getTagVChi2IP() const
Returns the IP component of the chi^2 value of the tag vertex fit result.
Definition: TagVertex.cc:146
void resetTagVertexErrorMatrix()
Resets 3x3 tag vertex error matrix All elements are set to 0.0.
Definition: TagVertex.cc:330
float m_truthTagVol
MC tagV component in the direction orthogonal to the boost.
Definition: TagVertex.h:414
double getVtxFitTrackD0(unsigned int trackIndex) const
Returns the radial distance from the IP to the POCA of the tag track indexed by trackIndex.
Definition: TagVertex.cc:176
TVector3 m_constraintCenter
centre of the constraint
Definition: TagVertex.h:424
float m_tagVol
tagV component in the direction orthogonal to the boost
Definition: TagVertex.h:413
void setConstraintCenter(const TVector3 &constraintCenter)
Set the centre of the constraint for the tag fit.
Definition: TagVertex.cc:314
int m_rollbackStatus
status of the fit when fitted with rolled back tracks
Definition: TagVertex.h:427
void setConstraintCov(const TMatrixDSym &constraintCov)
Set the covariance matrix of the constraint for the tag fit.
Definition: TagVertex.cc:319
void setFitType(float FitType)
Set fit algo type.
Definition: TagVertex.cc:243
void setVertexFitParticles(const std::vector< const Particle * > &vtxFitParticles)
Set a vector of pointers to the tracks used in the tag vtx fit.
Definition: TagVertex.cc:298
TVector3 m_mcTagV
generated Btag vertex
Definition: TagVertex.h:404
int getNTracks() const
Returns number of tracks used in the fit.
Definition: TagVertex.cc:96
int m_FitType
Fit algo used.
Definition: TagVertex.h:408
void setTagVChi2IP(float TagVChi2IP)
Set the IP component of the chi^2 value of the tag vertex fit result.
Definition: TagVertex.cc:293
double getRaveWeight(unsigned int trackIndex) const
Returns the weight assigned by Rave to the track indexed by trackIndex.
Definition: TagVertex.cc:182
void setFitTruthStatus(int truthStatus)
Set the status of the fit performed with the truth info of the tracks.
Definition: TagVertex.cc:344
float getTagVertexPval() const
Returns BTag Vertex P value.
Definition: TagVertex.cc:26
static const double realNaN
shortcut for NaN of double type
static const TVector3 vecNaN(realNaN, realNaN, realNaN)
vector with NaN entries
Abstract base class for different kinds of events.