Belle II Software  release-05-02-19
Projection.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributor: Wouter Hulsbergen, Francesco Tenchini, Jo-Frederik Krohn *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <analysis/VertexFitting/TreeFitter/EigenStackConfig.h>
13 
14 #include <Eigen/Dense>
15 
16 namespace TreeFitter {
17 
19  class Projection {
20 
21  public:
22 
24  Projection(int dimP, int dimC);
25 
27  virtual ~Projection() {};
28 
30  Eigen::Matrix < double, -1, -1, 0, 5, MAX_MATRIX_SIZE > & getH() {return m_H;}
31 
33  const Eigen::Matrix < double, -1, -1, 0, 5, MAX_MATRIX_SIZE > getH() const {return m_H;}
34 
36  Eigen::Matrix < double, -1, 1, 0, 5, 1 > & getResiduals() {return m_residual;}
37 
39  const Eigen::Matrix < double, -1, 1, 0, 5, 1 > getResiduals() const {return m_residual;}
40 
42  double getElementInResiduals(int row) { return m_residual(m_offset + row, 1); }
43 
45  Eigen::Matrix < double, -1, -1, 0, 5, 5 > & getV() {return m_V;}
46 
48  const Eigen::Matrix < double, -1, -1, 0, 5, 5 > & getV() const {return m_V;}
49 
51  void resetProjection();
52 
54  unsigned int getOffset() { return m_offset; }
55 
57  void incrementOffset(unsigned int i) { m_offset += i; }
58 
60  unsigned int offset() const { return m_offset; }
61 
63  int getDim() const { return m_dimProj; }
64 
66  int getDimCov() const { return m_dimCov; }
67  private:
68 
70  Eigen::Matrix < double, -1, -1, 0, 5, MAX_MATRIX_SIZE > m_H;
71 
73  Eigen::Matrix < double, -1, -1, 0, 5, 5 > m_V;
74 
76  Eigen::Matrix < double, -1, 1, 0, 5, 1 > m_residual;
77 
79  int m_dimCov;
80 
82  int m_dimProj;
83 
85  unsigned int m_offset;
86  };
87 }
TreeFitter::Projection::m_residual
Eigen::Matrix< double, -1, 1, 0, 5, 1 > m_residual
residuals of constraint
Definition: Projection.h:92
TreeFitter::Projection::m_dimCov
int m_dimCov
dimension of the covariance
Definition: Projection.h:95
TreeFitter::Projection::getH
Eigen::Matrix< double, -1, -1, 0, 5, MAX_MATRIX_SIZE > & getH()
get projection matrix
Definition: Projection.h:46
TreeFitter::Projection::getV
Eigen::Matrix< double, -1, -1, 0, 5, 5 > & getV()
get residuals cov matrix
Definition: Projection.h:61
TreeFitter::Projection::getElementInResiduals
double getElementInResiduals(int row)
ge element in residuals
Definition: Projection.h:58
TreeFitter::Projection::getResiduals
Eigen::Matrix< double, -1, 1, 0, 5, 1 > & getResiduals()
get residuals
Definition: Projection.h:52
TreeFitter::Projection::getDim
int getDim() const
get size
Definition: Projection.h:79
TreeFitter::Projection::m_offset
unsigned int m_offset
offset for constraint index.
Definition: Projection.h:101
TreeFitter::Projection::m_H
Eigen::Matrix< double, -1, -1, 0, 5, MAX_MATRIX_SIZE > m_H
jacobian of the constraint, converts x,p,E<->system of residuals
Definition: Projection.h:86
TreeFitter::Projection::m_dimProj
int m_dimProj
dimension of H
Definition: Projection.h:98
TreeFitter::Projection::getDimCov
int getDimCov() const
get size
Definition: Projection.h:82
TreeFitter::Projection::offset
unsigned int offset() const
get offset
Definition: Projection.h:76
TreeFitter::Projection::incrementOffset
void incrementOffset(unsigned int i)
increment offset
Definition: Projection.h:73
TreeFitter::Projection::getOffset
unsigned int getOffset()
get offset (for mergedcosntraints)
Definition: Projection.h:70
TreeFitter::Projection::m_V
Eigen::Matrix< double, -1, -1, 0, 5, 5 > m_V
covariance matrix of this constraint (r')
Definition: Projection.h:89
TreeFitter::Projection::Projection
Projection(int dimP, int dimC)
constructor
Definition: Projection.cc:26
TreeFitter::Projection::~Projection
virtual ~Projection()
destructor
Definition: Projection.h:43
TreeFitter::Projection::resetProjection
void resetProjection()
reset projection
Definition: Projection.cc:34