CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual ~TAbsFitConstraint ()
 

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 20 of file TAbsFitConstraint.cc.

References _nPar.

21  : TNamed("NoName","NoTitle")
22  ,_covMatrix()
23  ,_covMatrixFit()
26  ,_parameters()
27 
28 {
29  _nPar = 0;
30 }
TMatrixD _covMatrixDeltaAlpha
TAbsFitConstraint::TAbsFitConstraint ( const TString &  name,
const TString &  title 
)

Definition at line 32 of file TAbsFitConstraint.cc.

References _nPar.

33  : TNamed(name, title)
34  ,_covMatrix()
35  ,_covMatrixFit()
38  ,_parameters()
39 
40 {
41  _nPar = 0;
42 }
TMatrixD _covMatrixDeltaAlpha
TAbsFitConstraint::~TAbsFitConstraint ( )
virtual

Definition at line 44 of file TAbsFitConstraint.cc.

44  {
45 
46 }

Member Function Documentation

void TAbsFitConstraint::applyDeltaAlpha ( TMatrixD *  corrMatrix)
virtual

Definition at line 101 of file TAbsFitConstraint.cc.

References _iniparameters, and _parameters.

Referenced by TKinFitter::applyDeltaY().

101  {
102  // Apply corrections to the parameters wrt. to the
103  // initial parameters alpha* = alpha + delta(alpha)
104 
106  _parameters += (*corrMatrix);
107 
108 }
void TAbsFitConstraint::calcCovMatrixDeltaAlpha ( )
protected

Definition at line 88 of file TAbsFitConstraint.cc.

References _covMatrix, _covMatrixDeltaAlpha, _covMatrixFit, and _nPar.

Referenced by getCovMatrixDeltaAlpha().

88  {
89  // Calculates V(deltaAlpha) == V(alpha_meas) - V(alpha_fit)
90 
91  _covMatrixDeltaAlpha.ResizeTo( _nPar, _nPar );
93  if(_covMatrixFit.GetNrows() == _nPar && _covMatrixFit.GetNcols() == _nPar)
95  else
96  edm::LogError ("WrongMatrixSize")
97  << GetName() << "::calcCovMatrixDeltaAlpha - _covMatrixFit probably not set.";
98 }
TMatrixD _covMatrixDeltaAlpha
virtual const TMatrixD* TAbsFitConstraint::getCovMatrix ( ) const
inlinevirtual

Definition at line 29 of file TAbsFitConstraint.h.

References _covMatrix.

Referenced by TKinFitter::calcV().

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

Definition at line 125 of file TAbsFitConstraint.cc.

References _covMatrixDeltaAlpha, and calcCovMatrixDeltaAlpha().

125  {
126  // Returns covariance matrix delta(alpha)
127 
129  return &_covMatrixDeltaAlpha;
130 
131 }
TMatrixD _covMatrixDeltaAlpha
virtual const TMatrixD* TAbsFitConstraint::getCovMatrixFit ( ) const
inlinevirtual

Definition at line 32 of file TAbsFitConstraint.h.

References _covMatrixFit.

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

Implemented in TFitConstraintEp, and TFitConstraintM.

virtual TMatrixD* TAbsFitConstraint::getDerivativeAlpha ( )
inlinevirtual

Reimplemented in TFitConstraintMGaus.

Definition at line 27 of file TAbsFitConstraint.h.

Referenced by TKinFitter::calcB().

27 { return 0; }
TString TAbsFitConstraint::getInfoString ( )
virtual

Reimplemented in TFitConstraintEp, TFitConstraintM, and TFitConstraintMGaus.

Definition at line 133 of file TAbsFitConstraint.cc.

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

Referenced by print().

133  {
134  // Collect information to be used for printout
135 
136  std::stringstream info;
137  info << std::scientific << std::setprecision(6);
138 
139  info << "__________________________" << std::endl
140  << std::endl;
141  info <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << std::endl;
142 
143  info << "initial value: " << getInitValue() << std::endl;
144  info << "current value: " << getCurrentValue() << std::endl;
145 
146  return info.str();
147 
148 }
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 25 of file TAbsFitConstraint.h.

References _nPar.

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

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

Definition at line 40 of file TAbsFitConstraint.h.

References _parameters.

Referenced by TKinFitter::calcC().

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

Definition at line 37 of file TAbsFitConstraint.h.

References _iniparameters.

Referenced by TKinFitter::calcC().

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

Reimplemented in TFitConstraintEp, TFitConstraintM, and TFitConstraintMGaus.

Definition at line 150 of file TAbsFitConstraint.cc.

References getInfoString().

150  {
151  // Print constraint contents
152 
153  edm::LogVerbatim("KinFitter") << this->getInfoString();
154 
155 }
virtual TString getInfoString()
void TAbsFitConstraint::reset ( void  )
virtual

Definition at line 48 of file TAbsFitConstraint.cc.

References _iniparameters, _parameters, and setCovMatrixFit().

Referenced by TKinFitter::resetParams().

48  {
49  // Reset parameters to initial values
50 
52  setCovMatrixFit( 0 );
53 
54 }
virtual void setCovMatrixFit(const TMatrixD *theCovMatrixFit)
void TAbsFitConstraint::setCovMatrix ( const TMatrixD *  theCovMatrix)
virtual

Definition at line 56 of file TAbsFitConstraint.cc.

References _covMatrix, and _nPar.

Referenced by TFitConstraintMGaus::setMassConstraint().

56  {
57  // Set measured alpha covariance matrix
58 
59  _covMatrix.ResizeTo(_nPar, _nPar);
60  if(theCovMatrix==0) {
61  _covMatrix.Zero();
62  } else if (theCovMatrix->GetNcols() ==_nPar && theCovMatrix->GetNrows() ==_nPar) {
63  _covMatrix = (*theCovMatrix);
64  } else {
65  edm::LogError ("WrongMatrixSize")
66  << GetName() << "::setCovMatrix - Measured alpha covariance matrix needs to be a "
67  << _nPar << "x" << _nPar << " matrix.";
68  }
69 
70 }
void TAbsFitConstraint::setCovMatrixFit ( const TMatrixD *  theCovMatrixFit)
virtual

Definition at line 72 of file TAbsFitConstraint.cc.

References _covMatrixFit, and _nPar.

Referenced by TKinFitter::applyVFit(), and reset().

72  {
73  // Set the fitted covariance matrix
74 
75  _covMatrixFit.ResizeTo(_nPar, _nPar);
76  if(theCovMatrixFit==0) {
77  _covMatrixFit.Zero();
78  } else if (theCovMatrixFit->GetNcols() ==_nPar && theCovMatrixFit->GetNrows() ==_nPar) {
79  _covMatrixFit = (*theCovMatrixFit);
80  } else {
81  edm::LogError ("WrongMatrixSize")
82  << GetName() << "::setCovMatrixFit - Fitted covariance matrix needs to be a "
83  << _nPar << "x" << _nPar << " matrix.";
84  }
85 
86 }
void TAbsFitConstraint::setParIni ( const TMatrixD *  parini)

Definition at line 110 of file TAbsFitConstraint.cc.

References _iniparameters.

110  {
111  // Set initial parameter values (before the fit)
112 
113  if (parini == 0) return;
114  else if( parini->GetNrows() == _iniparameters.GetNrows() &&
115  parini->GetNcols() == _iniparameters.GetNcols() )
116  _iniparameters = (*parini) ;
117  else {
118  edm::LogError ("WrongMatrixSize")
119  << GetName() << "::setParIni - Matrices don't fit.";
120  return;
121  }
122 
123 }

Member Data Documentation

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

Definition at line 54 of file TAbsFitConstraint.h.

Referenced by calcCovMatrixDeltaAlpha(), and getCovMatrixDeltaAlpha().

TMatrixD TAbsFitConstraint::_covMatrixFit
protected

Definition at line 53 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 56 of file TAbsFitConstraint.h.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__call__(), runJetUncertainties.RunJetUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::ak4JetReclustering(), cmsswVersionTools.PickRelValInputFiles::apply(), applyDeltaAlpha(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::createSmearedJetModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getCorrectedMET(), TFitConstraintMGaus::getCurrentValue(), TFitConstraintMGaus::getInfoString(), getParCurr(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::getUnclusteredVariationsForMVAMET(), 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(), trackTools.MakePATTrackCandidates::toolCode(), trigTools.SwitchOnTrigger::toolCode(), HiCoreTools.RemoveAllPATObjectsBut::toolCode(), HiCoreTools.RemoveSpecificPATObjects::toolCode(), trigTools.SwitchOnTriggerStandAlone::toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::toolCode(), trackTools.MakeTrackCandidates::toolCode(), tauTools.AddTauCollection::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().