Belle II Software  release-06-01-15
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 
24  bool massconstraint = false);
25 
27  virtual ~RecoComposite() {};
28 
30  virtual ErrCode initParticleWithMother(FitParams& fitparams) override;
31 
33  virtual ErrCode initMotherlessParticle(FitParams& fitparams) override;
34 
36  void updateParams();
37 
39  ErrCode projectRecoComposite(const FitParams& fitparams, Projection& p) const;
40 
42  int dimMeas() const { return m_hasEnergy ? 7 : 6 ; }
43 
45  virtual int dim() const override { return m_hasEnergy ? 8 : 7 ; }// (x,y,z,t,px,py,pz,(E))
46 
48  int dimM() const { return m_hasEnergy ? 7 : 6 ; }
49 
51  virtual ErrCode projectConstraint(Constraint::Type, const FitParams&, Projection&) const override ;
52 
54  virtual int type() const override { return kRecoComposite ; }
55 
57  virtual int posIndex() const override { return index() ; }
58 
60  virtual int tauIndex() const override { return index() + 3 ; }
61 
63  virtual int momIndex() const override { return index() + 4 ; }
64 
66  virtual bool hasEnergy() const override { return m_hasEnergy ; }
67 
69  virtual bool hasPosition() const override { return true ; }
70 
72  virtual void addToConstraintList(constraintlist& alist, int depth) const override
73  {
74  alist.push_back(Constraint(this, Constraint::composite, depth, dimM())) ;
75  alist.push_back(Constraint(this, Constraint::geometric, depth, 3)) ;
76  if (m_massconstraint) {
77  alist.push_back(Constraint(this, Constraint::mass, depth, 1, 3));
78  }
79  }
80 
81  protected:
82 
84  Eigen::Matrix<double, 7, 1> m_params;
85 
87  Eigen::Matrix < double, -1, -1, 0, 7, 7 > m_covariance;
88 
91 
94  };
95 }
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
const ParticleBase * mother() const
getMother() / hasMother()
std::vector< Constraint > constraintlist
alias
Definition: ParticleBase.h:56
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:42
virtual bool hasPosition() const override
return true FIXME
Definition: RecoComposite.h:69
int dimM() const
get dimension of measurement
Definition: RecoComposite.h:48
virtual int tauIndex() const override
get tau (lifetime) index in statevector
Definition: RecoComposite.h:60
virtual int dim() const override
get dimension of constraint
Definition: RecoComposite.h:45
ErrCode projectRecoComposite(const FitParams &fitparams, Projection &p) const
project this particle constraint
virtual ~RecoComposite()
destructor
Definition: RecoComposite.h:27
void updateParams()
update changed params
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:84
virtual int momIndex() const override
get momentum index in statevector
Definition: RecoComposite.h:63
Eigen::Matrix< double, -1, -1, 0, 7, 7 > m_covariance
only lower triangle filled!
Definition: RecoComposite.h:87
virtual int type() const override
get ype
Definition: RecoComposite.h:54
virtual bool hasEnergy() const override
return of this constraint/particle has an energy component
Definition: RecoComposite.h:66
virtual void addToConstraintList(constraintlist &alist, int depth) const override
add this to list
Definition: RecoComposite.h:72
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:57
RecoComposite(Belle2::Particle *bc, const ParticleBase *mother)
constructor