CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

TAbsFitConstraint Class Reference

#include <TAbsFitConstraint.h>

Inheritance diagram for TAbsFitConstraint:
TNamed TFitConstraintEp TFitConstraintM TFitConstraintMGaus

List of all members.

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

  : TNamed("NoName","NoTitle")
  ,_covMatrix()
  ,_covMatrixFit()
  ,_covMatrixDeltaAlpha()
  ,_iniparameters()
  ,_parameters()

{
  _nPar = 0;
}
TAbsFitConstraint::TAbsFitConstraint ( const TString &  name,
const TString &  title 
)

Definition at line 32 of file TAbsFitConstraint.cc.

References _nPar.

TAbsFitConstraint::~TAbsFitConstraint ( ) [virtual]

Definition at line 44 of file TAbsFitConstraint.cc.

                                      {

}

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().

                                                            {
  // Apply corrections to the parameters wrt. to the
  // initial parameters alpha* = alpha + delta(alpha)

  _parameters = _iniparameters;
  _parameters += (*corrMatrix);

}
void TAbsFitConstraint::calcCovMatrixDeltaAlpha ( ) [protected]

Definition at line 88 of file TAbsFitConstraint.cc.

References _covMatrix, _covMatrixDeltaAlpha, _covMatrixFit, and _nPar.

Referenced by getCovMatrixDeltaAlpha().

                                                {
  // Calculates V(deltaAlpha) ==  V(alpha_meas) - V(alpha_fit)

  _covMatrixDeltaAlpha.ResizeTo( _nPar, _nPar );
  _covMatrixDeltaAlpha = _covMatrix;
  if(_covMatrixFit.GetNrows() == _nPar && _covMatrixFit.GetNcols() == _nPar)
    _covMatrixDeltaAlpha -= _covMatrixFit;
  else
    edm::LogError ("WrongMatrixSize")
      << GetName() << "::calcCovMatrixDeltaAlpha - _covMatrixFit probably not set.";
}
virtual const TMatrixD* TAbsFitConstraint::getCovMatrix ( ) const [inline, virtual]

Definition at line 29 of file TAbsFitConstraint.h.

References _covMatrix.

Referenced by TKinFitter::calcV().

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

Definition at line 125 of file TAbsFitConstraint.cc.

References _covMatrixDeltaAlpha, and calcCovMatrixDeltaAlpha().

                                                          {
  // Returns covariance matrix delta(alpha)

  calcCovMatrixDeltaAlpha(); 
  return &_covMatrixDeltaAlpha; 

}
virtual const TMatrixD* TAbsFitConstraint::getCovMatrixFit ( ) const [inline, virtual]

Definition at line 32 of file TAbsFitConstraint.h.

References _covMatrixFit.

{ 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 ( ) [inline, virtual]

Reimplemented in TFitConstraintMGaus.

Definition at line 27 of file TAbsFitConstraint.h.

Referenced by TKinFitter::calcB().

{ 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().

                                         {
  // Collect information to be used for printout

  std::stringstream info;
  info << std::scientific << std::setprecision(6);

  info << "__________________________" << std::endl
       << std::endl;
  info <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << std::endl;
  
  info << "initial value: " << getInitValue() << std::endl;
  info << "current value: " << getCurrentValue() << std::endl;

  return info.str();

}
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().

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

Definition at line 40 of file TAbsFitConstraint.h.

References _parameters.

Referenced by TKinFitter::calcC().

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

Definition at line 37 of file TAbsFitConstraint.h.

References _iniparameters.

Referenced by TKinFitter::calcC().

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

Reimplemented in TFitConstraintEp, TFitConstraintM, and TFitConstraintMGaus.

Definition at line 150 of file TAbsFitConstraint.cc.

References getInfoString().

                              {
  // Print constraint contents

  edm::LogVerbatim("KinFitter") << this->getInfoString();

}
void TAbsFitConstraint::reset ( void  ) [virtual]

Definition at line 48 of file TAbsFitConstraint.cc.

References _iniparameters, _parameters, and setCovMatrixFit().

Referenced by TKinFitter::resetParams().

                              {
  // Reset parameters to initial values

  _parameters = _iniparameters;  
  setCovMatrixFit( 0 );

}
void TAbsFitConstraint::setCovMatrix ( const TMatrixD *  theCovMatrix) [virtual]

Definition at line 56 of file TAbsFitConstraint.cc.

References _covMatrix, and _nPar.

Referenced by TFitConstraintMGaus::setMassConstraint().

                                                                 {
  // Set measured alpha covariance matrix

  _covMatrix.ResizeTo(_nPar, _nPar);
  if(theCovMatrix==0) {
    _covMatrix.Zero();
  } else if (theCovMatrix->GetNcols() ==_nPar && theCovMatrix->GetNrows() ==_nPar) {
    _covMatrix = (*theCovMatrix);
  } else {
    edm::LogError ("WrongMatrixSize")
      << GetName() << "::setCovMatrix - Measured alpha covariance matrix needs to be a "
      << _nPar << "x" << _nPar << " matrix.";
  }

}
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().

                                                                       {
  // Set the fitted covariance matrix

  _covMatrixFit.ResizeTo(_nPar, _nPar);
  if(theCovMatrixFit==0) {
    _covMatrixFit.Zero();
  } else if (theCovMatrixFit->GetNcols() ==_nPar && theCovMatrixFit->GetNrows() ==_nPar) {
    _covMatrixFit = (*theCovMatrixFit);
  } else {
    edm::LogError ("WrongMatrixSize")
      << GetName() << "::setCovMatrixFit - Fitted covariance matrix needs to be a "
      << _nPar << "x" << _nPar << " matrix.";
  }

}
void TAbsFitConstraint::setParIni ( const TMatrixD *  parini)

Definition at line 110 of file TAbsFitConstraint.cc.

References _iniparameters.

                                                        {
  // Set initial parameter values (before the fit)

  if (parini == 0) return;
  else if( parini->GetNrows() == _iniparameters.GetNrows() &&
           parini->GetNcols() == _iniparameters.GetNcols() )
    _iniparameters = (*parini) ;
  else {
    edm::LogError ("WrongMatrixSize")
      << GetName() << "::setParIni - Matrices don't fit.";
    return;
  }

}

Member Data Documentation

TMatrixD TAbsFitConstraint::_covMatrix [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]