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::TFitConstraintMGaus ( )

Definition at line 23 of file TFitConstraintMGaus.cc.

References init().

24  : TFitConstraintM()
25 {
26 
27  init();
28 
29 }
TFitConstraintMGaus::TFitConstraintMGaus ( std::vector< TAbsFitParticle * > *  ParList1,
std::vector< TAbsFitParticle * > *  ParList2,
Double_t  Mass = 0,
Double_t  Width = 0 
)

Definition at line 31 of file TFitConstraintMGaus.cc.

References init(), and setMassConstraint().

35  : TFitConstraintM(ParList1, ParList2, Mass )
36 {
37 
38  init();
39  setMassConstraint( Mass, Width );
40 
41 }
void setMassConstraint(Double_t Mass, Double_t Width)
TFitConstraintMGaus::TFitConstraintMGaus ( const TString &  name,
const TString &  title,
std::vector< TAbsFitParticle * > *  ParList1,
std::vector< TAbsFitParticle * > *  ParList2,
Double_t  Mass = 0,
Double_t  Width = 0 
)

Definition at line 43 of file TFitConstraintMGaus.cc.

References init(), and setMassConstraint().

48  : TFitConstraintM( name, title, ParList1, ParList2, Mass )
49 {
50 
51  init();
52  setMassConstraint( Mass, Width );
53 
54 }
void setMassConstraint(Double_t Mass, Double_t Width)
TFitConstraintMGaus::~TFitConstraintMGaus ( )
override

Definition at line 70 of file TFitConstraintMGaus.cc.

70  {
71 
72 }

Member Function Documentation

Double_t TFitConstraintMGaus::getCurrentValue ( )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 105 of file TFitConstraintMGaus.cc.

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

Referenced by getInfoString().

105  {
106  // Get value of constraint after the fit
107 
108  Double_t CurrentValue =
109  CalcMass(&_ParList1,false) -
110  CalcMass(&_ParList2,false) -
112 
113  return CurrentValue;
114 
115 }
Double_t CalcMass(std::vector< TAbsFitParticle * > *List, Bool_t IniVal)
Double_t _TheMassConstraint
std::vector< TAbsFitParticle * > _ParList1
std::vector< TAbsFitParticle * > _ParList2
TMatrixD * TFitConstraintMGaus::getDerivativeAlpha ( )
overridevirtual

Reimplemented from TAbsFitConstraint.

Definition at line 117 of file TFitConstraintMGaus.cc.

References TFitConstraintM::_TheMassConstraint.

117  {
118  // Calculate dF/dAlpha = -1 * M
119 
120  TMatrixD* DerivativeMatrix = new TMatrixD(1,1);
121  DerivativeMatrix->Zero();
122 
123  (*DerivativeMatrix)(0,0) = -1. * _TheMassConstraint;
124 
125  return DerivativeMatrix;
126 
127 }
Double_t _TheMassConstraint
TString TFitConstraintMGaus::getInfoString ( )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 129 of file TFitConstraintMGaus.cc.

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

Referenced by print().

129  {
130  // Collect information to be used for printout
131 
132  std::stringstream info;
133  info << std::scientific << std::setprecision(6);
134 
135  info << "__________________________" << std::endl
136  << std::endl;
137  info << "OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << std::endl;
138 
139  info << "initial value: " << getInitValue() << std::endl;
140  info << "current value: " << getCurrentValue() << std::endl;
141  info << "mean mass: " << _TheMassConstraint << std::endl;
142  info << "width: " << _width << std::endl;
143  info << "initial mass: " << _iniparameters(0,0)*_TheMassConstraint << std::endl;
144  info << "current mass: " << _parameters(0,0)*_TheMassConstraint << std::endl;
145 
146  return info.str();
147 
148 }
static const TGPicture * info(bool iBackgroundIsBlack)
Double_t getInitValue() override
Double_t getCurrentValue() override
Double_t _TheMassConstraint
Double_t TFitConstraintMGaus::getInitValue ( )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 93 of file TFitConstraintMGaus.cc.

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

Referenced by getInfoString().

93  {
94  // Get initial value of constraint (before the fit)
95 
96  Double_t InitValue =
97  CalcMass( &_ParList1, true ) -
98  CalcMass( &_ParList2, true ) -
100 
101  return InitValue;
102 
103 }
Double_t CalcMass(std::vector< TAbsFitParticle * > *List, Bool_t IniVal)
Double_t _TheMassConstraint
std::vector< TAbsFitParticle * > _ParList1
std::vector< TAbsFitParticle * > _ParList2
void TFitConstraintMGaus::init ( void  )
protected

Definition at line 57 of file TFitConstraintMGaus.cc.

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

Referenced by TFitConstraintMGaus().

57  {
58 
59  _nPar = 1;
60  _iniparameters.ResizeTo(1,1);
61  _iniparameters(0,0) = 1.;
62  _parameters.ResizeTo(1,1);
64 
65 }
void TFitConstraintMGaus::print ( void  )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 150 of file TFitConstraintMGaus.cc.

References getInfoString().

150  {
151  // Print constraint contents
152 
153  edm::LogVerbatim("KinFitter") << this->getInfoString();
154 
155 }
TString getInfoString() override
void TFitConstraintMGaus::setMassConstraint ( Double_t  Mass,
Double_t  Width 
)

Definition at line 78 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_covMatrix, TFitConstraintM::_TheMassConstraint, _width, Exception, bwdGsfElectronPropagator_cff::Mass, and TAbsFitConstraint::setCovMatrix().

Referenced by TFitConstraintMGaus().

78  {
79 
81  _width = Width;
82  setCovMatrix( nullptr );
83  if(!Mass) throw cms::Exception("Configuration")
84  << "Error occured!\n"
85  << "Object type : TFitConstraintMGaus\n"
86  << "Object name : " << GetName() << "\n"
87  << "Object title: " << GetTitle() << "\n"
88  << "Mass of 0 GeV not supported, please choose a larger mass!\n";
89  _covMatrix(0,0) = (Width*Width) / (Mass * Mass);
90 
91 }
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
Double_t _TheMassConstraint

Member Data Documentation

Double_t TFitConstraintMGaus::_width
protected