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#include <analysis/dataobjects/Particle.h>
11
12#include <mdst/dataobjects/TrackFitResult.h>
13#include <mdst/dataobjects/MCParticle.h>
14
15using namespace Belle2;
16
17static const double realNaN = std::numeric_limits<double>::quiet_NaN();
18static const ROOT::Math::XYZVector vecNaN(realNaN, realNaN, realNaN);
19
20ROOT::Math::XYZVector TagVertex::getTagVertex() const
21{
22 return m_tagVertex;
23}
24
26{
28}
29
31{
32 return m_tagVertexPval;
33}
34
35const Particle* TagVertex::getVtxFitParticle(unsigned int trackIndex) const
36{
37 if (trackIndex >= m_vtxFitParticles.size())
38 return 0;
39 return m_vtxFitParticles.at(trackIndex);
40}
41
42const MCParticle* TagVertex::getVtxFitMCParticle(unsigned int trackIndex) const
43{
44 if (trackIndex >= m_vtxFitMCParticles.size())
45 return 0;
46 return m_vtxFitMCParticles.at(trackIndex);
47}
48
50{
51 return m_deltaT;
52}
53
55{
56 return m_deltaTErr;
57}
58
59ROOT::Math::XYZVector TagVertex::getMCTagVertex() const
60{
61 return m_mcTagV;
62}
63
65{
66 return m_mcPDG;
67}
68
70{
71 return m_mcDeltaTau;
72}
73
75{
76 return m_mcDeltaT;
77}
78
80{
81 return m_FitType;
82}
83
85{
86 return m_constraintType;
87}
88
89ROOT::Math::XYZVector TagVertex::getConstraintCenter() const
90{
91 if (m_constraintType == "noConstraint") return vecNaN;
92 return m_constraintCenter;
93}
94
95TMatrixDSym TagVertex::getConstraintCov() const
96{
97 return m_constraintCov;
98}
99
101{
102 return m_NTracks;
103}
104
106{
107 return m_NFitTracks;
108}
109
111{
112 return m_tagVl;
113}
114
116{
117 return m_truthTagVl;
118}
119
121{
122 return m_tagVlErr;
123}
124
126{
127 return m_tagVol;
128}
129
131{
132 return m_truthTagVol;
133}
134
136{
137 return m_tagVolErr;
138}
139
141{
142 return m_tagVNDF;
143}
144
146{
147 return m_tagVChi2;
148}
149
151{
152 return m_tagVChi2IP;
153}
154
155ROOT::Math::XYZVector TagVertex::getVtxFitTrackP(unsigned int trackIndex) const
156{
157 if (m_vtxFitParticles.size() <= trackIndex) return ROOT::Math::XYZVector(realNaN, realNaN, realNaN);
158 return m_vtxFitParticles.at(trackIndex)->getMomentum();
159}
160
161double TagVertex::getVtxFitTrackZ0(unsigned int trackIndex) const
162{
163 if (m_vtxFitParticles.size() <= trackIndex) return realNaN;
164 return m_vtxFitParticles.at(trackIndex)->getTrackFitResult()->getZ0();
165}
166
167double TagVertex::getVtxFitTrackD0(unsigned int trackIndex) const
168{
169 if (m_vtxFitParticles.size() <= trackIndex) return realNaN;
170 return m_vtxFitParticles.at(trackIndex)->getTrackFitResult()->getD0();
171}
172
173double TagVertex::getRaveWeight(unsigned int trackIndex) const
174{
175 if (m_raveWeights.size() <= trackIndex) return realNaN;
176 return m_raveWeights.at(trackIndex);
177}
178
180{
181 return m_fitTruthStatus;
182}
183
185{
186 return m_rollbackStatus;
187}
188
189void TagVertex::setTagVertex(const ROOT::Math::XYZVector& tagVertex)
190{
191 m_tagVertex = tagVertex;
192}
193
194void TagVertex::setTagVertexErrMatrix(const TMatrixDSym& TagVertexErrMatrix)
195{
196 m_tagVertexErrMatrix = TagVertexErrMatrix;
197}
198
199void TagVertex::setTagVertexPval(float TagVertexPval)
200{
201 m_tagVertexPval = TagVertexPval;
202}
203
204void TagVertex::setDeltaT(float DeltaT)
205{
206 m_deltaT = DeltaT;
207}
208
209void TagVertex::setDeltaTErr(float DeltaTErr)
210{
211 m_deltaTErr = DeltaTErr;
212}
213
214void TagVertex::setMCTagVertex(const ROOT::Math::XYZVector& mcTagVertex)
215{
216 m_mcTagV = mcTagVertex;
217}
218
219void TagVertex::setMCTagBFlavor(int mcTagBFlavor)
220{
221 m_mcPDG = mcTagBFlavor;
222}
223
224void TagVertex::setMCDeltaTau(float mcDeltaTau)
225{
226 m_mcDeltaTau = mcDeltaTau;
227}
228
229void TagVertex::setMCDeltaT(float mcDeltaT)
230{
231 m_mcDeltaT = mcDeltaT;
232}
233
234void TagVertex::setFitType(float FitType)
235{
236 m_FitType = FitType;
237}
238
239void TagVertex::setNTracks(int NTracks)
240{
241 m_NTracks = NTracks;
242}
243
244void TagVertex::setTagVl(float TagVl)
245{
246 m_tagVl = TagVl;
247}
248
249void TagVertex::setTruthTagVl(float TruthTagVl)
250{
251 m_truthTagVl = TruthTagVl;
252}
253
254void TagVertex::setTagVlErr(float TagVlErr)
255{
256 m_tagVlErr = TagVlErr;
257}
258
259void TagVertex::setTagVol(float TagVol)
260{
261 m_tagVol = TagVol;
262}
263
264void TagVertex::setTruthTagVol(float TruthTagVol)
265{
266 m_truthTagVol = TruthTagVol;
267}
268
269void TagVertex::setTagVolErr(float TagVolErr)
270{
271 m_tagVolErr = TagVolErr;
272}
273
274void TagVertex::setTagVNDF(float TagVNDF)
275{
276 m_tagVNDF = TagVNDF;
277}
278
279void TagVertex::setTagVChi2(float TagVChi2)
280{
281 m_tagVChi2 = TagVChi2;
282}
283
284void TagVertex::setTagVChi2IP(float TagVChi2IP)
285{
286 m_tagVChi2IP = TagVChi2IP;
287}
288
289void TagVertex::setVertexFitParticles(const std::vector<const Particle*>& vtxFitParticles)
290{
291 m_vtxFitParticles = vtxFitParticles;
292 m_NFitTracks = vtxFitParticles.size();
293}
294
295void TagVertex::setVertexFitMCParticles(const std::vector<const MCParticle*>& vtxFitMCParticles)
296{
297 m_vtxFitMCParticles = vtxFitMCParticles;
298}
299
300void TagVertex::setRaveWeights(const std::vector<double>& raveWeights)
301{
302 m_raveWeights = raveWeights;
303}
304
305void TagVertex::setConstraintCenter(const ROOT::Math::XYZVector& constraintCenter)
306{
307 m_constraintCenter = constraintCenter;
308}
309
310void TagVertex::setConstraintCov(const TMatrixDSym& constraintCov)
311{
312 m_constraintCov.ResizeTo(constraintCov);
313 m_constraintCov = constraintCov;
314}
315
316void TagVertex::setConstraintType(const std::string& constraintType)
317{
318 m_constraintType = constraintType;
319}
320
322{
323 TMatrixDSym temp(3);
324 m_tagVertexErrMatrix.ResizeTo(temp);
326}
327
329{
330 TMatrixDSym temp(3);
331 m_constraintCov.ResizeTo(temp);
332 m_constraintCov = temp;
333}
334
335void TagVertex::setFitTruthStatus(int truthStatus)
336{
337 m_fitTruthStatus = truthStatus;
338}
339
341{
342 m_rollbackStatus = backStatus;
343}
A Class to store the Monte Carlo particle information.
Definition MCParticle.h:32
Class to store reconstructed particles.
Definition Particle.h:76
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
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
static const double realNaN
This collects the B-meson properties in the hadronic B-decays It is used for the Ecms calibration in ...
Abstract base class for different kinds of events.