CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_6/src/PhysicsTools/KinFitter/interface/TFitConstraintEp.h

Go to the documentation of this file.
00001 #ifndef TFitConstraintEp_hh
00002 #define TFitConstraintEp_hh
00003 
00004 #include "PhysicsTools/KinFitter/interface/TAbsFitConstraint.h"
00005 #include "PhysicsTools/KinFitter/interface/TAbsFitParticle.h"
00006 #include "TMatrixD.h"
00007 #include <vector>
00008 
00009 class TFitConstraintEp: public TAbsFitConstraint {
00010 
00011 public :
00012 
00013   enum component {
00014     pX,
00015     pY,
00016     pZ,
00017     E
00018   };
00019 
00020   TFitConstraintEp( );
00021 
00022   TFitConstraintEp(  const TString &name, const TString &title,
00023                      TFitConstraintEp::component thecomponent,
00024                      Double_t constraint = 0.);
00025 
00026   TFitConstraintEp(  std::vector<TAbsFitParticle*>* particles, 
00027                      TFitConstraintEp::component thecomponent, 
00028                      Double_t constraint = 0.);
00029 
00030   TFitConstraintEp(  const TString &name, const TString &title,
00031                      std::vector<TAbsFitParticle*>* particles, 
00032                      TFitConstraintEp::component thecomponent, 
00033                      Double_t constraint = 0.);
00034   virtual ~TFitConstraintEp();
00035 
00036   void addParticle( TAbsFitParticle* particle );
00037   void addParticles( TAbsFitParticle* p1, TAbsFitParticle* p2 = 0, TAbsFitParticle* p3 = 0, TAbsFitParticle* p4 = 0,
00038                      TAbsFitParticle* p5 = 0, TAbsFitParticle* p6 = 0, TAbsFitParticle* p7 = 0, TAbsFitParticle* p8 = 0,
00039                      TAbsFitParticle* p9 = 0, TAbsFitParticle* p10 = 0);
00040   void setConstraint(Double_t constraint){_constraint = constraint;};
00041 
00042   // returns derivative df/dP with P=(p,E) and f the constraint f=0.
00043   // The matrix contains one row (df/dp, df/dE).
00044   virtual TMatrixD* getDerivative( TAbsFitParticle* particle );
00045   virtual Double_t getInitValue();
00046   virtual Double_t getCurrentValue();
00047 
00048   virtual TString getInfoString();
00049   virtual void print(); 
00050  
00051 protected :
00052 
00053 
00054 private:
00055   std::vector<TAbsFitParticle*> _particles;    // Vector containing constrained particles
00056   Double_t _constraint;                   // Value of constraint
00057   TFitConstraintEp::component _component; // 4vector component to be constrained
00058 
00059 };
00060 
00061 #endif