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 (const TString &name, const TString &title, std::vector< TAbsFitParticle * > *ParList1, std::vector< TAbsFitParticle * > *ParList2, Double_t Mass=0, Double_t Width=0)
 
 TFitConstraintMGaus (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 (const TString &name, const TString &title, std::vector< TAbsFitParticle * > *ParList1, std::vector< TAbsFitParticle * > *ParList2, Double_t Mass=0)
 
 TFitConstraintM (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.

21 : TFitConstraintM() { init(); }

References init().

◆ TFitConstraintMGaus() [2/3]

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

Definition at line 23 of file TFitConstraintMGaus.cc.

27  : TFitConstraintM(ParList1, ParList2, Mass) {
28  init();
30 }

References init(), HLTSiStripMonitoring_cff::Mass, setMassConstraint(), and DQMGenericTnPClient_cfi::Width.

◆ 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 
)

Definition at line 32 of file TFitConstraintMGaus.cc.

38  : TFitConstraintM(name, title, ParList1, ParList2, Mass) {
39  init();
41 }

References init(), HLTSiStripMonitoring_cff::Mass, setMassConstraint(), and DQMGenericTnPClient_cfi::Width.

◆ ~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.

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 }

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

Referenced by getInfoString().

◆ getDerivativeAlpha()

TMatrixD * TFitConstraintMGaus::getDerivativeAlpha ( )
overridevirtual

Reimplemented from TAbsFitConstraint.

Definition at line 91 of file TFitConstraintMGaus.cc.

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 }

References TFitConstraintM::_TheMassConstraint.

◆ getInfoString()

TString TFitConstraintMGaus::getInfoString ( )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 102 of file TFitConstraintMGaus.cc.

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 }

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

Referenced by print().

◆ getInitValue()

Double_t TFitConstraintMGaus::getInitValue ( )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 73 of file TFitConstraintMGaus.cc.

73  {
74  // Get initial value of constraint (before the fit)
75 
76  Double_t InitValue =
78 
79  return InitValue;
80 }

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

Referenced by getInfoString().

◆ init()

void TFitConstraintMGaus::init ( void  )
protected

Definition at line 43 of file TFitConstraintMGaus.cc.

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

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

Referenced by TFitConstraintMGaus().

◆ print()

void TFitConstraintMGaus::print ( void  )
overridevirtual

Reimplemented from TFitConstraintM.

Definition at line 121 of file TFitConstraintMGaus.cc.

121  {
122  // Print constraint contents
123 
124  edm::LogVerbatim("KinFitter") << this->getInfoString();
125 }

References getInfoString().

◆ setMassConstraint()

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

Definition at line 60 of file TFitConstraintMGaus.cc.

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 }

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

Referenced by TFitConstraintMGaus().

Member Data Documentation

◆ _width

Double_t TFitConstraintMGaus::_width
protected

Definition at line 36 of file TFitConstraintMGaus.h.

Referenced by getInfoString(), and setMassConstraint().

runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
TFitConstraintMGaus::_width
Double_t _width
Definition: TFitConstraintMGaus.h:36
TAbsFitConstraint::_covMatrix
TMatrixD _covMatrix
Definition: TAbsFitConstraint.h:49
TAbsFitConstraint::setCovMatrix
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
Definition: TAbsFitConstraint.cc:51
TFitConstraintM::_ParList2
std::vector< TAbsFitParticle * > _ParList2
Definition: TFitConstraintM.h:63
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
TFitConstraintMGaus::setMassConstraint
void setMassConstraint(Double_t Mass, Double_t Width)
Definition: TFitConstraintMGaus.cc:60
TAbsFitConstraint::_nPar
Int_t _nPar
Definition: TAbsFitConstraint.h:47
DQMGenericTnPClient_cfi.Width
Width
Definition: DQMGenericTnPClient_cfi.py:8
TFitConstraintM::CalcMass
Double_t CalcMass(std::vector< TAbsFitParticle * > *List, Bool_t IniVal)
Definition: TFitConstraintM.cc:244
TFitConstraintMGaus::getInitValue
Double_t getInitValue() override
Definition: TFitConstraintMGaus.cc:73
TFitConstraintM::_ParList1
std::vector< TAbsFitParticle * > _ParList1
Definition: TFitConstraintM.h:61
HLTSiStripMonitoring_cff.Mass
Mass
Definition: HLTSiStripMonitoring_cff.py:135
TAbsFitConstraint::_iniparameters
TMatrixD _iniparameters
Definition: TAbsFitConstraint.h:52
TFitConstraintMGaus::init
void init()
Definition: TFitConstraintMGaus.cc:43
TFitConstraintMGaus::getInfoString
TString getInfoString() override
Definition: TFitConstraintMGaus.cc:102
TAbsFitConstraint::_parameters
TMatrixD _parameters
Definition: TAbsFitConstraint.h:53
TFitConstraintMGaus::getCurrentValue
Double_t getCurrentValue() override
Definition: TFitConstraintMGaus.cc:82
TFitConstraintM::TFitConstraintM
TFitConstraintM()
Definition: TFitConstraintM.cc:22
TFitConstraintM::_TheMassConstraint
Double_t _TheMassConstraint
Definition: TFitConstraintM.h:64
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17