Belle II Software development
Origin.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * External Contributor: Wouter Hulsbergen *
5 * *
6 * See git log for contributors and copyright holders. *
7 * This file is licensed under LGPL-3.0, see LICENSE.md. *
8 **************************************************************************/
9#pragma once
10
11#include <analysis/VertexFitting/TreeFitter/ParticleBase.h>
12
13#include <mdst/dbobjects/BeamSpot.h>
14#include <framework/database/DBObjPtr.h>
15
16#include <Eigen/Core>
17
18namespace TreeFitter {
19
21 class Origin : public ParticleBase {
22
23 public:
24
27 const ConstraintConfiguration& config,
28 const bool forceFitAll
29 );
30
32 explicit Origin(Belle2::Particle* daughter);
33
35 virtual ~Origin() {};
36
38 virtual ErrCode initParticleWithMother(FitParams& fitparams) override;
39
41 virtual ErrCode initMotherlessParticle(FitParams& fitparams) override;
42
45
47 virtual int dim() const override { return m_constraintDimension; }
48
50 virtual ErrCode initCovariance(FitParams& fitpar) const override;
51
52 /* particle type */
53 virtual int type() const override { return kOrigin; }
54
57
59 virtual ErrCode projectConstraint(Constraint::Type, const FitParams&, Projection&) const override;
60
62 virtual void addToConstraintList(constraintlist& list, int depth) const override;
63
65 virtual int posIndex() const override { return index(); }
66
68 virtual int momIndex() const override { return -1; }
69
71 virtual int tauIndex() const override { return -1; }
72
74 virtual bool hasEnergy() const override { return false; }
75
77 virtual std::string name() const { return "Origin"; }
78
79 private:
80
83
85 const std::vector<double> m_customOriginVertex;
86
88 const std::vector<double> m_customOriginCovariance;
89
91 Eigen::Matrix<double, Eigen::Dynamic, 1, Eigen::ColMajor, 3, 1> m_posVec;
92
96 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 3, 3> m_covariance;
97
99 const bool m_isBeamSpot;
100
103
106 };
107}
Class for accessing objects in the database.
Definition DBObjPtr.h:21
Class to store reconstructed particles.
Definition Particle.h:76
Type
type of constraints the order of these constraints is important: it is the order in which they are ap...
Definition Constraint.h:27
abstract errorocode be aware that the default is success
Definition ErrCode.h:14
Class to store and manage fitparams (statevector)
Definition FitParams.h:20
ErrCode projectOriginConstraint(const FitParams &fitpar, Projection &) const
the actual constraint projection
Definition Origin.cc:126
const int m_constraintDimension
dimension of the constraint
Definition Origin.h:82
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
Definition Origin.h:96
const std::vector< double > m_customOriginVertex
vertex coordinates
Definition Origin.h:85
virtual ErrCode initCovariance(FitParams &fitpar) const override
init covariance matrix of the constraint
Definition Origin.cc:113
virtual int tauIndex() const override
the lifetime index.
Definition Origin.h:71
virtual int dim() const override
space reserved in fit pars
Definition Origin.h:47
virtual ErrCode projectConstraint(Constraint::Type, const FitParams &, Projection &) const override
the abstract projection
Definition Origin.cc:145
virtual std::string name() const
get name
Definition Origin.h:77
virtual int momIndex() const override
momentum index in the statevector.
Definition Origin.h:68
ErrCode initOrigin()
init the origin "particle"
Definition Origin.cc:57
virtual int type() const override
get particle type
Definition Origin.h:53
virtual bool hasEnergy() const override
has energy
Definition Origin.h:74
const std::vector< double > m_customOriginCovariance
vertex covariance
Definition Origin.h:88
Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor, 3, 1 > m_posVec
vertex position of the origin
Definition Origin.h:91
Origin(Belle2::Particle *particle, const ConstraintConfiguration &config, const bool forceFitAll)
Constructor.
Definition Origin.cc:21
virtual ErrCode initParticleWithMother(FitParams &fitparams) override
init particle, used if it has a mother
Definition Origin.cc:38
virtual void addToConstraintList(constraintlist &list, int depth) const override
adds the origin as a particle to the constraint list
Definition Origin.cc:158
virtual ErrCode initMotherlessParticle(FitParams &fitparams) override
init particle, used if it has no mother
Definition Origin.cc:43
virtual int posIndex() const override
vertex position index in the statevector
Definition Origin.h:65
Origin(Belle2::Particle *daughter)
Constructor.
const bool m_isBeamSpot
is this the beam constraint?
Definition Origin.h:99
virtual ~Origin()
destructor
Definition Origin.h:35
Belle2::DBObjPtr< Belle2::BeamSpot > m_beamSpot
the parameters are initialize elsewhere this is just a pointer to that
Definition Origin.h:102
const int m_inflationFactorCovZ
inflated the covariance matrix in z by this number
Definition Origin.h:105
Belle2::Particle * particle() const
get basf2 particle
ParticleBase(Belle2::Particle *particle, const ParticleBase *mother, const ConstraintConfiguration *config=nullptr)
default constructor
int index() const
get index
std::vector< Constraint > constraintlist
alias
class to store the projected residuals and the corresponding jacobian as well as the covariance matri...
Definition Projection.h:18