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 <framework/geometry/B2Vector3.h>
14#include <TMatrixDSym.h>
15#include <string>
16
17// DataObjects
18#include <mdst/dataobjects/TrackFitResult.h>
19#include <mdst/dataobjects/MCParticle.h>
20#include <analysis/dataobjects/Particle.h>
21
22namespace Belle2 {
34 class TagVertex : public RelationsObject {
35
36 public:
37
43 {
44 m_tagVertex(0) = 0; m_tagVertex(1) = 0; m_tagVertex(2) = 0;
46 m_deltaT = 0;
47 m_deltaTErr = 0;
48 m_mcDeltaTau = 0;
49 m_mcDeltaT = 0;
50 m_mcTagV(0) = 0; m_mcTagV(1) = 0; m_mcTagV(2) = 0;
51 m_mcPDG = 0;
54 m_FitType = 0;
55 m_NTracks = -1;
56 m_tagVl = 0;
57 m_tagVlErr = 0;
58 m_tagVol = 0;
59 m_tagVolErr = 0;
60 m_truthTagVl = 0;
61 m_truthTagVol = 0;
62 m_tagVNDF = 0;
63 m_tagVChi2 = 0;
64 m_tagVChi2IP = 0;
65 m_NFitTracks = 0;
70 }
71
72 // get methods
73
78
82 TMatrixDSym getTagVertexErrMatrix() const;
83
87 float getTagVertexPval() const;
88
92 const Particle* getVtxFitParticle(unsigned int trackIndex) const;
93
97 const MCParticle* getVtxFitMCParticle(unsigned int trackIndex) const;
98
102 float getDeltaT() const;
103
107 float getDeltaTErr() const;
108
113
117 int getMCTagBFlavor() const;
118
122 float getMCDeltaTau() const;
123
127 float getMCDeltaT() const;
128
132 int getFitType() const;
133
138 std::string getConstraintType() const;
139
143 int getNTracks() const;
144
148 int getNFitTracks() const;
149
153 float getTagVl() const;
154
158 float getTruthTagVl() const;
159
163 float getTagVlErr() const;
164
168 float getTagVol() const;
169
173 float getTruthTagVol() const;
174
178 float getTagVolErr() const;
179
183 float getTagVNDF() const;
184
188 float getTagVChi2() const;
189
193 float getTagVChi2IP() const;
194
201
206 TMatrixDSym getConstraintCov() const;
207
212 ROOT::Math::XYZVector getVtxFitTrackP(unsigned int trackIndex) const;
213
218 double getVtxFitTrackZ0(unsigned int trackIndex) const;
219
224 double getVtxFitTrackD0(unsigned int trackIndex) const;
225
230 double getRaveWeight(unsigned int trackIndex) const;
231
235 int getFitTruthStatus() const;
236
240 int getRollBackStatus() const;
241
242 // set methods
243
247 void setTagVertex(const B2Vector3D& TagVertex);
248
252 void setTagVertexErrMatrix(const TMatrixDSym& TagVertexErrMatrix);
253
257 void setTagVertexPval(float TagVertexPval);
258
262 void setDeltaT(float DeltaT);
263
267 void setDeltaTErr(float DeltaTErr);
268
272 void setMCTagVertex(const B2Vector3D& mcTagVertex);
273
277 void setMCTagBFlavor(int mcTagBFlavor);
278
282 void setMCDeltaTau(float mcDeltaTau);
283
287 void setMCDeltaT(float mcDeltaT);
288
292 void setFitType(float FitType) ;
293
297 void setNTracks(int nTracks) ;
298
302 void setTagVl(float TagVl) ;
303
307 void setTruthTagVl(float TruthTagVl) ;
308
312 void setTagVlErr(float TagVlErr) ;
313
317 void setTagVol(float TagVol) ;
318
322 void setTruthTagVol(float TruthTagVol) ;
323
327 void setTagVolErr(float TagVolErr) ;
328
332 void setTagVNDF(float TagVNDF) ;
333
337 void setTagVChi2(float TagVChi2) ;
338
342 void setTagVChi2IP(float TagVChi2IP) ;
343
347 void setVertexFitParticles(const std::vector<const Particle*>& vtxFitParticles);
348
352 void setVertexFitMCParticles(const std::vector<const MCParticle*>& vtxFitMCParticles);
353
357 void setRaveWeights(const std::vector<double>& raveWeights);
358
363 void setConstraintCenter(const B2Vector3D& constraintCenter);
364
369 void setConstraintCov(const TMatrixDSym& constraintCov);
370
375 void setConstraintType(const std::string& constraintType);
376
380 void setFitTruthStatus(int truthStatus);
381
385 void setRollBackStatus(int backStatus);
386
387 private:
391 float m_deltaT;
399 float m_tagVl;
402 float m_tagVol;
405 float m_tagVNDF;
408 std::vector<const Particle*> m_vtxFitParticles;
409 std::vector<const MCParticle*> m_vtxFitMCParticles;
411 std::vector<double> m_raveWeights;
412 std::string m_constraintType;
414 TMatrixDSym m_constraintCov;
424
429 void resetConstraintCov();
430
440 };
441
443} // end namespace Belle2
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Class to store reconstructed particles.
Definition: Particle.h:75
Defines interface for accessing relations of objects in StoreArray.
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
TagVertex data object: contains Btag Vertex and DeltaT.
Definition: TagVertex.h:34
int m_fitTruthStatus
status of the fit when fitted with the truth info of the tracks
Definition: TagVertex.h:415
TMatrixDSym m_constraintCov
covariance matrix associated to the constraint, ie size of the constraint
Definition: TagVertex.h:414
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:410
float getDeltaTErr() const
Returns DeltaTErr.
Definition: TagVertex.cc:50
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:324
void setConstraintType(const std::string &constraintType)
Set the type of the constraint for the tag fit.
Definition: TagVertex.cc:312
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
TagVertex()
Default constructor.
Definition: TagVertex.h:42
float getDeltaT() const
Returns DeltaT.
Definition: TagVertex.cc:45
float m_tagVertexPval
Btag vertex P value.
Definition: TagVertex.h:390
B2Vector3D getTagVertex() const
Returns BTag Vertex.
Definition: TagVertex.cc:16
void setTagVlErr(float TagVlErr)
Set the error of the tagV component in the boost direction.
Definition: TagVertex.cc:250
std::vector< double > m_raveWeights
weights of each track in the Rave tag vtx fit
Definition: TagVertex.h:411
float m_tagVlErr
Error of the tagV component in the boost direction
Definition: TagVertex.h:401
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:408
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:245
void setTagVertex(const B2Vector3D &TagVertex)
Set BTag Vertex.
Definition: TagVertex.cc:185
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:157
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
void setConstraintCenter(const B2Vector3D &constraintCenter)
Set the centre of the constraint for the tag fit.
Definition: TagVertex.cc:301
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:389
int m_NTracks
Number of tracks used in the fit.
Definition: TagVertex.h:398
void setTruthTagVol(float TruthTagVol)
Set the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.cc:260
float m_mcDeltaT
generated Delta t approximated: true Delta L divided by Upsilon(4S)'s boost
Definition: TagVertex.h:396
void setMCTagBFlavor(int mcTagBFlavor)
Set generated Btag PDG code.
Definition: TagVertex.cc:215
float m_truthTagVl
MC tagV component in the boost direction
Definition: TagVertex.h:400
int getRollBackStatus() const
Get the status of the fit performed with the rolled back tracks.
Definition: TagVertex.cc:180
float m_tagVNDF
Number of degrees of freedom in the tag vertex fit.
Definition: TagVertex.h:405
std::vector< const MCParticle * > m_vtxFitMCParticles
pointers to the MC p'cles corresponding to the tracks in the tag vtx fit
Definition: TagVertex.h:409
void setTagVolErr(float TagVolErr)
Set the error of the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.cc:265
B2Vector3D m_constraintCenter
centre of the constraint
Definition: TagVertex.h:413
void setMCTagVertex(const B2Vector3D &mcTagVertex)
Set generated BTag Vertex.
Definition: TagVertex.cc:210
ROOT::Math::XYZVector getVtxFitTrackP(unsigned int trackIndex) const
Returns the momentum vector of the tag track indexed by trackindex.
Definition: TagVertex.cc:151
float m_tagVChi2
chi^2 value of the tag vertex fit result
Definition: TagVertex.h:406
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
B2Vector3D m_mcTagV
generated Btag vertex
Definition: TagVertex.h:393
void setTagVNDF(float TagVNDF)
Set the number of degrees of freedom in the tag vertex fit.
Definition: TagVertex.cc:270
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:175
void setDeltaTErr(float DeltaTErr)
Set DeltaTErr.
Definition: TagVertex.cc:205
float m_deltaT
Delta t.
Definition: TagVertex.h:391
float m_tagVolErr
Error of the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.h:404
void setNTracks(int nTracks)
Set number of tracks used in the fit.
Definition: TagVertex.cc:235
B2Vector3D m_tagVertex
Btag vertex.
Definition: TagVertex.h:388
void setTagVChi2(float TagVChi2)
Set the chi^2 value of the tag vertex fit result.
Definition: TagVertex.cc:275
void setMCDeltaT(float mcDeltaT)
Set generated DeltaT (in kin.
Definition: TagVertex.cc:225
void setRollBackStatus(int backStatus)
Set the status of the fit performed with the rolled back tracks.
Definition: TagVertex.cc:336
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:291
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 setTagVol(float TagVol)
Set the tagV component in the direction orthogonal to the boost.
Definition: TagVertex.cc:255
void setDeltaT(float DeltaT)
Set DeltaT.
Definition: TagVertex.cc:200
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:412
float m_tagVl
tagV component in the boost direction
Definition: TagVertex.h:399
float m_mcDeltaTau
generated Delta t: difference between signal and tag flight times
Definition: TagVertex.h:395
void setRaveWeights(const std::vector< double > &raveWeights)
Set the weights used by Rave in the tag vtx fit.
Definition: TagVertex.cc:296
void setTagVertexPval(float TagVertexPval)
Set BTag Vertex P value.
Definition: TagVertex.cc:195
B2Vector3D getConstraintCenter() const
Returns the position of the constraint, ie centre of the constraint ellipse.
Definition: TagVertex.cc:85
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:392
void setMCDeltaTau(float mcDeltaTau)
Set generated DeltaT.
Definition: TagVertex.cc:220
float m_tagVChi2IP
IP component of chi^2 value of the tag vertex fit result.
Definition: TagVertex.h:407
void setTagVl(float TagVl)
Set the tagV component in the boost direction.
Definition: TagVertex.cc:240
void setTagVertexErrMatrix(const TMatrixDSym &TagVertexErrMatrix)
Set BTag Vertex (3x3) error matrix.
Definition: TagVertex.cc:190
B2Vector3D getMCTagVertex() const
Returns generated BTag Vertex.
Definition: TagVertex.cc:55
int m_mcPDG
generated tag side B flavor (PDG code)
Definition: TagVertex.h:394
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:317
float m_truthTagVol
MC tagV component in the direction orthogonal to the boost.
Definition: TagVertex.h:403
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:163
float m_tagVol
tagV component in the direction orthogonal to the boost
Definition: TagVertex.h:402
int m_rollbackStatus
status of the fit when fitted with rolled back tracks
Definition: TagVertex.h:416
void setConstraintCov(const TMatrixDSym &constraintCov)
Set the covariance matrix of the constraint for the tag fit.
Definition: TagVertex.cc:306
void setFitType(float FitType)
Set fit algo type.
Definition: TagVertex.cc:230
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:285
int getNTracks() const
Returns number of tracks used in the fit.
Definition: TagVertex.cc:96
int m_FitType
Fit algo used.
Definition: TagVertex.h:397
void setTagVChi2IP(float TagVChi2IP)
Set the IP component of the chi^2 value of the tag vertex fit result.
Definition: TagVertex.cc:280
double getRaveWeight(unsigned int trackIndex) const
Returns the weight assigned by Rave to the track indexed by trackIndex.
Definition: TagVertex.cc:169
void setFitTruthStatus(int truthStatus)
Set the status of the fit performed with the truth info of the tracks.
Definition: TagVertex.cc:331
float getTagVertexPval() const
Returns BTag Vertex P value.
Definition: TagVertex.cc:26
Abstract base class for different kinds of events.