Belle II Software development
TagVertex.h
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#pragma once
10
11#include <framework/datastore/RelationsObject.h>
12
13#include <Math/Vector3D.h>
14#include <TMatrixDSym.h>
15#include <string>
16
17namespace Belle2 {
22 class MCParticle;
23 class Particle;
24
28
29 class TagVertex : public RelationsObject {
30
31 public:
32
38 {
39 m_tagVertex = ROOT::Math::XYZVector(0, 0, 0);
41 m_deltaT = 0;
42 m_deltaTErr = 0;
43 m_mcDeltaTau = 0;
44 m_mcDeltaT = 0;
45 m_mcTagV = ROOT::Math::XYZVector(0, 0, 0);
46 m_mcPDG = 0;
49 m_FitType = 0;
50 m_NTracks = -1;
51 m_tagVl = 0;
52 m_tagVlErr = 0;
53 m_tagVol = 0;
54 m_tagVolErr = 0;
55 m_truthTagVl = 0;
56 m_truthTagVol = 0;
57 m_tagVNDF = 0;
58 m_tagVChi2 = 0;
59 m_tagVChi2IP = 0;
60 m_NFitTracks = 0;
62 m_constraintCenter = ROOT::Math::XYZVector(0, 0, 0);
65 }
66
67 // get methods
68
72 ROOT::Math::XYZVector getTagVertex() const;
73
77 TMatrixDSym getTagVertexErrMatrix() const;
78
82 float getTagVertexPval() const;
83
87 const Particle* getVtxFitParticle(unsigned int trackIndex) const;
88
92 const MCParticle* getVtxFitMCParticle(unsigned int trackIndex) const;
93
97 float getDeltaT() const;
98
102 float getDeltaTErr() const;
103
107 ROOT::Math::XYZVector getMCTagVertex() const;
108
112 int getMCTagBFlavor() const;
113
117 float getMCDeltaTau() const;
118
122 float getMCDeltaT() const;
123
127 int getFitType() const;
128
132
133 std::string getConstraintType() const;
134
138 int getNTracks() const;
139
143 int getNFitTracks() const;
144
148 float getTagVl() const;
149
153 float getTruthTagVl() const;
154
158 float getTagVlErr() const;
159
163 float getTagVol() const;
164
168 float getTruthTagVol() const;
169
173 float getTagVolErr() const;
174
178 float getTagVNDF() const;
179
183 float getTagVChi2() const;
184
188 float getTagVChi2IP() const;
189
194
195 ROOT::Math::XYZVector getConstraintCenter() const;
196
200
201 TMatrixDSym getConstraintCov() const;
202
206
207 ROOT::Math::XYZVector getVtxFitTrackP(unsigned int trackIndex) const;
208
212
213 double getVtxFitTrackZ0(unsigned int trackIndex) const;
214
218
219 double getVtxFitTrackD0(unsigned int trackIndex) const;
220
224
225 double getRaveWeight(unsigned int trackIndex) const;
226
230 int getFitTruthStatus() const;
231
235 int getRollBackStatus() const;
236
237 // set methods
238
242 void setTagVertex(const ROOT::Math::XYZVector& TagVertex);
243
247 void setTagVertexErrMatrix(const TMatrixDSym& TagVertexErrMatrix);
248
252 void setTagVertexPval(float TagVertexPval);
253
257 void setDeltaT(float DeltaT);
258
262 void setDeltaTErr(float DeltaTErr);
263
267 void setMCTagVertex(const ROOT::Math::XYZVector& mcTagVertex);
268
272 void setMCTagBFlavor(int mcTagBFlavor);
273
277 void setMCDeltaTau(float mcDeltaTau);
278
282 void setMCDeltaT(float mcDeltaT);
283
287 void setFitType(float FitType) ;
288
292 void setNTracks(int nTracks) ;
293
297 void setTagVl(float TagVl) ;
298
302 void setTruthTagVl(float TruthTagVl) ;
303
307 void setTagVlErr(float TagVlErr) ;
308
312 void setTagVol(float TagVol) ;
313
317 void setTruthTagVol(float TruthTagVol) ;
318
322 void setTagVolErr(float TagVolErr) ;
323
327 void setTagVNDF(float TagVNDF) ;
328
332 void setTagVChi2(float TagVChi2) ;
333
337 void setTagVChi2IP(float TagVChi2IP) ;
338
342 void setVertexFitParticles(const std::vector<const Particle*>& vtxFitParticles);
343
347 void setVertexFitMCParticles(const std::vector<const MCParticle*>& vtxFitMCParticles);
348
352 void setRaveWeights(const std::vector<double>& raveWeights);
353
357
358 void setConstraintCenter(const ROOT::Math::XYZVector& constraintCenter);
359
363
364 void setConstraintCov(const TMatrixDSym& constraintCov);
365
369
370 void setConstraintType(const std::string& constraintType);
371
375 void setFitTruthStatus(int truthStatus);
376
380 void setRollBackStatus(int backStatus);
381
382 private:
383 ROOT::Math::XYZVector m_tagVertex;
386 float m_deltaT;
388 ROOT::Math::XYZVector m_mcTagV;
394 float m_tagVl;
397 float m_tagVol;
400 float m_tagVNDF;
403 std::vector<const Particle*> m_vtxFitParticles;
404 std::vector<const MCParticle*> m_vtxFitMCParticles;
406 std::vector<double> m_raveWeights;
407 std::string m_constraintType;
408 ROOT::Math::XYZVector m_constraintCenter;
409 TMatrixDSym m_constraintCov;
412
413
419
424 void resetConstraintCov();
425
435
436 };
437
439} // end namespace Belle2
A Class to store the Monte Carlo particle information.
Definition MCParticle.h:32
Class to store reconstructed particles.
Definition Particle.h:76
TagVertex data object: contains Btag Vertex and DeltaT.
Definition TagVertex.h:29
int m_fitTruthStatus
status of the fit when fitted with the truth info of the tracks
Definition TagVertex.h:410
TMatrixDSym m_constraintCov
covariance matrix associated to the constraint, ie size of the constraint
Definition TagVertex.h:409
std::string getConstraintType() const
get the constraint type used in the tag fit
Definition TagVertex.cc:84
int m_NFitTracks
Number of tracks used by Rave to fit the vertex.
Definition TagVertex.h:405
float getDeltaTErr() const
Returns DeltaTErr.
Definition TagVertex.cc:54
TMatrixDSym getConstraintCov() const
Get the covariance matrix of the constraint for the tag fit.
Definition TagVertex.cc:95
void resetConstraintCov()
Resets 3x3 constraint error matrix All elements are set to 0.0.
Definition TagVertex.cc:328
void setConstraintType(const std::string &constraintType)
Set the type of the constraint for the tag fit.
Definition TagVertex.cc:316
float getTruthTagVl() const
Returns the MC tagV component in the boost direction.
Definition TagVertex.cc:115
int getMCTagBFlavor() const
Returns generated Btag PDG code.
Definition TagVertex.cc:64
TagVertex()
Default constructor.
Definition TagVertex.h:37
float getDeltaT() const
Returns DeltaT.
Definition TagVertex.cc:49
float m_tagVertexPval
Btag vertex P value.
Definition TagVertex.h:385
void setTagVlErr(float TagVlErr)
Set the error of the tagV component in the boost direction.
Definition TagVertex.cc:254
std::vector< double > m_raveWeights
weights of each track in the Rave tag vtx fit
Definition TagVertex.h:406
ROOT::Math::XYZVector getTagVertex() const
Returns BTag Vertex.
Definition TagVertex.cc:20
float m_tagVlErr
Error of the tagV component in the boost direction.
Definition TagVertex.h:396
float getTagVolErr() const
Returns the error of the tagV component in the direction orthogonal to the boost.
Definition TagVertex.cc:135
std::vector< const Particle * > m_vtxFitParticles
pointers to the tracks used by rave to fit the vertex
Definition TagVertex.h:403
float getTagVl() const
Returns the tagV component in the boost direction.
Definition TagVertex.cc:110
void setTruthTagVl(float TruthTagVl)
Set the MC tagV component in the boost direction.
Definition TagVertex.cc:249
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:161
float getMCDeltaT() const
Returns mc DeltaT (in kin.
Definition TagVertex.cc:74
float getTagVol() const
Returns the tagV component in the direction orthogonal to the boost.
Definition TagVertex.cc:125
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:35
TMatrixDSym m_tagVertexErrMatrix
Btag vertex (3x3) error matrix.
Definition TagVertex.h:384
int m_NTracks
Number of tracks used in the fit.
Definition TagVertex.h:393
void setTruthTagVol(float TruthTagVol)
Set the tagV component in the direction orthogonal to the boost.
Definition TagVertex.cc:264
float m_mcDeltaT
generated Delta t approximated: true Delta L divided by Upsilon(4S)'s boost
Definition TagVertex.h:391
void setMCTagBFlavor(int mcTagBFlavor)
Set generated Btag PDG code.
Definition TagVertex.cc:219
float m_truthTagVl
MC tagV component in the boost direction.
Definition TagVertex.h:395
int getRollBackStatus() const
Get the status of the fit performed with the rolled back tracks.
Definition TagVertex.cc:184
ROOT::Math::XYZVector m_constraintCenter
centre of the constraint
Definition TagVertex.h:408
float m_tagVNDF
Number of degrees of freedom in the tag vertex fit.
Definition TagVertex.h:400
std::vector< const MCParticle * > m_vtxFitMCParticles
pointers to the MC p'cles corresponding to the tracks in the tag vtx fit
Definition TagVertex.h:404
void setTagVolErr(float TagVolErr)
Set the error of the tagV component in the direction orthogonal to the boost.
Definition TagVertex.cc:269
ROOT::Math::XYZVector getVtxFitTrackP(unsigned int trackIndex) const
Returns the momentum vector of the tag track indexed by trackindex.
Definition TagVertex.cc:155
float m_tagVChi2
chi^2 value of the tag vertex fit result
Definition TagVertex.h:401
int getNFitTracks() const
Returns number of tracks used in the fit (not counting the ones removed because they come from Kshort...
Definition TagVertex.cc:105
void setTagVNDF(float TagVNDF)
Set the number of degrees of freedom in the tag vertex fit.
Definition TagVertex.cc:274
float getTagVlErr() const
Returns the error of the tagV component in the boost direction.
Definition TagVertex.cc:120
int getFitTruthStatus() const
Get the status of the fit performed with the truth info of the tracks.
Definition TagVertex.cc:179
void setDeltaTErr(float DeltaTErr)
Set DeltaTErr.
Definition TagVertex.cc:209
float m_deltaT
Delta t.
Definition TagVertex.h:386
ROOT::Math::XYZVector getMCTagVertex() const
Returns generated BTag Vertex.
Definition TagVertex.cc:59
float m_tagVolErr
Error of the tagV component in the direction orthogonal to the boost.
Definition TagVertex.h:399
void setConstraintCenter(const ROOT::Math::XYZVector &constraintCenter)
Set the centre of the constraint for the tag fit.
Definition TagVertex.cc:305
void setNTracks(int nTracks)
Set number of tracks used in the fit.
Definition TagVertex.cc:239
void setTagVChi2(float TagVChi2)
Set the chi^2 value of the tag vertex fit result.
Definition TagVertex.cc:279
void setMCDeltaT(float mcDeltaT)
Set generated DeltaT (in kin.
Definition TagVertex.cc:229
ROOT::Math::XYZVector getConstraintCenter() const
Returns the position of the constraint, ie centre of the constraint ellipse.
Definition TagVertex.cc:89
void setRollBackStatus(int backStatus)
Set the status of the fit performed with the rolled back tracks.
Definition TagVertex.cc:340
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:295
float getMCDeltaTau() const
Returns generated DeltaTau.
Definition TagVertex.cc:69
float getTruthTagVol() const
Returns the MC tagV component in the direction orthogonal to the boost.
Definition TagVertex.cc:130
void setTagVol(float TagVol)
Set the tagV component in the direction orthogonal to the boost.
Definition TagVertex.cc:259
void setDeltaT(float DeltaT)
Set DeltaT.
Definition TagVertex.cc:204
int getFitType() const
Returns fit algo type.
Definition TagVertex.cc:79
float getTagVNDF() const
Returns the number of degrees of freedom in the tag vertex fit.
Definition TagVertex.cc:140
std::string m_constraintType
Type of the constraint used for the tag vertex fit (noConstraint, IP, Boost, Tube)
Definition TagVertex.h:407
float m_tagVl
tagV component in the boost direction
Definition TagVertex.h:394
float m_mcDeltaTau
generated Delta t: difference between signal and tag flight times
Definition TagVertex.h:390
void setRaveWeights(const std::vector< double > &raveWeights)
Set the weights used by Rave in the tag vtx fit.
Definition TagVertex.cc:300
void setTagVertexPval(float TagVertexPval)
Set BTag Vertex P value.
Definition TagVertex.cc:199
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:42
TMatrixDSym getTagVertexErrMatrix() const
Returns BTag Vertex (3x3) error matrix.
Definition TagVertex.cc:25
void setTagVertex(const ROOT::Math::XYZVector &TagVertex)
Set BTag Vertex.
Definition TagVertex.cc:189
float m_deltaTErr
Delta t error.
Definition TagVertex.h:387
void setMCDeltaTau(float mcDeltaTau)
Set generated DeltaT.
Definition TagVertex.cc:224
float m_tagVChi2IP
IP component of chi^2 value of the tag vertex fit result.
Definition TagVertex.h:402
void setTagVl(float TagVl)
Set the tagV component in the boost direction.
Definition TagVertex.cc:244
void setTagVertexErrMatrix(const TMatrixDSym &TagVertexErrMatrix)
Set BTag Vertex (3x3) error matrix.
Definition TagVertex.cc:194
int m_mcPDG
generated tag side B flavor (PDG code)
Definition TagVertex.h:389
float getTagVChi2() const
Returns the chi^2 value of the tag vertex fit result.
Definition TagVertex.cc:145
float getTagVChi2IP() const
Returns the IP component of the chi^2 value of the tag vertex fit result.
Definition TagVertex.cc:150
void resetTagVertexErrorMatrix()
Resets 3x3 tag vertex error matrix All elements are set to 0.0.
Definition TagVertex.cc:321
float m_truthTagVol
MC tagV component in the direction orthogonal to the boost.
Definition TagVertex.h:398
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:167
ROOT::Math::XYZVector m_mcTagV
generated Btag vertex
Definition TagVertex.h:388
float m_tagVol
tagV component in the direction orthogonal to the boost
Definition TagVertex.h:397
ROOT::Math::XYZVector m_tagVertex
Btag vertex.
Definition TagVertex.h:383
int m_rollbackStatus
status of the fit when fitted with rolled back tracks
Definition TagVertex.h:411
void setConstraintCov(const TMatrixDSym &constraintCov)
Set the covariance matrix of the constraint for the tag fit.
Definition TagVertex.cc:310
void setFitType(float FitType)
Set fit algo type.
Definition TagVertex.cc:234
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:289
void setMCTagVertex(const ROOT::Math::XYZVector &mcTagVertex)
Set generated BTag Vertex.
Definition TagVertex.cc:214
int getNTracks() const
Returns number of tracks used in the fit.
Definition TagVertex.cc:100
int m_FitType
Fit algo used.
Definition TagVertex.h:392
void setTagVChi2IP(float TagVChi2IP)
Set the IP component of the chi^2 value of the tag vertex fit result.
Definition TagVertex.cc:284
double getRaveWeight(unsigned int trackIndex) const
Returns the weight assigned by Rave to the track indexed by trackIndex.
Definition TagVertex.cc:173
void setFitTruthStatus(int truthStatus)
Set the status of the fit performed with the truth info of the tracks.
Definition TagVertex.cc:335
float getTagVertexPval() const
Returns BTag Vertex P value.
Definition TagVertex.cc:30
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Abstract base class for different kinds of events.