Belle II Software light-2406-ragdoll
MergedConstraint.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/Constraint.h>
12
13namespace TreeFitter {
19 public:
21 typedef std::vector<Constraint*> constraintlist ;
22
26 virtual ~MergedConstraint() {}
28 explicit MergedConstraint(const constraintlist& list) :
29 Constraint(Constraint::merged), m_list(list)
30 {
31 int d = 0;
32 for (constraintlist::iterator it = m_list.begin() ;
33 it != m_list.end(); ++it) d += (*it)->dim() ;
34 setDim(d) ;
35 }
36
37
38
40 virtual ErrCode project(const FitParams& fitpar, Projection& p) const override ;
41
44 {
45 m_list.push_back(c) ;
46 setDim(dim() + c->dim()) ;
47 setNIter(std::max(nIter(), c->nIter())) ;
48 }
49
50
51 private:
54 } ;
55
56}
class to manage the order of constraints and their filtering
Definition: Constraint.h:20
unsigned int dim() const
get dimension of constraint
Definition: Constraint.h:61
void setNIter(unsigned int d)
set max number of iterations for non lin constraint
Definition: Constraint.h:126
void setDim(unsigned int d)
set dimension of constraint
Definition: Constraint.h:123
unsigned int nIter() const
get maximum number of iterations for non in constraint
Definition: Constraint.h:67
abstract errorocode be aware that the default is success
Definition: ErrCode.h:14
Class to store and manage fitparams (statevector)
Definition: FitParams.h:20
Merge multiple constraints that we want to project simultaneously.
MergedConstraint()
empty constructor
constraintlist m_list
list of the constraints to merge
virtual ~MergedConstraint()
destructor
MergedConstraint(const constraintlist &list)
constructor with constraint list
virtual ErrCode project(const FitParams &fitpar, Projection &p) const override
project the constraints
void push_back(Constraint *c)
push back a new constraint
std::vector< Constraint * > constraintlist
typedef of a list of constraints
class to store the projected residuals and the corresponding jacobian as well as the covariance matri...
Definition: Projection.h:18