CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
TFitConstraintEp Class Reference

#include <TFitConstraintEp.h>

Inheritance diagram for TFitConstraintEp:
TAbsFitConstraint

Public Types

enum  component { pX, pY, pZ, E }
 

Public Member Functions

void addParticle (TAbsFitParticle *particle)
 
void addParticles (TAbsFitParticle *p1, TAbsFitParticle *p2=0, TAbsFitParticle *p3=0, TAbsFitParticle *p4=0, TAbsFitParticle *p5=0, TAbsFitParticle *p6=0, TAbsFitParticle *p7=0, TAbsFitParticle *p8=0, TAbsFitParticle *p9=0, TAbsFitParticle *p10=0)
 
virtual Double_t getCurrentValue ()
 
virtual TMatrixD * getDerivative (TAbsFitParticle *particle)
 
virtual TString getInfoString ()
 
virtual Double_t getInitValue ()
 
virtual void print ()
 
void setConstraint (Double_t constraint)
 
 TFitConstraintEp ()
 
 TFitConstraintEp (const TString &name, const TString &title, TFitConstraintEp::component thecomponent, Double_t constraint=0.)
 
 TFitConstraintEp (std::vector< TAbsFitParticle * > *particles, TFitConstraintEp::component thecomponent, Double_t constraint=0.)
 
 TFitConstraintEp (const TString &name, const TString &title, std::vector< TAbsFitParticle * > *particles, TFitConstraintEp::component thecomponent, Double_t constraint=0.)
 
virtual ~TFitConstraintEp ()
 
- Public Member Functions inherited from TAbsFitConstraint
virtual void applyDeltaAlpha (TMatrixD *corrMatrix)
 
virtual const TMatrixD * getCovMatrix () const
 
virtual const TMatrixD * getCovMatrixDeltaAlpha ()
 
virtual const TMatrixD * getCovMatrixFit () const
 
virtual TMatrixD * getDerivativeAlpha ()
 
Int_t getNPar ()
 
const TMatrixD * getParCurr ()
 
const TMatrixD * getParIni ()
 
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 ()
 

Private Attributes

TFitConstraintEp::component _component
 
Double_t _constraint
 
std::vector< TAbsFitParticle * > _particles
 

Additional Inherited Members

- Protected Member Functions inherited from TAbsFitConstraint
void calcCovMatrixDeltaAlpha ()
 
- Protected Attributes inherited from TAbsFitConstraint
TMatrixD _covMatrix
 
TMatrixD _covMatrixDeltaAlpha
 
TMatrixD _covMatrixFit
 
TMatrixD _iniparameters
 
Int_t _nPar
 
TMatrixD _parameters
 

Detailed Description

Definition at line 9 of file TFitConstraintEp.h.

Member Enumeration Documentation

Enumerator
pX 
pY 
pZ 

Definition at line 13 of file TFitConstraintEp.h.

Constructor & Destructor Documentation

TFitConstraintEp::TFitConstraintEp ( )

Definition at line 25 of file TFitConstraintEp.cc.

27  ,_particles(0)
28  ,_constraint(0.)
30 {}
TFitConstraintEp::component _component
std::vector< TAbsFitParticle * > _particles
TFitConstraintEp::TFitConstraintEp ( const TString &  name,
const TString &  title,
TFitConstraintEp::component  thecomponent,
Double_t  constraint = 0. 
)

Definition at line 32 of file TFitConstraintEp.cc.

TFitConstraintEp::TFitConstraintEp ( std::vector< TAbsFitParticle * > *  particles,
TFitConstraintEp::component  thecomponent,
Double_t  constraint = 0. 
)

Definition at line 41 of file TFitConstraintEp.cc.

References _particles.

45  ,_particles(0)
47  ,_component(thecomponent)
48 {
49  // particles: vector containing pointer to TAbsFitParticle objects.
50  // Energy or momentum conservation will be calculated for
51  // those particles.
52  // thecomponent: conserved 4vector component ( pX, pY, pZ, E ). For
53  // full 4vector conservation four objects of type TFitConstraintEp
54  // are needed (four constraints)
55  // constraint:value of energy or momentum constraint ( e.g. sum[ pX_i ] = constraint )
56 
57  if (particles) {
58  _particles = (*particles);
59  }
60 }
TFitConstraintEp::component _component
std::vector< TAbsFitParticle * > _particles
TFitConstraintEp::TFitConstraintEp ( const TString &  name,
const TString &  title,
std::vector< TAbsFitParticle * > *  particles,
TFitConstraintEp::component  thecomponent,
Double_t  constraint = 0. 
)

Definition at line 62 of file TFitConstraintEp.cc.

References _particles.

67  ,_particles(0)
69  ,_component(thecomponent)
70 {
71  // particles: vector containing pointer to TAbsFitParticle objects.
72  // Energy or momentum conservation will be calculated for
73  // those particles.
74  // thecomponent: conserved 4vector component ( pX, pY, pZ, E ). For
75  // full 4vector conservation four objects of type TFitConstraintEp
76  // are needed (four constraints)
77  // constraint:value of energy or momentum constraint ( e.g. sum[ pX_i ] = constraint )
78 
79  if (particles) {
80  _particles = (*particles);
81  }
82 }
TFitConstraintEp::component _component
std::vector< TAbsFitParticle * > _particles
TFitConstraintEp::~TFitConstraintEp ( )
virtual

Definition at line 87 of file TFitConstraintEp.cc.

87  {
88 
89 }

Member Function Documentation

void TFitConstraintEp::addParticle ( TAbsFitParticle particle)

Definition at line 91 of file TFitConstraintEp.cc.

References _particles.

Referenced by addParticles().

91  {
92  // Add one particles to list of constrained particles
93 
94  _particles.push_back( particle );
95 
96 }
std::vector< TAbsFitParticle * > _particles
void TFitConstraintEp::addParticles ( TAbsFitParticle p1,
TAbsFitParticle p2 = 0,
TAbsFitParticle p3 = 0,
TAbsFitParticle p4 = 0,
TAbsFitParticle p5 = 0,
TAbsFitParticle p6 = 0,
TAbsFitParticle p7 = 0,
TAbsFitParticle p8 = 0,
TAbsFitParticle p9 = 0,
TAbsFitParticle p10 = 0 
)

Definition at line 98 of file TFitConstraintEp.cc.

References addParticle().

Referenced by TtSemiLepKinFitter::setupConstraints().

100  {
101  // Add many particles to list of constrained particles
102 
103  if (p1) addParticle( p1 );
104  if (p2) addParticle( p2 );
105  if (p3) addParticle( p3 );
106  if (p4) addParticle( p4 );
107  if (p5) addParticle( p5 );
108  if (p6) addParticle( p6 );
109  if (p7) addParticle( p7 );
110  if (p8) addParticle( p8 );
111  if (p9) addParticle( p9 );
112  if (p10) addParticle( p10 );
113 
114 }
void addParticle(TAbsFitParticle *particle)
Double_t TFitConstraintEp::getCurrentValue ( )
virtual

Implements TAbsFitConstraint.

Definition at line 143 of file TFitConstraintEp.cc.

References _component, _constraint, _particles, mps_fire::i, and createfilelist::int.

Referenced by getInfoString(), and setConstraint().

143  {
144  // Get value of constraint after the fit
145 
146  Double_t CurrentValue(0);
147  UInt_t Npart = _particles.size();
148  for (unsigned int i=0;i<Npart;i++) {
149  const TLorentzVector* FourVec = _particles[i]->getCurr4Vec();
150  CurrentValue += (*FourVec)[(int) _component];
151  }
152  CurrentValue -= _constraint;
153  return CurrentValue;
154 }
TFitConstraintEp::component _component
std::vector< TAbsFitParticle * > _particles
TMatrixD * TFitConstraintEp::getDerivative ( TAbsFitParticle particle)
virtual

Implements TAbsFitConstraint.

Definition at line 119 of file TFitConstraintEp.cc.

References _component, and createfilelist::int.

Referenced by setConstraint().

119  {
120  // returns derivative df/dP with P=(p,E) and f the constraint (f=0).
121  // The matrix contains one row (df/dp, df/dE).
122 
123  TMatrixD* DerivativeMatrix = new TMatrixD(1,4);
124  (*DerivativeMatrix) *= 0.;
125  (*DerivativeMatrix)(0,(int) _component) = 1.;
126  return DerivativeMatrix;
127 }
TFitConstraintEp::component _component
TString TFitConstraintEp::getInfoString ( )
virtual

Reimplemented from TAbsFitConstraint.

Definition at line 156 of file TFitConstraintEp.cc.

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

Referenced by print(), and setConstraint().

156  {
157  // Collect information to be used for printout
158 
159  std::stringstream info;
160  info << std::scientific << std::setprecision(6);
161 
162  info << "__________________________" << std::endl
163  << std::endl;
164  info << "OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << std::endl;
165 
166  info << "initial value: " << getInitValue() << std::endl;
167  info << "current value: " << getCurrentValue() << std::endl;
168  info << "component: " << _component << std::endl;
169  info << "constraint: " << _constraint << std::endl;
170 
171  return info.str();
172 
173 }
static const TGPicture * info(bool iBackgroundIsBlack)
virtual Double_t getCurrentValue()
virtual Double_t getInitValue()
TFitConstraintEp::component _component
Double_t TFitConstraintEp::getInitValue ( )
virtual

Implements TAbsFitConstraint.

Definition at line 130 of file TFitConstraintEp.cc.

References _component, _constraint, _particles, mps_fire::i, and createfilelist::int.

Referenced by getInfoString(), and setConstraint().

130  {
131  // Get initial value of constraint (before the fit)
132 
133  Double_t InitValue(0) ;
134  UInt_t Npart = _particles.size();
135  for (unsigned int i=0;i<Npart;i++) {
136  const TLorentzVector* FourVec = _particles[i]->getIni4Vec();
137  InitValue += (*FourVec)[(int) _component];
138  }
139  InitValue -= _constraint;
140  return InitValue;
141 }
TFitConstraintEp::component _component
std::vector< TAbsFitParticle * > _particles
void TFitConstraintEp::print ( void  )
virtual

Reimplemented from TAbsFitConstraint.

Definition at line 175 of file TFitConstraintEp.cc.

References getInfoString().

Referenced by setConstraint().

175  {
176  // Print constraint contents
177 
178  edm::LogVerbatim("KinFitter") << this->getInfoString();
179 
180 }
virtual TString getInfoString()
void TFitConstraintEp::setConstraint ( Double_t  constraint)
inline

Member Data Documentation

TFitConstraintEp::component TFitConstraintEp::_component
private

Definition at line 57 of file TFitConstraintEp.h.

Referenced by getCurrentValue(), getDerivative(), getInfoString(), and getInitValue().

Double_t TFitConstraintEp::_constraint
private

Definition at line 56 of file TFitConstraintEp.h.

Referenced by getCurrentValue(), getInfoString(), getInitValue(), and setConstraint().

std::vector<TAbsFitParticle*> TFitConstraintEp::_particles
private

Definition at line 55 of file TFitConstraintEp.h.

Referenced by addParticle(), getCurrentValue(), getInitValue(), and TFitConstraintEp().