Belle II Software  release-08-01-10
GlobalDerivatives Class Reference

Class for easier manipulation with global derivatives (and their labels) More...

#include <GlobalDerivatives.h>

Public Member Functions

 GlobalDerivatives (int dim=2)
 Constructor for empty derivative matrix and label vector. More...
 
 GlobalDerivatives (const std::pair< std::vector< int >, TMatrixD > &globals)
 Constructor from pair of the vector and the matrix.
 
 GlobalDerivatives (const std::vector< int > &labels, const TMatrixD &derivs)
 constructor from label vector and derivative matrix
 
 operator std::pair< std::vector< int >, TMatrixD > ()
 Convenient operator to allow to pass the object directly from RecoHit to globalDerivatives() WARNING: causes zero labels to be removed.
 
 operator std::vector< int > ()
 Convenient operator to pass only labels (non-zero)
 
 operator TMatrixD ()
 Covenient operator to pass only derivatives (for non-zero labels)
 
const std::vector< int > & getLabels () const
 Get stored lables (includes zeros)
 
const TMatrixD & getDerivatives () const
 Return the derivative matrix (includes columns with zero labels)
 
void add (const std::pair< std::vector< int >, TMatrixD > &globals)
 Add another set of global labels and derivatives.
 
void add (int paramLabel, std::vector< double > dResiduals_dParam)
 Add one parameter - label and the corresponding residual derivative. More...
 
void add (int paramLabel, double drudp)
 Add derivative of local U residual w.r.t. More...
 

Static Public Member Functions

static std::pair< std::vector< int >, TMatrixD > passGlobals (std::pair< std::vector< int >, TMatrixD > globals)
 Static convenient function to remove columns with zero labels (make error in Pede btw.) TODO: refactore interface: return value, params <->
 

Private Attributes

std::pair< std::vector< int >, TMatrixD > m_globals {{}, TMatrixD()}
 The global labels and derivatives matrix.
 

Detailed Description

Class for easier manipulation with global derivatives (and their labels)

Allows to simply add, merge and pass global derivatives matrix and global label vector in RecoHit. For lables = 0 removes given columns from derivative matrix (e.g. save disc space for parameters you do not want to calibrate)

Definition at line 27 of file GlobalDerivatives.h.

Constructor & Destructor Documentation

◆ GlobalDerivatives()

GlobalDerivatives ( int  dim = 2)
inlineexplicit

Constructor for empty derivative matrix and label vector.

Parameters
dimnumber of matrix rows (number of local residuals in virtual plane) Usually 2 (also for 1 dim measurement, u/v selected via precision matrix)

Definition at line 32 of file GlobalDerivatives.h.

32 {m_globals.second.ResizeTo(dim, 0);}
std::pair< std::vector< int >, TMatrixD > m_globals
The global labels and derivatives matrix.

Member Function Documentation

◆ add() [1/2]

void add ( int  paramLabel,
double  drudp 
)

Add derivative of local U residual w.r.t.

global parameter Global derivative versus V residual is set to zero. For (u, v) measurement use add(p, {dru/dp, drv/dp}.

Definition at line 61 of file GlobalDerivatives.cc.

62  {
63  std::vector<double> dResiduals_dParam(m_globals.second.GetNrows(), 0.);
64  dResiduals_dParam.at(0) = drudp;
65  add(paramLabel, dResiduals_dParam);
66  }
void add(const std::pair< std::vector< int >, TMatrixD > &globals)
Add another set of global labels and derivatives.

◆ add() [2/2]

void add ( int  paramLabel,
std::vector< double >  dResiduals_dParam 
)

Add one parameter - label and the corresponding residual derivative.

Parameters
paramLabellabel of the global parameter to calibrate
dResiduals_dParamvector od derivatives of local residual (U, v) versus global parameter

Definition at line 50 of file GlobalDerivatives.cc.


The documentation for this class was generated from the following files: