Belle II Software light-2406-ragdoll
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
16namespace TreeFitter {
17
19 class Origin : public ParticleBase {
20
21 public:
22
25 const ConstraintConfiguration& config,
26 const bool forceFitAll
27 );
28
30 explicit Origin(Belle2::Particle* daughter);
31
33 virtual ~Origin() {};
34
36 virtual ErrCode initParticleWithMother(FitParams& fitparams) override;
37
39 virtual ErrCode initMotherlessParticle(FitParams& fitparams) override;
40
43
45 virtual int dim() const override { return m_constraintDimension; }
46
48 virtual ErrCode initCovariance(FitParams& fitpar) const override;
49
50 /* particle type */
51 virtual int type() const override { return kOrigin; }
52
55
57 virtual ErrCode projectConstraint(Constraint::Type, const FitParams&, Projection&) const override;
58
60 virtual void addToConstraintList(constraintlist& list, int depth) const override;
61
63 virtual int posIndex() const override { return index(); }
64
66 virtual int momIndex() const override { return -1; }
67
69 virtual int tauIndex() const override { return -1; }
70
72 virtual bool hasEnergy() const override { return false; }
73
75 virtual std::string name() const { return "Origin"; }
76
77 private:
78
81
83 const std::vector<double> m_customOriginVertex;
84
86 const std::vector<double> m_customOriginCovariance;
87
89 Eigen::Matrix<double, Eigen::Dynamic, 1, Eigen::ColMajor, 3, 1> m_posVec;
90
94 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 3, 3> m_covariance;
95
97 const bool m_isBeamSpot;
98
101
104 };
105}
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Class to store reconstructed particles.
Definition: Particle.h:75
constraint configuration class
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
representation of the beamspot as a particle
Definition: Origin.h:19
ErrCode projectOriginConstraint(const FitParams &fitpar, Projection &) const
the actual constraint projection
Definition: Origin.cc:123
const int m_constraintDimension
dimension of the constraint
Definition: Origin.h:80
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:94
const std::vector< double > m_customOriginVertex
vertex coordinates
Definition: Origin.h:83
virtual ErrCode initCovariance(FitParams &fitpar) const override
init covariance matrix of the constraint
Definition: Origin.cc:110
virtual int tauIndex() const override
the lifetime index.
Definition: Origin.h:69
virtual int dim() const override
space reserved in fit pars
Definition: Origin.h:45
virtual ErrCode projectConstraint(Constraint::Type, const FitParams &, Projection &) const override
the abstract projection
Definition: Origin.cc:142
virtual std::string name() const
get name
Definition: Origin.h:75
virtual int momIndex() const override
momentum index in the statevector.
Definition: Origin.h:66
ErrCode initOrigin()
init the origin "particle"
Definition: Origin.cc:54
virtual int type() const override
get particle type
Definition: Origin.h:51
virtual bool hasEnergy() const override
has energy
Definition: Origin.h:72
const std::vector< double > m_customOriginCovariance
vertex covariance
Definition: Origin.h:86
Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor, 3, 1 > m_posVec
vertex position of the origin
Definition: Origin.h:89
virtual ErrCode initParticleWithMother(FitParams &fitparams) override
init particle, used if it has a mother
Definition: Origin.cc:35
virtual void addToConstraintList(constraintlist &list, int depth) const override
adds the origin as a particle to the constraint list
Definition: Origin.cc:155
virtual ErrCode initMotherlessParticle(FitParams &fitparams) override
init particle, used if it has no mother
Definition: Origin.cc:40
virtual int posIndex() const override
vertex position index in the statevector
Definition: Origin.h:63
Origin(Belle2::Particle *daughter)
Constructor.
const bool m_isBeamSpot
is this the beam constraint?
Definition: Origin.h:97
virtual ~Origin()
destructor
Definition: Origin.h:33
Belle2::DBObjPtr< Belle2::BeamSpot > m_beamSpot
the parameters are initialize elsewhere this is just a pointer to that
Definition: Origin.h:100
const int m_inflationFactorCovZ
inflated the covariance matrix in z by this number
Definition: Origin.h:103
base class for all particles
Definition: ParticleBase.h:25
Belle2::Particle * particle() const
get basf2 particle
Definition: ParticleBase.h:92
int index() const
get index
Definition: ParticleBase.h:95
std::vector< Constraint > constraintlist
alias
Definition: ParticleBase.h:52
class to store the projected residuals and the corresponding jacobian as well as the covariance matri...
Definition: Projection.h:18