Belle II Software development
Composite.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
13namespace TreeFitter {
14
17 class Composite : public ParticleBase {
18
19 public:
22 bool massconstraint = false);
23
25 virtual ~Composite() {};
26
28 virtual ErrCode initParticleWithMother(FitParams& fitparams) override;
29
31 virtual ErrCode initMotherlessParticle(FitParams& fitparams) override;
32
34 void updateParams();
35
37 ErrCode projectComposite(const FitParams& fitparams, Projection& p) const;
38
40 int dimMeas() const { return m_hasEnergy ? 7 : 6 ; }
41
43 virtual int dim() const override { return m_hasEnergy ? 8 : 7 ; }// (x,y,z,t,px,py,pz,(E))
44
46 int dimM() const { return m_hasEnergy ? 7 : 6 ; }
47
49 virtual ErrCode projectConstraint(Constraint::Type, const FitParams&, Projection&) const override ;
50
52 virtual int type() const override { return kComposite ; }
53
55 virtual int posIndex() const override { return index() ; }
56
58 virtual int tauIndex() const override { return index() + 3 ; }
59
61 virtual int momIndex() const override { return index() + 4 ; }
62
64 virtual bool hasEnergy() const override { return m_hasEnergy ; }
65
67 virtual bool hasPosition() const override { return true ; }
68
70 virtual void addToConstraintList(constraintlist& alist, int depth) const override
71 {
72 alist.push_back(Constraint(this, Constraint::composite, depth, dimM())) ;
73 alist.push_back(Constraint(this, Constraint::geometric, depth, 3)) ;
74 if (m_massconstraint) {
75 alist.push_back(Constraint(this, Constraint::mass, depth, 1, 3));
76 }
77 }
78
79 protected:
80
82 Eigen::Matrix<double, 7, 1> m_params;
83
85 Eigen::Matrix < double, -1, -1, 0, 7, 7 > m_covariance;
86
89
92 };
93}
Class to store reconstructed particles.
Definition: Particle.h:75
A class for composite particles, where the daughters must be ignored by the fitter.
Definition: Composite.h:17
int dimMeas() const
dimension of the measurement vector
Definition: Composite.h:40
virtual bool hasPosition() const override
return true FIXME
Definition: Composite.h:67
virtual ~Composite()
destructor
Definition: Composite.h:25
int dimM() const
get dimension of measurement
Definition: Composite.h:46
virtual int tauIndex() const override
get tau (lifetime) index in statevector
Definition: Composite.h:58
virtual int dim() const override
get dimension of constraint
Definition: Composite.h:43
void updateParams()
update changed params
Definition: Composite.cc:43
virtual ErrCode projectConstraint(Constraint::Type, const FitParams &, Projection &) const override
project this constraint
Definition: Composite.cc:97
bool m_massconstraint
flag
Definition: Composite.h:91
Eigen::Matrix< double, 7, 1 > m_params
column vector to store the measurement
Definition: Composite.h:82
virtual int momIndex() const override
get momentum index in statevector
Definition: Composite.h:61
Eigen::Matrix< double, -1, -1, 0, 7, 7 > m_covariance
only lower triangle filled!
Definition: Composite.h:85
virtual int type() const override
get ype
Definition: Composite.h:52
virtual bool hasEnergy() const override
return of this constraint/particle has an energy component
Definition: Composite.h:64
virtual void addToConstraintList(constraintlist &alist, int depth) const override
add this to list
Definition: Composite.h:70
virtual ErrCode initParticleWithMother(FitParams &fitparams) override
init particle in case it has a mother
Definition: Composite.cc:26
bool m_hasEnergy
flag
Definition: Composite.h:88
virtual ErrCode initMotherlessParticle(FitParams &fitparams) override
init particle in case it has no mother
Definition: Composite.cc:31
ErrCode projectComposite(const FitParams &fitparams, Projection &p) const
project this particle constraint
Definition: Composite.cc:75
virtual int posIndex() const override
get position index in statevectof x,y,z,tau,px,py,pz
Definition: Composite.h:55
constraint configuration class
class to manage the order of constraints and their filtering
Definition: Constraint.h:20
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
base class for all particles
Definition: ParticleBase.h:25
int index() const
get index
Definition: ParticleBase.h:95
const ParticleBase * mother() const
getMother() / hasMother()
Definition: ParticleBase.h:98
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