Belle II Software  release-06-00-14
RecoResonance.cc
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 
10 
11 #include <analysis/VertexFitting/TreeFitter/RecoResonance.h>
12 #include <analysis/VertexFitting/TreeFitter/FitParams.h>
13 
14 namespace TreeFitter {
15 
17  : RecoComposite(particle, mother) {}
18 
20  {
21  return ErrCode(ErrCode::Status::success);
22  }
23 
25  {
26  const int posindex = posIndex();
27  const int momindex = momIndex();
28 
29  //quick map for parameters
30  int quickindexmap[7];
31  for (int i = 0; i < 3; ++i) {
32  quickindexmap[i] = posindex + i;
33  }
34  for (int i = 0; i < 4; ++i) {
35  quickindexmap[i + 3] = momindex + i;
36  }
37 
38  // copy the 'measurement' -> this overwrites mother position !
39  for (int row = 0; row < dimM(); ++row) {
40  fitparams.getStateVector()(quickindexmap[row]) = m_params[row];
41  }
42  return ErrCode(ErrCode::Status::success);
43  }
44 
46  {
47  ErrCode status;
48  switch (type) {
49  case Constraint::resonance:
50  status |= projectRecoComposite(fitparams, p);
51  break;
52  default:
53  status |= ParticleBase::projectConstraint(type, fitparams, p);
54  }
55  return status;
56  }
57 
58  std::string RecoResonance::parname(int index) const
59  {
60  return ParticleBase::parname(index + 4);
61  }
62 }
Class to store reconstructed particles.
Definition: Particle.h:74
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
Eigen::Matrix< double, -1, 1, 0, MAX_MATRIX_SIZE, 1 > & getStateVector()
getter for the fit parameters/statevector
Definition: FitParams.h:65
base class for all particles
Definition: ParticleBase.h:25
virtual std::string parname(int index) const
get name of parameter i
virtual ErrCode projectConstraint(Constraint::Type, const FitParams &, Projection &) const
project constraint.
int index() const
get index
Definition: ParticleBase.h:99
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 dimM() const
get dimension of measurement
Definition: RecoComposite.h:48
ErrCode projectRecoComposite(const FitParams &fitparams, Projection &p) const
project this particle constraint
Eigen::Matrix< double, 7, 1 > m_params
column vector to store the measurement
Definition: RecoComposite.h:84
virtual std::string parname(int index) const override
parameter name
virtual ErrCode projectConstraint(Constraint::Type, const FitParams &, Projection &) const override
project the constraint
virtual int momIndex() const override
get momentum index in statevector
Definition: RecoResonance.h:46
virtual int type() const override
get type
Definition: RecoResonance.h:40
RecoResonance(Belle2::Particle *bc, const ParticleBase *mother)
constructor
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 statevector x,y,z,tau,px,py,pz
Definition: RecoResonance.h:43