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.

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

References _nPar.

◆ TAbsFitConstraint() [2/2]

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

Definition at line 30 of file TAbsFitConstraint.cc.

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

References _nPar.

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

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

References _iniparameters, and _parameters.

◆ calcCovMatrixDeltaAlpha()

void TAbsFitConstraint::calcCovMatrixDeltaAlpha ( )
protected

Definition at line 79 of file TAbsFitConstraint.cc.

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 }

References _covMatrix, _covMatrixDeltaAlpha, _covMatrixFit, and _nPar.

Referenced by getCovMatrixDeltaAlpha().

◆ getCovMatrix()

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

Definition at line 27 of file TAbsFitConstraint.h.

27 { return &_covMatrix; }

References _covMatrix.

◆ getCovMatrixDeltaAlpha()

const TMatrixD * TAbsFitConstraint::getCovMatrixDeltaAlpha ( )
virtual

Definition at line 111 of file TAbsFitConstraint.cc.

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

References _covMatrixDeltaAlpha, and calcCovMatrixDeltaAlpha().

◆ getCovMatrixFit()

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

Definition at line 30 of file TAbsFitConstraint.h.

30 { return &_covMatrixFit; }

References _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.

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 }

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

Referenced by print().

◆ getInitValue()

virtual Double_t TAbsFitConstraint::getInitValue ( )
pure virtual

◆ getNPar()

Int_t TAbsFitConstraint::getNPar ( )
inline

Definition at line 23 of file TAbsFitConstraint.h.

23 { return _nPar; }

References _nPar.

◆ getParCurr()

const TMatrixD* TAbsFitConstraint::getParCurr ( )
inline

Definition at line 38 of file TAbsFitConstraint.h.

38 { return &_parameters; }

References _parameters.

◆ getParIni()

const TMatrixD* TAbsFitConstraint::getParIni ( )
inline

Definition at line 35 of file TAbsFitConstraint.h.

35 { return &_iniparameters; }

References _iniparameters.

◆ print()

void TAbsFitConstraint::print ( void  )
virtual

Reimplemented in TFitConstraintM, TFitConstraintEp, and TFitConstraintMGaus.

Definition at line 133 of file TAbsFitConstraint.cc.

133  {
134  // Print constraint contents
135 
136  edm::LogVerbatim("KinFitter") << this->getInfoString();
137 }

References getInfoString().

◆ reset()

void TAbsFitConstraint::reset ( void  )
virtual

Definition at line 44 of file TAbsFitConstraint.cc.

44  {
45  // Reset parameters to initial values
46 
48  setCovMatrixFit(nullptr);
49 }

References _iniparameters, _parameters, and setCovMatrixFit().

◆ setCovMatrix()

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

Definition at line 51 of file TAbsFitConstraint.cc.

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 }

References _covMatrix, and _nPar.

Referenced by TFitConstraintMGaus::setMassConstraint().

◆ setCovMatrixFit()

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

Definition at line 65 of file TAbsFitConstraint.cc.

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 }

References _covMatrixFit, and _nPar.

Referenced by reset().

◆ setParIni()

void TAbsFitConstraint::setParIni ( const TMatrixD *  parini)

Definition at line 98 of file TAbsFitConstraint.cc.

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 }

References _iniparameters.

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(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::toolCode(), tauTools.AddTauCollection::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().

TAbsFitConstraint::_covMatrix
TMatrixD _covMatrix
Definition: TAbsFitConstraint.h:49
TAbsFitConstraint::getInitValue
virtual Double_t getInitValue()=0
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
TAbsFitConstraint::setCovMatrixFit
virtual void setCovMatrixFit(const TMatrixD *theCovMatrixFit)
Definition: TAbsFitConstraint.cc:65
TAbsFitConstraint::_nPar
Int_t _nPar
Definition: TAbsFitConstraint.h:47
TAbsFitConstraint::getCurrentValue
virtual Double_t getCurrentValue()=0
TAbsFitConstraint::_covMatrixDeltaAlpha
TMatrixD _covMatrixDeltaAlpha
Definition: TAbsFitConstraint.h:51
TAbsFitConstraint::getInfoString
virtual TString getInfoString()
Definition: TAbsFitConstraint.cc:118
TAbsFitConstraint::_iniparameters
TMatrixD _iniparameters
Definition: TAbsFitConstraint.h:52
TAbsFitConstraint::_covMatrixFit
TMatrixD _covMatrixFit
Definition: TAbsFitConstraint.h:50
edm::LogError
Definition: MessageLogger.h:183
TAbsFitConstraint::_parameters
TMatrixD _parameters
Definition: TAbsFitConstraint.h:53
edm::LogVerbatim
Definition: MessageLogger.h:297
TAbsFitConstraint::calcCovMatrixDeltaAlpha
void calcCovMatrixDeltaAlpha()
Definition: TAbsFitConstraint.cc:79
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17