 |
Belle II Software
release-05-02-19
|
10 #include <mdst/dataobjects/TrackFitResult.h>
11 #include <framework/dataobjects/UncertainHelix.h>
12 #include <mdst/dataobjects/HitPatternCDC.h>
13 #include <mdst/dataobjects/HitPatternVXD.h>
15 #include <framework/utilities/HTML.h>
17 #include <boost/math/special_functions/gamma.hpp>
25 m_pdg(0), m_pValue(0),
26 m_hitPatternCDCInitializer(0),
27 m_hitPatternVXDInitializer(0),
35 const TMatrixDSym& covariance,
const short int charge,
38 const uint64_t hitPatternCDCInitializer,
39 const uint32_t hitPatternVXDInitializer,
41 m_pdg(std::abs(particleType.getPDGCode())), m_pValue(pValue),
42 m_hitPatternCDCInitializer(hitPatternCDCInitializer),
43 m_hitPatternVXDInitializer(hitPatternVXDInitializer),
46 UncertainHelix h(position, momentum, charge, bField, covariance, pValue);
55 const TMatrixDSym& cov = h.getCovariance();
56 unsigned int counter = 0;
57 for (
unsigned int i = 0; i <
c_NPars; ++i) {
58 for (
unsigned int j = i; j <
c_NPars; ++j) {
59 m_cov5[counter++] = cov(i, j);
67 const uint64_t hitPatternCDCInitializer,
68 const uint32_t hitPatternVXDInitializer,
70 m_pdg(std::abs(particleType.getPDGCode())), m_pValue(pValue),
71 m_hitPatternCDCInitializer(hitPatternCDCInitializer),
72 m_hitPatternVXDInitializer(hitPatternVXDInitializer),
77 B2FATAL(
"Invalid initializer for TrackFitResult.");
79 for (
unsigned int i = 0; i <
c_NPars; ++i)
98 return std::numeric_limits<double>::infinity();
101 return std::numeric_limits<double>::quiet_NaN();
103 return 2 * boost::math::gamma_q_inv(nDF / 2., pValue);
109 unsigned int counter = 0;
110 for (
unsigned int i = 0; i <
c_NPars; ++i) {
111 for (
unsigned int j = i; j <
c_NPars; ++j) {
112 cov5(i, j) = cov5(j, i) =
m_cov5[counter];
131 std::stringstream out;
132 out <<
"<b>Fit Hypothesis (PDG)</b>: " <<
m_pdg <<
"<br>";
136 out <<
"<b>NDF</b>: " <<
getNDF() <<
"<br>";
138 out <<
"<b>d0</b>: " <<
m_tau[
iD0] <<
" cm <br>";
139 out <<
"<b>phi0</b>: " <<
m_tau[
iPhi0] <<
" rad <br>";
140 out <<
"<b>omega</b>: " <<
m_tau[
iOmega] <<
" 1/GeV<br>";
141 out <<
"<b>z0</b>: " <<
m_tau[
iZ0] <<
" cm <br>";
145 out <<
"<b>pValue</b>: " <<
m_pValue <<
"<br>";
TrackFitResult()
Constructor initializing everything to zero.
int getNDF() const
Getter for number of degrees of freedom of the track fit.
static const unsigned int iTanLambda
Index tan lambda.
This class represents an ideal helix in perigee parameterization including the covariance matrix of t...
static const uint16_t c_NDFFlag
backward compatibility initialisation for NDF
unsigned short getNPXDHits() const
Get total number of hits in the PXD.
Double32_t m_cov5[c_NCovEntries]
The 15 = 5*(5+1)/2 covariance matrix elements.
static const unsigned int iD0
Index for d0.
double getPValue() const
Getter for Chi2 Probability of the track fit.
static const unsigned int c_NCovEntries
Number of covariance entries.
const uint32_t m_hitPatternVXDInitializer
Member for initializing the information about hits in the VXD.
const Double32_t m_pValue
Chi2 Probability of the fit.
HitPatternCDC getHitPatternCDC() const
Getter for the hit pattern in the CDC;.
uint16_t m_NDF
Memeber for number of degrees of freedom.
Abstract base class for different kinds of events.
static const unsigned int iPhi0
Index for phi0.
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
uint64_t m_hitPatternCDCInitializer
Member for initializing the information about hits in the CDC.
double getChi2() const
Get chi2 given NDF and p-value.
HitPatternVXD getHitPatternVXD() const
Getter for the hit pattern in the VXD;.
const unsigned int m_pdg
PDG Code for hypothesis with which the corresponding fit was performed.
TMatrixDSym getCovariance5() const
Getter for covariance matrix of perigee parameters in matrix form.
The ParticleType class for identifying different particle types.
static const unsigned int iOmega
Index for omega.
virtual std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
unsigned short getNHits() const
Get the total Number of CDC hits in the fit.
unsigned short getNSVDHits() const
Get total number of hits in the SVD.
static const unsigned int c_NPars
Number of helix parameters.
Hit pattern of the VXD within a track.
Hit pattern of CDC hits within a track.
Double32_t m_tau[c_NPars]
perigee helix parameters; tau = d0, phi0, omega, z0, tanLambda.
static const unsigned int iZ0
Index for z0.