Belle II Software development
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
11using namespace Belle2;
12
13static const double realNaN = std::numeric_limits<double>::quiet_NaN();
14static const B2Vector3D vecNaN(realNaN, realNaN, realNaN);
15
17{
18 return m_tagVertex;
19}
20
22{
24}
25
27{
28 return m_tagVertexPval;
29}
30
31const 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
38const 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
46{
47 return m_deltaT;
48}
49
51{
52 return m_deltaTErr;
53}
54
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
81{
82 return m_constraintType;
83}
84
86{
87 if (m_constraintType == "noConstraint") return vecNaN;
88 return m_constraintCenter;
89}
90
91TMatrixDSym TagVertex::getConstraintCov() const
92{
93 return m_constraintCov;
94}
95
97{
98 return m_NTracks;
99}
100
102{
103 return m_NFitTracks;
104}
105
107{
108 return m_tagVl;
109}
110
112{
113 return m_truthTagVl;
114}
115
117{
118 return m_tagVlErr;
119}
120
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
151ROOT::Math::XYZVector TagVertex::getVtxFitTrackP(unsigned int trackIndex) const
152{
153 if (m_vtxFitParticles.size() <= trackIndex) return ROOT::Math::XYZVector(realNaN, realNaN, realNaN);
154 return m_vtxFitParticles.at(trackIndex)->getMomentum();
155}
156
157double TagVertex::getVtxFitTrackZ0(unsigned int trackIndex) const
158{
159 if (m_vtxFitParticles.size() <= trackIndex) return realNaN;
160 return m_vtxFitParticles.at(trackIndex)->getTrackFitResult()->getZ0();
161}
162
163double TagVertex::getVtxFitTrackD0(unsigned int trackIndex) const
164{
165 if (m_vtxFitParticles.size() <= trackIndex) return realNaN;
166 return m_vtxFitParticles.at(trackIndex)->getTrackFitResult()->getD0();
167}
168
169double TagVertex::getRaveWeight(unsigned int trackIndex) const
170{
171 if (m_raveWeights.size() <= trackIndex) return realNaN;
172 return m_raveWeights.at(trackIndex);
173}
174
176{
177 return m_fitTruthStatus;
178}
179
181{
182 return m_rollbackStatus;
183}
184
186{
187 m_tagVertex = tagVertex;
188}
189
190void TagVertex::setTagVertexErrMatrix(const TMatrixDSym& TagVertexErrMatrix)
191{
192 m_tagVertexErrMatrix = TagVertexErrMatrix;
193}
194
195void TagVertex::setTagVertexPval(float TagVertexPval)
196{
197 m_tagVertexPval = TagVertexPval;
198}
199
200void TagVertex::setDeltaT(float DeltaT)
201{
202 m_deltaT = DeltaT;
203}
204
205void TagVertex::setDeltaTErr(float DeltaTErr)
206{
207 m_deltaTErr = DeltaTErr;
208}
209
210void TagVertex::setMCTagVertex(const B2Vector3D& mcTagVertex)
211{
212 m_mcTagV = mcTagVertex;
213}
214
215void TagVertex::setMCTagBFlavor(int mcTagBFlavor)
216{
217 m_mcPDG = mcTagBFlavor;
218}
219
220void TagVertex::setMCDeltaTau(float mcDeltaTau)
221{
222 m_mcDeltaTau = mcDeltaTau;
223}
224
225void TagVertex::setMCDeltaT(float mcDeltaT)
226{
227 m_mcDeltaT = mcDeltaT;
228}
229
230void TagVertex::setFitType(float FitType)
231{
232 m_FitType = FitType;
233}
234
235void TagVertex::setNTracks(int NTracks)
236{
237 m_NTracks = NTracks;
238}
239
240void TagVertex::setTagVl(float TagVl)
241{
242 m_tagVl = TagVl;
243}
244
245void TagVertex::setTruthTagVl(float TruthTagVl)
246{
247 m_truthTagVl = TruthTagVl;
248}
249
250void TagVertex::setTagVlErr(float TagVlErr)
251{
252 m_tagVlErr = TagVlErr;
253}
254
255void TagVertex::setTagVol(float TagVol)
256{
257 m_tagVol = TagVol;
258}
259
260void TagVertex::setTruthTagVol(float TruthTagVol)
261{
262 m_truthTagVol = TruthTagVol;
263}
264
265void TagVertex::setTagVolErr(float TagVolErr)
266{
267 m_tagVolErr = TagVolErr;
268}
269
270void TagVertex::setTagVNDF(float TagVNDF)
271{
272 m_tagVNDF = TagVNDF;
273}
274
275void TagVertex::setTagVChi2(float TagVChi2)
276{
277 m_tagVChi2 = TagVChi2;
278}
279
280void TagVertex::setTagVChi2IP(float TagVChi2IP)
281{
282 m_tagVChi2IP = TagVChi2IP;
283}
284
285void TagVertex::setVertexFitParticles(const std::vector<const Particle*>& vtxFitParticles)
286{
287 m_vtxFitParticles = vtxFitParticles;
288 m_NFitTracks = vtxFitParticles.size();
289}
290
291void TagVertex::setVertexFitMCParticles(const std::vector<const MCParticle*>& vtxFitMCParticles)
292{
293 m_vtxFitMCParticles = vtxFitMCParticles;
294}
295
296void TagVertex::setRaveWeights(const std::vector<double>& raveWeights)
297{
298 m_raveWeights = raveWeights;
299}
300
301void TagVertex::setConstraintCenter(const B2Vector3D& constraintCenter)
302{
303 m_constraintCenter = constraintCenter;
304}
305
306void TagVertex::setConstraintCov(const TMatrixDSym& constraintCov)
307{
308 m_constraintCov.ResizeTo(constraintCov);
309 m_constraintCov = constraintCov;
310}
311
312void TagVertex::setConstraintType(const std::string& constraintType)
313{
314 m_constraintType = constraintType;
315}
316
318{
319 TMatrixDSym temp(3);
320 m_tagVertexErrMatrix.ResizeTo(temp);
322}
323
325{
326 TMatrixDSym temp(3);
327 m_constraintCov.ResizeTo(temp);
328 m_constraintCov = temp;
329}
330
331void TagVertex::setFitTruthStatus(int truthStatus)
332{
333 m_fitTruthStatus = truthStatus;
334}
335
337{
338 m_rollbackStatus = backStatus;
339}
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Class to store reconstructed particles.
Definition: Particle.h:75
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
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
static const double realNaN
constant for double NaN
Abstract base class for different kinds of events.