Belle II Software  light-2212-foldex
RecoComposite.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 namespace TreeFitter {
14 
16  class RecoComposite : public ParticleBase {
17 
18  public:
21  bool massconstraint = false);
22 
24  virtual ~RecoComposite() {};
25 
27  virtual ErrCode initParticleWithMother(FitParams& fitparams) override;
28 
30  virtual ErrCode initMotherlessParticle(FitParams& fitparams) override;
31 
33  void updateParams();
34 
36  ErrCode projectRecoComposite(const FitParams& fitparams, Projection& p) const;
37 
39  int dimMeas() const { return m_hasEnergy ? 7 : 6 ; }
40 
42  virtual int dim() const override { return m_hasEnergy ? 8 : 7 ; }// (x,y,z,t,px,py,pz,(E))
43 
45  int dimM() const { return m_hasEnergy ? 7 : 6 ; }
46 
48  virtual ErrCode projectConstraint(Constraint::Type, const FitParams&, Projection&) const override ;
49 
51  virtual int type() const override { return kRecoComposite ; }
52 
54  virtual int posIndex() const override { return index() ; }
55 
57  virtual int tauIndex() const override { return index() + 3 ; }
58 
60  virtual int momIndex() const override { return index() + 4 ; }
61 
63  virtual bool hasEnergy() const override { return m_hasEnergy ; }
64 
66  virtual bool hasPosition() const override { return true ; }
67 
69  virtual void addToConstraintList(constraintlist& alist, int depth) const override
70  {
71  alist.push_back(Constraint(this, Constraint::composite, depth, dimM())) ;
72  alist.push_back(Constraint(this, Constraint::geometric, depth, 3)) ;
73  if (m_massconstraint) {
74  alist.push_back(Constraint(this, Constraint::mass, depth, 1, 3));
75  }
76  }
77 
78  protected:
79 
81  Eigen::Matrix<double, 7, 1> m_params;
82 
84  Eigen::Matrix < double, -1, -1, 0, 7, 7 > m_covariance;
85 
88 
91  };
92 }
Class to store reconstructed particles.
Definition: Particle.h:74
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:99
std::vector< Constraint > constraintlist
alias
Definition: ParticleBase.h:56
const ParticleBase * mother() const
getMother() / hasMother()
Definition: ParticleBase.h:102
class to store the projected residuals and the corresponding jacobian as well as the covariance matri...
Definition: Projection.h:18
A class for composite particles.
Definition: RecoComposite.h:16
int dimMeas() const
dimension of the measurement vector
Definition: RecoComposite.h:39
virtual bool hasPosition() const override
return true FIXME
Definition: RecoComposite.h:66
int dimM() const
get dimension of measurement
Definition: RecoComposite.h:45
virtual int tauIndex() const override
get tau (lifetime) index in statevector
Definition: RecoComposite.h:57
virtual int dim() const override
get dimension of constraint
Definition: RecoComposite.h:42
ErrCode projectRecoComposite(const FitParams &fitparams, Projection &p) const
project this particle constraint
virtual ~RecoComposite()
destructor
Definition: RecoComposite.h:24
void updateParams()
update changed params
RecoComposite(Belle2::Particle *bc, const ParticleBase *mother, const ConstraintConfiguration &config, bool massconstraint=false)
constructor
virtual ErrCode projectConstraint(Constraint::Type, const FitParams &, Projection &) const override
project this constraint
Eigen::Matrix< double, 7, 1 > m_params
column vector to store the measurement
Definition: RecoComposite.h:81
virtual int momIndex() const override
get momentum index in statevector
Definition: RecoComposite.h:60
Eigen::Matrix< double, -1, -1, 0, 7, 7 > m_covariance
only lower triangle filled!
Definition: RecoComposite.h:84
virtual int type() const override
get ype
Definition: RecoComposite.h:51
virtual bool hasEnergy() const override
return of this constraint/particle has an energy component
Definition: RecoComposite.h:63
virtual void addToConstraintList(constraintlist &alist, int depth) const override
add this to list
Definition: RecoComposite.h:69
virtual ErrCode initParticleWithMother(FitParams &fitparams) override
init particle in case it has a mother
virtual ErrCode initMotherlessParticle(FitParams &fitparams) override
init particle in case it has no mother
virtual int posIndex() const override
get position index in statevectof x,y,z,tau,px,py,pz
Definition: RecoComposite.h:54