CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TFitConstraintMGaus Class Reference

#include <TFitConstraintMGaus.h>

Inheritance diagram for TFitConstraintMGaus:
TFitConstraintM TAbsFitConstraint

Public Member Functions

Double_t getCurrentValue () override
 
TMatrixD * getDerivativeAlpha () override
 
TString getInfoString () override
 
Double_t getInitValue () override
 
void print () override
 
void setMassConstraint (Double_t Mass, Double_t Width)
 
 TFitConstraintMGaus ()
 
 TFitConstraintMGaus (std::vector< TAbsFitParticle *> *ParList1, std::vector< TAbsFitParticle *> *ParList2, Double_t Mass=0, Double_t Width=0)
 
 TFitConstraintMGaus (const TString &name, const TString &title, std::vector< TAbsFitParticle *> *ParList1, std::vector< TAbsFitParticle *> *ParList2, Double_t Mass=0, Double_t Width=0)
 
 ~TFitConstraintMGaus () override
 
- Public Member Functions inherited from TFitConstraintM
void addParticle1 (TAbsFitParticle *particle)
 
void addParticle2 (TAbsFitParticle *particle)
 
void addParticles1 (TAbsFitParticle *p1, TAbsFitParticle *p2=nullptr, TAbsFitParticle *p3=nullptr, TAbsFitParticle *p4=nullptr, TAbsFitParticle *p5=nullptr, TAbsFitParticle *p6=nullptr, TAbsFitParticle *p7=nullptr, TAbsFitParticle *p8=nullptr, TAbsFitParticle *p9=nullptr, TAbsFitParticle *p10=nullptr)
 
void addParticles2 (TAbsFitParticle *p1, TAbsFitParticle *p2=nullptr, TAbsFitParticle *p3=nullptr, TAbsFitParticle *p4=nullptr, TAbsFitParticle *p5=nullptr, TAbsFitParticle *p6=nullptr, TAbsFitParticle *p7=nullptr, TAbsFitParticle *p8=nullptr, TAbsFitParticle *p9=nullptr, TAbsFitParticle *p10=nullptr)
 
Double_t CalcMass (std::vector< TAbsFitParticle *> *List, Bool_t IniVal)
 
TMatrixD * getDerivative (TAbsFitParticle *particle) override
 
Bool_t OnList (std::vector< TAbsFitParticle *> *List, TAbsFitParticle *particle)
 
void setMassConstraint (Double_t Mass)
 
 TFitConstraintM ()
 
 TFitConstraintM (std::vector< TAbsFitParticle *> *ParList1, std::vector< TAbsFitParticle *> *ParList2, Double_t Mass=0)
 
 TFitConstraintM (const TString &name, const TString &title, std::vector< TAbsFitParticle *> *ParList1, std::vector< TAbsFitParticle *> *ParList2, Double_t Mass=0)
 
 ~TFitConstraintM () override
 
- Public Member Functions inherited from TAbsFitConstraint
virtual void applyDeltaAlpha (TMatrixD *corrMatrix)
 
virtual const TMatrixD * getCovMatrix () const
 
virtual const TMatrixD * getCovMatrixDeltaAlpha ()
 
virtual const TMatrixD * getCovMatrixFit () const
 
Int_t getNPar ()
 
const TMatrixD * getParCurr ()
 
const TMatrixD * getParIni ()
 
virtual void reset ()
 
virtual void setCovMatrix (const TMatrixD *theCovMatrix)
 
virtual void setCovMatrixFit (const TMatrixD *theCovMatrixFit)
 
void setParIni (const TMatrixD *parini)
 
 TAbsFitConstraint ()
 
 TAbsFitConstraint (const TString &name, const TString &title)
 
 ~TAbsFitConstraint () override
 

Protected Member Functions

void init ()
 
- Protected Member Functions inherited from TAbsFitConstraint
void calcCovMatrixDeltaAlpha ()
 

Protected Attributes

Double_t _width
 
- Protected Attributes inherited from TFitConstraintM
std::vector< TAbsFitParticle * > _ParList1
 
std::vector< TAbsFitParticle * > _ParList2
 
Double_t _TheMassConstraint
 
- Protected Attributes inherited from TAbsFitConstraint
TMatrixD _covMatrix
 
TMatrixD _covMatrixDeltaAlpha
 
TMatrixD _covMatrixFit
 
TMatrixD _iniparameters
 
Int_t _nPar
 
TMatrixD _parameters
 

Detailed Description

Definition at line 10 of file TFitConstraintMGaus.h.

Constructor & Destructor Documentation

◆ TFitConstraintMGaus() [1/3]

TFitConstraintMGaus::TFitConstraintMGaus ( )

Definition at line 21 of file TFitConstraintMGaus.cc.

References init().

◆ TFitConstraintMGaus() [2/3]

TFitConstraintMGaus::TFitConstraintMGaus ( std::vector< TAbsFitParticle *> *  ParList1,
std::vector< TAbsFitParticle *> *  ParList2,
Double_t  Mass = 0,
Double_t  Width = 0 
)

◆ TFitConstraintMGaus() [3/3]

TFitConstraintMGaus::TFitConstraintMGaus ( const TString &  name,
const TString &  title,
std::vector< TAbsFitParticle *> *  ParList1,
std::vector< TAbsFitParticle *> *  ParList2,
Double_t  Mass = 0,
Double_t  Width = 0 
)

◆ ~TFitConstraintMGaus()

TFitConstraintMGaus::~TFitConstraintMGaus ( )
override

Definition at line 54 of file TFitConstraintMGaus.cc.

54 {}

Member Function Documentation

◆ getCurrentValue()

Double_t TFitConstraintMGaus::getCurrentValue ( )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 82 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_parameters, TFitConstraintM::_ParList1, TFitConstraintM::_ParList2, TFitConstraintM::_TheMassConstraint, and TFitConstraintM::CalcMass().

Referenced by getInfoString().

82  {
83  // Get value of constraint after the fit
84 
85  Double_t CurrentValue =
86  CalcMass(&_ParList1, false) - CalcMass(&_ParList2, false) - _parameters(0, 0) * _TheMassConstraint;
87 
88  return CurrentValue;
89 }
Double_t CalcMass(std::vector< TAbsFitParticle *> *List, Bool_t IniVal)
Double_t _TheMassConstraint
std::vector< TAbsFitParticle * > _ParList1
std::vector< TAbsFitParticle * > _ParList2

◆ getDerivativeAlpha()

TMatrixD * TFitConstraintMGaus::getDerivativeAlpha ( )
overridevirtual

Reimplemented from TAbsFitConstraint.

Definition at line 91 of file TFitConstraintMGaus.cc.

References TFitConstraintM::_TheMassConstraint.

91  {
92  // Calculate dF/dAlpha = -1 * M
93 
94  TMatrixD* DerivativeMatrix = new TMatrixD(1, 1);
95  DerivativeMatrix->Zero();
96 
97  (*DerivativeMatrix)(0, 0) = -1. * _TheMassConstraint;
98 
99  return DerivativeMatrix;
100 }
Double_t _TheMassConstraint

◆ getInfoString()

TString TFitConstraintMGaus::getInfoString ( )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 102 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_iniparameters, TAbsFitConstraint::_parameters, TFitConstraintM::_TheMassConstraint, _width, getCurrentValue(), getInitValue(), and info().

Referenced by print().

102  {
103  // Collect information to be used for printout
104 
105  std::stringstream info;
106  info << std::scientific << std::setprecision(6);
107 
108  info << "__________________________" << std::endl << std::endl;
109  info << "OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << std::endl;
110 
111  info << "initial value: " << getInitValue() << std::endl;
112  info << "current value: " << getCurrentValue() << std::endl;
113  info << "mean mass: " << _TheMassConstraint << std::endl;
114  info << "width: " << _width << std::endl;
115  info << "initial mass: " << _iniparameters(0, 0) * _TheMassConstraint << std::endl;
116  info << "current mass: " << _parameters(0, 0) * _TheMassConstraint << std::endl;
117 
118  return info.str();
119 }
static const TGPicture * info(bool iBackgroundIsBlack)
Double_t getInitValue() override
Double_t getCurrentValue() override
Double_t _TheMassConstraint

◆ getInitValue()

Double_t TFitConstraintMGaus::getInitValue ( )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 73 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_iniparameters, TFitConstraintM::_ParList1, TFitConstraintM::_ParList2, TFitConstraintM::_TheMassConstraint, and TFitConstraintM::CalcMass().

Referenced by getInfoString().

73  {
74  // Get initial value of constraint (before the fit)
75 
76  Double_t InitValue =
78 
79  return InitValue;
80 }
Double_t CalcMass(std::vector< TAbsFitParticle *> *List, Bool_t IniVal)
Double_t _TheMassConstraint
std::vector< TAbsFitParticle * > _ParList1
std::vector< TAbsFitParticle * > _ParList2

◆ init()

void TFitConstraintMGaus::init ( void  )
protected

Definition at line 43 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_iniparameters, TAbsFitConstraint::_nPar, and TAbsFitConstraint::_parameters.

Referenced by TFitConstraintMGaus().

43  {
44  _nPar = 1;
45  _iniparameters.ResizeTo(1, 1);
46  _iniparameters(0, 0) = 1.;
47  _parameters.ResizeTo(1, 1);
49 }

◆ print()

void TFitConstraintMGaus::print ( void  )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 121 of file TFitConstraintMGaus.cc.

References getInfoString().

121  {
122  // Print constraint contents
123 
124  edm::LogVerbatim("KinFitter") << this->getInfoString();
125 }
Log< level::Info, true > LogVerbatim
TString getInfoString() override

◆ setMassConstraint()

void TFitConstraintMGaus::setMassConstraint ( Double_t  Mass,
Double_t  Width 
)

Definition at line 60 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_covMatrix, TFitConstraintM::_TheMassConstraint, _width, Exception, HLTSiStripMonitoring_cff::Mass, TAbsFitConstraint::setCovMatrix(), and DQMGenericTnPClient_cfi::Width.

Referenced by TFitConstraintMGaus().

60  {
62  _width = Width;
63  setCovMatrix(nullptr);
64  if (!Mass)
65  throw cms::Exception("Configuration") << "Error occured!\n"
66  << "Object type : TFitConstraintMGaus\n"
67  << "Object name : " << GetName() << "\n"
68  << "Object title: " << GetTitle() << "\n"
69  << "Mass of 0 GeV not supported, please choose a larger mass!\n";
70  _covMatrix(0, 0) = (Width * Width) / (Mass * Mass);
71 }
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
Double_t _TheMassConstraint

Member Data Documentation

◆ _width

Double_t TFitConstraintMGaus::_width
protected

Definition at line 36 of file TFitConstraintMGaus.h.

Referenced by getInfoString(), and setMassConstraint().