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::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::TAbsFitConstraint ( const TString &  name,
const TString &  title 
)

Definition at line 30 of file TAbsFitConstraint.cc.

References _nPar.

TAbsFitConstraint::~TAbsFitConstraint ( )
override

Definition at line 42 of file TAbsFitConstraint.cc.

42 {}

Member Function Documentation

void TAbsFitConstraint::applyDeltaAlpha ( TMatrixD *  corrMatrix)
virtual

Definition at line 90 of file TAbsFitConstraint.cc.

References _iniparameters, and _parameters.

Referenced by TKinFitter::applyDeltaY(), and getParIni().

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

Definition at line 79 of file TAbsFitConstraint.cc.

References _covMatrix, _covMatrixDeltaAlpha, _covMatrixFit, and _nPar.

Referenced by getCovMatrixDeltaAlpha(), and getParCurr().

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
virtual const TMatrixD* TAbsFitConstraint::getCovMatrix ( ) const
inlinevirtual

Definition at line 27 of file TAbsFitConstraint.h.

References _covMatrix, and setCovMatrix().

Referenced by TKinFitter::calcV().

27 { return &_covMatrix; }
const TMatrixD * TAbsFitConstraint::getCovMatrixDeltaAlpha ( )
virtual

Definition at line 111 of file TAbsFitConstraint.cc.

References _covMatrixDeltaAlpha, and calcCovMatrixDeltaAlpha().

Referenced by getCovMatrixFit().

111  {
112  // Returns covariance matrix delta(alpha)
113 
115  return &_covMatrixDeltaAlpha;
116 }
TMatrixD _covMatrixDeltaAlpha
virtual const TMatrixD* TAbsFitConstraint::getCovMatrixFit ( ) const
inlinevirtual

Definition at line 30 of file TAbsFitConstraint.h.

References _covMatrixFit, getCovMatrixDeltaAlpha(), and setCovMatrixFit().

30 { return &_covMatrixFit; }
virtual Double_t TAbsFitConstraint::getCurrentValue ( )
pure virtual
virtual TMatrixD* TAbsFitConstraint::getDerivative ( TAbsFitParticle particle)
pure virtual

Implemented in TFitConstraintM, and TFitConstraintEp.

virtual TMatrixD* TAbsFitConstraint::getDerivativeAlpha ( )
inlinevirtual

Reimplemented in TFitConstraintMGaus.

Definition at line 25 of file TAbsFitConstraint.h.

Referenced by TKinFitter::calcB().

25 { return nullptr; }
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 getParCurr(), and 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
virtual Double_t TAbsFitConstraint::getInitValue ( )
pure virtual
Int_t TAbsFitConstraint::getNPar ( )
inline

Definition at line 23 of file TAbsFitConstraint.h.

References _nPar.

Referenced by TKinFitter::applyDeltaY(), TKinFitter::applyVFit(), TKinFitter::calcC(), and TKinFitter::calcV().

23 { return _nPar; }
const TMatrixD* TAbsFitConstraint::getParCurr ( )
inline

Definition at line 38 of file TAbsFitConstraint.h.

References _parameters, calcCovMatrixDeltaAlpha(), getInfoString(), print(), and reset().

Referenced by TKinFitter::calcC().

38 { return &_parameters; }
const TMatrixD* TAbsFitConstraint::getParIni ( )
inline

Definition at line 35 of file TAbsFitConstraint.h.

References _iniparameters, applyDeltaAlpha(), and setParIni().

Referenced by TKinFitter::calcC().

35 { return &_iniparameters; }
void TAbsFitConstraint::print ( void  )
virtual

Reimplemented in TFitConstraintM, TFitConstraintEp, and TFitConstraintMGaus.

Definition at line 133 of file TAbsFitConstraint.cc.

References getInfoString().

Referenced by getParCurr().

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

Definition at line 44 of file TAbsFitConstraint.cc.

References _iniparameters, _parameters, and setCovMatrixFit().

Referenced by getParCurr(), and TKinFitter::resetParams().

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

Definition at line 51 of file TAbsFitConstraint.cc.

References _covMatrix, and _nPar.

Referenced by getCovMatrix(), and 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 }
void TAbsFitConstraint::setCovMatrixFit ( const TMatrixD *  theCovMatrixFit)
virtual

Definition at line 65 of file TAbsFitConstraint.cc.

References _covMatrixFit, and _nPar.

Referenced by TKinFitter::applyVFit(), getCovMatrixFit(), and 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 }
void TAbsFitConstraint::setParIni ( const TMatrixD *  parini)

Definition at line 98 of file TAbsFitConstraint.cc.

References _iniparameters.

Referenced by getParIni().

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 }

Member Data Documentation

TMatrixD TAbsFitConstraint::_covMatrix
protected
TMatrixD TAbsFitConstraint::_covMatrixDeltaAlpha
protected

Definition at line 51 of file TAbsFitConstraint.h.

Referenced by calcCovMatrixDeltaAlpha(), and getCovMatrixDeltaAlpha().

TMatrixD TAbsFitConstraint::_covMatrixFit
protected

Definition at line 50 of file TAbsFitConstraint.h.

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

TMatrixD TAbsFitConstraint::_iniparameters
protected
Int_t TAbsFitConstraint::_nPar
protected
TMatrixD TAbsFitConstraint::_parameters
protected

Definition at line 53 of file TAbsFitConstraint.h.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::ak4JetReclustering(), cmsswVersionTools.PickRelValInputFiles::apply(), applyDeltaAlpha(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::createSmearedJetModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getCorrectedMET(), TFitConstraintMGaus::getCurrentValue(), TFitConstraintMGaus::getInfoString(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getMETUncertainties(), getParCurr(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getUnclusteredVariationsForMVAMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getVariations(), TFitConstraintMGaus::init(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::jetCleaning(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::jetConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::miniAODConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::miniAODConfigurationPost(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::produceMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::recomputeRawMetFromPfcs(), reset(), HiCoreTools.RestrictInputToAOD::toolCode(), coreTools.RunOnData::toolCode(), trackTools.MakeAODTrackCandidates::toolCode(), metTools.AddMETCollection::toolCode(), runJetUncertainties.RunJetUncertainties::toolCode(), HiCoreTools.RemoveMCMatching::toolCode(), coreTools.RemoveMCMatching::toolCode(), trigTools.SwitchOnTrigger::toolCode(), trackTools.MakePATTrackCandidates::toolCode(), HiCoreTools.RemoveAllPATObjectsBut::toolCode(), HiCoreTools.RemoveSpecificPATObjects::toolCode(), trigTools.SwitchOnTriggerStandAlone::toolCode(), tauTools.AddTauCollection::toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::toolCode(), trackTools.MakeTrackCandidates::toolCode(), HiCoreTools.RemoveCleaning::toolCode(), trigTools.SwitchOnTriggerMatching::toolCode(), HiCoreTools.AddCleaning::toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone::toolCode(), trigTools.SwitchOnTriggerMatchEmbedding::toolCode(), jetTools.AddJetCollection::toolCode(), jetTools.SwitchJetCollection::toolCode(), jetTools.UpdateJetCollection::toolCode(), jetTools.AddJetID::toolCode(), jetTools.SetTagInfos::toolCode(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::updateJECs().