10#include <analysis/VertexFitting/TreeFitter/Origin.h>
11#include <analysis/VertexFitting/TreeFitter/FitParams.h>
12#include <analysis/dataobjects/Particle.h>
13#include <framework/logging/Logger.h>
14#include <framework/geometry/B2Vector3.h>
23 m_constraintDimension(config.m_originDimension),
24 m_customOriginVertex(config.m_customOriginVertex),
25 m_customOriginCovariance(config.m_customOriginCovariance),
26 m_posVec(config.m_originDimension),
27 m_covariance(config.m_originDimension, config.m_originDimension),
28 m_isBeamSpot(config.m_ipConstraint),
29 m_inflationFactorCovZ(config.m_inflationFactorCovZ)
37 return ErrCode(ErrCode::Status::success);
47 status |= daughter->initMotherlessParticle(fitparams);
48 status |= daughter->initParticleWithMother(fitparams);
83 B2FATAL(
"Incorrect dimension of customOriginVertex or customOriginCovariance. customOriginVertex dim = "
86 B2WARNING(
"An element of customOriginCovariance diagonal is smaller than 0.");
87 return ErrCode(ErrCode::Status::badsetup);
104 B2FATAL(
"The Origin is nether beamspot nor custom. This is ether a configuration error or no beam parameters were found to build the beam spot.");
107 return ErrCode(ErrCode::Status::success);
118 status |= daughter->initCovariance(fitpar);
132 p.getH()(row, posindex + row) = -1;
134 for (
int col = 0; col <= row; ++col) {
139 return ErrCode(ErrCode::Status::success);
146 case Constraint::origin:
158 daughter->addToConstraintList(list, depth - 1);
DataType Z() const
access variable Z (= .at(2) without boundary check)
DataType X() const
access variable X (= .at(0) without boundary check)
DataType Y() const
access variable Y (= .at(1) without boundary check)
TMatrixDSym getCovVertex() const
Get the total covariance matrix of theIP position (for compatibility with BeamParameters)
const TVector3 & getIPPosition() const
Get the IP position.
Class to store reconstructed particles.
constraint configuration class
class to manage the order of constraints and their filtering
Type
type of constraints the order of these constraints is important: it is the order in which they are ap...
abstract errorocode be aware that the default is success
Class to store and manage fitparams (statevector)
Eigen::Matrix< double, -1, 1, 0, MAX_MATRIX_SIZE, 1 > & getStateVector()
getter for the fit parameters/statevector
Eigen::Matrix< double, -1, -1, 0, MAX_MATRIX_SIZE, MAX_MATRIX_SIZE > & getCovariance()
getter for the states covariance
ErrCode projectOriginConstraint(const FitParams &fitpar, Projection &) const
the actual constraint projection
const int m_constraintDimension
dimension of the constraint
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 3, 3 > m_covariance
covariance of the origin dont know size but I know the max size
const std::vector< double > m_customOriginVertex
vertex coordinates
virtual ErrCode initCovariance(FitParams &fitpar) const override
init covariance matrix of the constraint
virtual ErrCode projectConstraint(Constraint::Type, const FitParams &, Projection &) const override
the abstract projection
ErrCode initOrigin()
init the origin "particle"
virtual int type() const override
get particle type
const std::vector< double > m_customOriginCovariance
vertex covariance
Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor, 3, 1 > m_posVec
vertex position of the origin
Origin(Belle2::Particle *particle, const ConstraintConfiguration &config, const bool forceFitAll)
Constructor.
virtual ErrCode initParticleWithMother(FitParams &fitparams) override
init particle, used if it has a mother
virtual void addToConstraintList(constraintlist &list, int depth) const override
adds the origin as a particle to the constraint list
virtual ErrCode initMotherlessParticle(FitParams &fitparams) override
init particle, used if it has no mother
virtual int posIndex() const override
vertex position index in the statevector
const bool m_isBeamSpot
is this the beam constraint?
Belle2::DBObjPtr< Belle2::BeamSpot > m_beamSpot
the parameters are initialize elsewhere this is just a pointer to that
const int m_inflationFactorCovZ
inflated the covariance matrix in z by this number
base class for all particles
virtual ParticleBase * addDaughter(Belle2::Particle *, const ConstraintConfiguration &config, bool forceFitAll=false)
add daughter
virtual ErrCode projectConstraint(Constraint::Type, const FitParams &, Projection &) const
project constraint.
std::vector< ParticleBase * > m_daughters
daughter container
std::vector< Constraint > constraintlist
alias
class to store the projected residuals and the corresponding jacobian as well as the covariance matri...