CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

TFitConstraintMGaus Class Reference

#include <TFitConstraintMGaus.h>

Inheritance diagram for TFitConstraintMGaus:
TFitConstraintM TAbsFitConstraint TNamed

List of all members.

Public Member Functions

virtual Double_t getCurrentValue ()
virtual TMatrixD * getDerivativeAlpha ()
virtual TString getInfoString ()
virtual Double_t getInitValue ()
virtual void print ()
void setMassConstraint (Double_t Mass, Double_t Width)
 TFitConstraintMGaus ()
 TFitConstraintMGaus (std::vector< TAbsFitParticle * > *ParList1, std::vector< TAbsFitParticle * > *ParList2, Double_t Mass=0, Double_t Width=0)
 TFitConstraintMGaus (const TString &name, const TString &title, std::vector< TAbsFitParticle * > *ParList1, std::vector< TAbsFitParticle * > *ParList2, Double_t Mass=0, Double_t Width=0)
virtual ~TFitConstraintMGaus ()

Protected Member Functions

void init ()

Protected Attributes

Double_t _width

Detailed Description

Definition at line 10 of file TFitConstraintMGaus.h.


Constructor & Destructor Documentation

TFitConstraintMGaus::TFitConstraintMGaus ( )

Definition at line 23 of file TFitConstraintMGaus.cc.

References init().

  : TFitConstraintM() 
{

  init();

}
TFitConstraintMGaus::TFitConstraintMGaus ( std::vector< TAbsFitParticle * > *  ParList1,
std::vector< TAbsFitParticle * > *  ParList2,
Double_t  Mass = 0,
Double_t  Width = 0 
)

Definition at line 31 of file TFitConstraintMGaus.cc.

References init(), and setMassConstraint().

  : TFitConstraintM(ParList1, ParList2, Mass ) 
{

  init();
  setMassConstraint( Mass, Width );

}
TFitConstraintMGaus::TFitConstraintMGaus ( const TString &  name,
const TString &  title,
std::vector< TAbsFitParticle * > *  ParList1,
std::vector< TAbsFitParticle * > *  ParList2,
Double_t  Mass = 0,
Double_t  Width = 0 
)

Definition at line 43 of file TFitConstraintMGaus.cc.

References init(), and setMassConstraint().

  : TFitConstraintM( name, title, ParList1, ParList2, Mass )
{

  init();
  setMassConstraint( Mass, Width );

}
TFitConstraintMGaus::~TFitConstraintMGaus ( ) [virtual]

Definition at line 70 of file TFitConstraintMGaus.cc.

                                          {

}

Member Function Documentation

Double_t TFitConstraintMGaus::getCurrentValue ( ) [virtual]

Reimplemented from TFitConstraintM.

Definition at line 105 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_parameters, TFitConstraintM::_ParList1, TFitConstraintM::_ParList2, TFitConstraintM::_TheMassConstraint, and TFitConstraintM::CalcMass().

Referenced by getInfoString().

                                              {
  // Get value of constraint after the fit

  Double_t CurrentValue =
    CalcMass(&_ParList1,false) - 
    CalcMass(&_ParList2,false) - 
    _parameters(0,0)*_TheMassConstraint;

  return CurrentValue;

}
TMatrixD * TFitConstraintMGaus::getDerivativeAlpha ( ) [virtual]

Reimplemented from TAbsFitConstraint.

Definition at line 117 of file TFitConstraintMGaus.cc.

References TFitConstraintM::_TheMassConstraint.

                                                  { 
  // Calculate dF/dAlpha = -1 * M

  TMatrixD* DerivativeMatrix = new TMatrixD(1,1);
  DerivativeMatrix->Zero();

  (*DerivativeMatrix)(0,0) = -1. * _TheMassConstraint;

  return DerivativeMatrix;

}
TString TFitConstraintMGaus::getInfoString ( ) [virtual]

Reimplemented from TFitConstraintM.

Definition at line 129 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_iniparameters, TAbsFitConstraint::_parameters, TFitConstraintM::_TheMassConstraint, _width, 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;
  info << "mean mass: " << _TheMassConstraint << std::endl;
  info << "width: " << _width << std::endl;
  info << "initial mass: " << _iniparameters(0,0)*_TheMassConstraint  << std::endl;
  info << "current mass: " << _parameters(0,0)*_TheMassConstraint  << std::endl;

  return info.str();

}
Double_t TFitConstraintMGaus::getInitValue ( ) [virtual]

Reimplemented from TFitConstraintM.

Definition at line 93 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_iniparameters, TFitConstraintM::_ParList1, TFitConstraintM::_ParList2, TFitConstraintM::_TheMassConstraint, and TFitConstraintM::CalcMass().

Referenced by getInfoString().

                                           {
  // Get initial value of constraint (before the fit)

  Double_t InitValue = 
    CalcMass( &_ParList1, true ) - 
    CalcMass( &_ParList2, true ) - 
    _iniparameters(0,0) * _TheMassConstraint;

  return InitValue;

}
void TFitConstraintMGaus::init ( void  ) [protected]
void TFitConstraintMGaus::print ( void  ) [virtual]

Reimplemented from TFitConstraintM.

Definition at line 150 of file TFitConstraintMGaus.cc.

References getInfoString().

                                {
  // Print constraint contents

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

}
void TFitConstraintMGaus::setMassConstraint ( Double_t  Mass,
Double_t  Width 
)

Definition at line 78 of file TFitConstraintMGaus.cc.

References TAbsFitConstraint::_covMatrix, TFitConstraintM::_TheMassConstraint, _width, Exception, reco::tau::disc::Mass(), and TAbsFitConstraint::setCovMatrix().

Referenced by TFitConstraintMGaus().

                                                                         { 
  
  _TheMassConstraint = Mass;
  _width = Width;
  setCovMatrix( 0 );
  if(!Mass) throw cms::Exception("Configuration")
    << "Error occured!\n"
    << "Object type : TFitConstraintMGaus\n"
    << "Object name : " << GetName() << "\n"
    << "Object title: " << GetTitle() << "\n"
    << "Mass of 0 GeV not supported, please choose a larger mass!\n";
  _covMatrix(0,0) = (Width*Width) / (Mass * Mass);

}

Member Data Documentation

Double_t TFitConstraintMGaus::_width [protected]

Definition at line 36 of file TFitConstraintMGaus.h.

Referenced by getInfoString(), and setMassConstraint().