CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TAbsFitConstraint Class Referenceabstract

#include <TAbsFitConstraint.h>

Inheritance diagram for TAbsFitConstraint:
TFitConstraintEp TFitConstraintM TFitConstraintMGaus

Public Member Functions

virtual void applyDeltaAlpha (TMatrixD *corrMatrix)
 
virtual const TMatrixD * getCovMatrix () const
 
virtual const TMatrixD * getCovMatrixDeltaAlpha ()
 
virtual const TMatrixD * getCovMatrixFit () const
 
virtual Double_t getCurrentValue ()=0
 
virtual TMatrixD * getDerivative (TAbsFitParticle *particle)=0
 
virtual TMatrixD * getDerivativeAlpha ()
 
virtual TString getInfoString ()
 
virtual Double_t getInitValue ()=0
 
Int_t getNPar ()
 
const TMatrixD * getParCurr ()
 
const TMatrixD * getParIni ()
 
virtual void print ()
 
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 calcCovMatrixDeltaAlpha ()
 

Protected Attributes

TMatrixD _covMatrix
 
TMatrixD _covMatrixDeltaAlpha
 
TMatrixD _covMatrixFit
 
TMatrixD _iniparameters
 
Int_t _nPar
 
TMatrixD _parameters
 

Detailed Description

Definition at line 10 of file TAbsFitConstraint.h.

Constructor & Destructor Documentation

◆ TAbsFitConstraint() [1/2]

TAbsFitConstraint::TAbsFitConstraint ( )

Definition at line 18 of file TAbsFitConstraint.cc.

References _nPar.

19  : TNamed("NoName", "NoTitle"),
20  _covMatrix(),
21  _covMatrixFit(),
24  _parameters()
25 
26 {
27  _nPar = 0;
28 }
TMatrixD _covMatrixDeltaAlpha

◆ TAbsFitConstraint() [2/2]

TAbsFitConstraint::TAbsFitConstraint ( const TString &  name,
const TString &  title 
)

Definition at line 30 of file TAbsFitConstraint.cc.

References _nPar.

31  : TNamed(name, title),
32  _covMatrix(),
33  _covMatrixFit(),
36  _parameters()
37 
38 {
39  _nPar = 0;
40 }
TMatrixD _covMatrixDeltaAlpha

◆ ~TAbsFitConstraint()

TAbsFitConstraint::~TAbsFitConstraint ( )
override

Definition at line 42 of file TAbsFitConstraint.cc.

42 {}

Member Function Documentation

◆ applyDeltaAlpha()

void TAbsFitConstraint::applyDeltaAlpha ( TMatrixD *  corrMatrix)
virtual

Definition at line 90 of file TAbsFitConstraint.cc.

References _iniparameters, and _parameters.

90  {
91  // Apply corrections to the parameters wrt. to the
92  // initial parameters alpha* = alpha + delta(alpha)
93 
95  _parameters += (*corrMatrix);
96 }

◆ calcCovMatrixDeltaAlpha()

void TAbsFitConstraint::calcCovMatrixDeltaAlpha ( )
protected

Definition at line 79 of file TAbsFitConstraint.cc.

References _covMatrix, _covMatrixDeltaAlpha, _covMatrixFit, and _nPar.

Referenced by getCovMatrixDeltaAlpha().

79  {
80  // Calculates V(deltaAlpha) == V(alpha_meas) - V(alpha_fit)
81 
82  _covMatrixDeltaAlpha.ResizeTo(_nPar, _nPar);
84  if (_covMatrixFit.GetNrows() == _nPar && _covMatrixFit.GetNcols() == _nPar)
86  else
87  edm::LogError("WrongMatrixSize") << GetName() << "::calcCovMatrixDeltaAlpha - _covMatrixFit probably not set.";
88 }
TMatrixD _covMatrixDeltaAlpha
Log< level::Error, false > LogError

◆ getCovMatrix()

virtual const TMatrixD* TAbsFitConstraint::getCovMatrix ( ) const
inlinevirtual

Definition at line 27 of file TAbsFitConstraint.h.

References _covMatrix.

27 { return &_covMatrix; }

◆ getCovMatrixDeltaAlpha()

const TMatrixD * TAbsFitConstraint::getCovMatrixDeltaAlpha ( )
virtual

Definition at line 111 of file TAbsFitConstraint.cc.

References _covMatrixDeltaAlpha, and calcCovMatrixDeltaAlpha().

111  {
112  // Returns covariance matrix delta(alpha)
113 
115  return &_covMatrixDeltaAlpha;
116 }
TMatrixD _covMatrixDeltaAlpha

◆ getCovMatrixFit()

virtual const TMatrixD* TAbsFitConstraint::getCovMatrixFit ( ) const
inlinevirtual

Definition at line 30 of file TAbsFitConstraint.h.

References _covMatrixFit.

30 { return &_covMatrixFit; }

◆ getCurrentValue()

virtual Double_t TAbsFitConstraint::getCurrentValue ( )
pure virtual

◆ getDerivative()

virtual TMatrixD* TAbsFitConstraint::getDerivative ( TAbsFitParticle particle)
pure virtual

Implemented in TFitConstraintM, and TFitConstraintEp.

◆ getDerivativeAlpha()

virtual TMatrixD* TAbsFitConstraint::getDerivativeAlpha ( )
inlinevirtual

Reimplemented in TFitConstraintMGaus.

Definition at line 25 of file TAbsFitConstraint.h.

25 { return nullptr; }

◆ getInfoString()

TString TAbsFitConstraint::getInfoString ( )
virtual

Reimplemented in TFitConstraintM, TFitConstraintEp, and TFitConstraintMGaus.

Definition at line 118 of file TAbsFitConstraint.cc.

References getCurrentValue(), getInitValue(), and info().

Referenced by print().

118  {
119  // Collect information to be used for printout
120 
121  std::stringstream info;
122  info << std::scientific << std::setprecision(6);
123 
124  info << "__________________________" << std::endl << std::endl;
125  info << "OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << std::endl;
126 
127  info << "initial value: " << getInitValue() << std::endl;
128  info << "current value: " << getCurrentValue() << std::endl;
129 
130  return info.str();
131 }
static const TGPicture * info(bool iBackgroundIsBlack)
virtual Double_t getCurrentValue()=0
virtual Double_t getInitValue()=0

◆ getInitValue()

virtual Double_t TAbsFitConstraint::getInitValue ( )
pure virtual

◆ getNPar()

Int_t TAbsFitConstraint::getNPar ( )
inline

Definition at line 23 of file TAbsFitConstraint.h.

References _nPar.

23 { return _nPar; }

◆ getParCurr()

const TMatrixD* TAbsFitConstraint::getParCurr ( )
inline

Definition at line 38 of file TAbsFitConstraint.h.

References _parameters.

38 { return &_parameters; }

◆ getParIni()

const TMatrixD* TAbsFitConstraint::getParIni ( )
inline

Definition at line 35 of file TAbsFitConstraint.h.

References _iniparameters.

35 { return &_iniparameters; }

◆ print()

void TAbsFitConstraint::print ( void  )
virtual

Reimplemented in TFitConstraintM, TFitConstraintEp, and TFitConstraintMGaus.

Definition at line 133 of file TAbsFitConstraint.cc.

References getInfoString().

133  {
134  // Print constraint contents
135 
136  edm::LogVerbatim("KinFitter") << this->getInfoString();
137 }
Log< level::Info, true > LogVerbatim
virtual TString getInfoString()

◆ reset()

void TAbsFitConstraint::reset ( void  )
virtual

Definition at line 44 of file TAbsFitConstraint.cc.

References _iniparameters, _parameters, and setCovMatrixFit().

44  {
45  // Reset parameters to initial values
46 
48  setCovMatrixFit(nullptr);
49 }
virtual void setCovMatrixFit(const TMatrixD *theCovMatrixFit)

◆ setCovMatrix()

void TAbsFitConstraint::setCovMatrix ( const TMatrixD *  theCovMatrix)
virtual

Definition at line 51 of file TAbsFitConstraint.cc.

References _covMatrix, and _nPar.

Referenced by TFitConstraintMGaus::setMassConstraint().

51  {
52  // Set measured alpha covariance matrix
53 
54  _covMatrix.ResizeTo(_nPar, _nPar);
55  if (theCovMatrix == nullptr) {
56  _covMatrix.Zero();
57  } else if (theCovMatrix->GetNcols() == _nPar && theCovMatrix->GetNrows() == _nPar) {
58  _covMatrix = (*theCovMatrix);
59  } else {
60  edm::LogError("WrongMatrixSize") << GetName() << "::setCovMatrix - Measured alpha covariance matrix needs to be a "
61  << _nPar << "x" << _nPar << " matrix.";
62  }
63 }
Log< level::Error, false > LogError

◆ setCovMatrixFit()

void TAbsFitConstraint::setCovMatrixFit ( const TMatrixD *  theCovMatrixFit)
virtual

Definition at line 65 of file TAbsFitConstraint.cc.

References _covMatrixFit, and _nPar.

Referenced by reset().

65  {
66  // Set the fitted covariance matrix
67 
68  _covMatrixFit.ResizeTo(_nPar, _nPar);
69  if (theCovMatrixFit == nullptr) {
70  _covMatrixFit.Zero();
71  } else if (theCovMatrixFit->GetNcols() == _nPar && theCovMatrixFit->GetNrows() == _nPar) {
72  _covMatrixFit = (*theCovMatrixFit);
73  } else {
74  edm::LogError("WrongMatrixSize") << GetName() << "::setCovMatrixFit - Fitted covariance matrix needs to be a "
75  << _nPar << "x" << _nPar << " matrix.";
76  }
77 }
Log< level::Error, false > LogError

◆ setParIni()

void TAbsFitConstraint::setParIni ( const TMatrixD *  parini)

Definition at line 98 of file TAbsFitConstraint.cc.

References _iniparameters.

98  {
99  // Set initial parameter values (before the fit)
100 
101  if (parini == nullptr)
102  return;
103  else if (parini->GetNrows() == _iniparameters.GetNrows() && parini->GetNcols() == _iniparameters.GetNcols())
104  _iniparameters = (*parini);
105  else {
106  edm::LogError("WrongMatrixSize") << GetName() << "::setParIni - Matrices don't fit.";
107  return;
108  }
109 }
Log< level::Error, false > LogError

Member Data Documentation

◆ _covMatrix

TMatrixD TAbsFitConstraint::_covMatrix
protected

◆ _covMatrixDeltaAlpha

TMatrixD TAbsFitConstraint::_covMatrixDeltaAlpha
protected

Definition at line 51 of file TAbsFitConstraint.h.

Referenced by calcCovMatrixDeltaAlpha(), and getCovMatrixDeltaAlpha().

◆ _covMatrixFit

TMatrixD TAbsFitConstraint::_covMatrixFit
protected

Definition at line 50 of file TAbsFitConstraint.h.

Referenced by calcCovMatrixDeltaAlpha(), getCovMatrixFit(), and setCovMatrixFit().

◆ _iniparameters

TMatrixD TAbsFitConstraint::_iniparameters
protected

◆ _nPar

Int_t TAbsFitConstraint::_nPar
protected

◆ _parameters

TMatrixD TAbsFitConstraint::_parameters
protected

Definition at line 53 of file TAbsFitConstraint.h.

Referenced by ConfigToolBase.ConfigToolBase::__copy__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::ak4JetReclustering(), cmsswVersionTools.PickRelValInputFiles::apply(), applyDeltaAlpha(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::createSmearedJetModule(), ConfigToolBase.ConfigToolBase::dumpPython(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getCorrectedMET(), TFitConstraintMGaus::getCurrentValue(), TFitConstraintMGaus::getInfoString(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getMETUncertainties(), ConfigToolBase.ConfigToolBase::getParameters(), getParCurr(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getUnclusteredVariationsForMVAMET(), ConfigToolBase.ConfigToolBase::getvalue(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getVariations(), TFitConstraintMGaus::init(), ConfigToolBase.ConfigToolBase::isAllowed(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::jetCleaning(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::jetConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::miniAODConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::miniAODConfigurationPost(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::recomputeRawMetFromPfcs(), reset(), ConfigToolBase.ConfigToolBase::reset(), ConfigToolBase.ConfigToolBase::setParameter(), ConfigToolBase.ConfigToolBase::setParameters(), coreTools.RunOnData::toolCode(), trackTools.MakeAODTrackCandidates::toolCode(), metTools.AddMETCollection::toolCode(), runJetUncertainties.RunJetUncertainties::toolCode(), coreTools.RemoveMCMatching::toolCode(), trigTools.SwitchOnTrigger::toolCode(), trackTools.MakePATTrackCandidates::toolCode(), trigTools.SwitchOnTriggerStandAlone::toolCode(), tauTools.AddTauCollection::toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::toolCode(), trackTools.MakeTrackCandidates::toolCode(), trigTools.SwitchOnTriggerMatching::toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone::toolCode(), trigTools.SwitchOnTriggerMatchEmbedding::toolCode(), jetTools.AddJetCollection::toolCode(), jetTools.SwitchJetCollection::toolCode(), jetTools.UpdateJetCollection::toolCode(), jetTools.AddJetID::toolCode(), jetTools.SetTagInfos::toolCode(), ConfigToolBase.ConfigToolBase::typeError(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::updateJECs().