Belle II Software  release-05-02-19
BaseConstraint.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * See https://github.com/tferber/OrcaKinfit, forked from *
4  * https://github.com/iLCSoft/MarlinKinfit *
5  * *
6  * Further information about the fit engine and the user interface *
7  * provided in MarlinKinfit can be found at *
8  * https://www.desy.de/~blist/kinfit/doc/html/ *
9  * and in the LCNotes LC-TOOL-2009-001 and LC-TOOL-2009-004 available *
10  * from http://www-flc.desy.de/lcnotes/ *
11  * *
12  * Adopted by: Torben Ferber (torben.ferber@desy.de) (TF) *
13  * *
14  * This software is provided "as is" without any warranty. *
15  **************************************************************************/
16 
17 #ifndef __BASECONSTRAINT_H
18 #define __BASECONSTRAINT_H
19 
20 #include <iostream>
21 
22 namespace Belle2 {
28  namespace OrcaKinFit {
29 
30  class BaseFitObject;
31 
32 // Class BaseConstraint:
34 
71  class BaseConstraint {
72  public:
75 
77  BaseConstraint(const BaseConstraint& rhs
78  );
81  );
82 
84  virtual ~BaseConstraint();
85 
87  virtual double getValue() const = 0;
88 
90  virtual double getError() const;
91 
93  virtual const char* getName() const;
95  void setName(const char* name_);
96 
99  virtual void getDerivatives(int idim,
100  double der[]
101  ) const = 0;
102 
104  virtual std::ostream& print(std::ostream& os
105  ) const;
106 
107  protected:
108  char* name;
109  };
110 
114  inline std::ostream& operator<< (std::ostream& os,
115  const BaseConstraint& bc
116  )
117  {
118  return bc.print(os);
119  }
120 
121  }// end OrcaKinFit namespace
123 } // end Belle2 namespace
124 
125 
126 #endif // __BASECONSTRAINT_H
Belle2::OrcaKinFit::BaseConstraint::getName
virtual const char * getName() const
Returns the name of the constraint.
Definition: BaseConstraint.cc:70
Belle2::operator<<
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Definition: IntervalOfValidity.cc:196
Belle2::OrcaKinFit::BaseConstraint::operator=
BaseConstraint & operator=(const BaseConstraint &rhs)
Assignment.
Definition: BaseConstraint.cc:56
Belle2::OrcaKinFit::BaseConstraint::BaseConstraint
BaseConstraint()
Creates an empty BaseConstraint object.
Definition: BaseConstraint.cc:44
Belle2::OrcaKinFit::BaseConstraint::setName
void setName(const char *name_)
Set object's name.
Definition: BaseConstraint.cc:75
Belle2::OrcaKinFit::BaseConstraint
Abstract base class for constraints of kinematic fits.
Definition: BaseConstraint.h:85
Belle2::OrcaKinFit::BaseConstraint::print
virtual std::ostream & print(std::ostream &os) const
print object to ostream
Definition: BaseConstraint.cc:90
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::OrcaKinFit::BaseConstraint::getValue
virtual double getValue() const =0
Returns the value of the constraint function.
Belle2::OrcaKinFit::BaseConstraint::~BaseConstraint
virtual ~BaseConstraint()
Virtual destructor.
Definition: BaseConstraint.cc:65
Belle2::OrcaKinFit::BaseConstraint::getError
virtual double getError() const
Returns the error on the value of the constraint.
Definition: BaseConstraint.cc:84
Belle2::OrcaKinFit::BaseConstraint::getDerivatives
virtual void getDerivatives(int idim, double der[]) const =0
Get first order derivatives of the constraint function Call this with a predefined array "der" with t...