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