CMS 3D CMS Logo

TFitParticleECart Class Reference

#include <PhysicsTools/KinFitter/interface/TFitParticleECart.h>

Inheritance diagram for TFitParticleECart:

TAbsFitParticle

List of all members.

Public Member Functions

virtual TLorentzVector * calc4Vec (const TMatrixD *params)
virtual TAbsFitParticleclone (TString newname="") const
virtual TMatrixD * getDerivative ()
virtual void setIni4Vec (const TLorentzVector *pini)
 TFitParticleECart (const TString &name, const TString &title, TLorentzVector *pini, const TMatrixD *theCovMatrix)
 TFitParticleECart (TLorentzVector *pini, const TMatrixD *theCovMatrix)
 TFitParticleECart (const TFitParticleECart &fitParticle)
 TFitParticleECart ()
virtual TMatrixD * transform (const TLorentzVector &vec)
virtual ~TFitParticleECart ()

Protected Member Functions

void init (TLorentzVector *pini, const TMatrixD *theCovMatrix)


Detailed Description

Definition at line 10 of file TFitParticleECart.h.


Constructor & Destructor Documentation

TFitParticleECart::TFitParticleECart (  ) 

Referenced by clone().

TFitParticleECart::TFitParticleECart ( const TFitParticleECart fitParticle  ) 

Definition at line 35 of file TFitParticleECart.cc.

References TAbsFitParticle::_covMatrix, TAbsFitParticle::_iniparameters, TAbsFitParticle::_nPar, TAbsFitParticle::_parameters, TAbsFitParticle::_pcurr, TAbsFitParticle::_pini, TAbsFitParticle::_u1, TAbsFitParticle::_u2, and TAbsFitParticle::_u3.

00036   :TAbsFitParticle( fitParticle.GetName(), fitParticle.GetTitle() )
00037 {
00038 
00039   _nPar = fitParticle._nPar;
00040   _u1 = fitParticle._u1;
00041   _u2 = fitParticle._u2;
00042   _u3 = fitParticle._u3;
00043   _covMatrix.ResizeTo(  fitParticle._covMatrix );
00044   _covMatrix = fitParticle._covMatrix;
00045   _iniparameters.ResizeTo( fitParticle._iniparameters );
00046   _iniparameters = fitParticle._iniparameters;
00047   _parameters.ResizeTo( fitParticle._parameters );
00048   _parameters = fitParticle._parameters;
00049   _pini = fitParticle._pini;
00050   _pcurr = fitParticle._pcurr;
00051 
00052 }

TFitParticleECart::TFitParticleECart ( TLorentzVector *  pini,
const TMatrixD *  theCovMatrix 
)

Definition at line 54 of file TFitParticleECart.cc.

References init().

00055   :TAbsFitParticle()  
00056 {
00057   init(pini, theCovMatrix);
00058 }

TFitParticleECart::TFitParticleECart ( const TString &  name,
const TString &  title,
TLorentzVector *  pini,
const TMatrixD *  theCovMatrix 
)

Definition at line 60 of file TFitParticleECart.cc.

References init().

00062   :TAbsFitParticle(name, title)  
00063 {
00064   init(pini, theCovMatrix);
00065 }

TFitParticleECart::~TFitParticleECart (  )  [virtual]

Definition at line 79 of file TFitParticleECart.cc.

00079                                       {
00080 
00081 }


Member Function Documentation

TLorentzVector * TFitParticleECart::calc4Vec ( const TMatrixD *  params  )  [virtual]

Implements TAbsFitParticle.

Definition at line 94 of file TFitParticleECart.cc.

References TAbsFitParticle::_nPar, and X.

00094                                                                     {
00095   // Calculates a 4vector corresponding to the given
00096   // parameter values
00097 
00098   if (params == 0) {
00099     return 0;
00100   }
00101 
00102   if ( params->GetNcols() != 1 || params->GetNrows() !=_nPar ) {
00103     edm::LogError ("WrongMatrixSize")
00104       << GetName() << "::calc4Vec - Parameter matrix has wrong size.";
00105     return 0;
00106   }
00107   
00108   Double_t X = (*params)(0,0);
00109   Double_t Y = (*params)(1,0);
00110   Double_t Z = (*params)(2,0);
00111   Double_t E = (*params)(3,0);
00112 
00113   TLorentzVector* vec = new TLorentzVector( X, Y, Z, E );
00114   return vec;
00115 
00116 }

TAbsFitParticle * TFitParticleECart::clone ( TString  newname = ""  )  const [virtual]

Implements TAbsFitParticle.

Definition at line 67 of file TFitParticleECart.cc.

References TFitParticleECart().

00067                                                                  {
00068   // Returns a copy of itself
00069 
00070   TAbsFitParticle* myclone = new TFitParticleECart( *this );
00071   if ( newname.Length() > 0 ) myclone->SetName(newname);
00072   return myclone;
00073 
00074 }

TMatrixD * TFitParticleECart::getDerivative (  )  [virtual]

Implements TAbsFitParticle.

Definition at line 160 of file TFitParticleECart.cc.

00160                                            {
00161   // returns derivative dP/dy with P=(p,E) and y=(px, py, pz, d) 
00162   // the free parameters of the fit. The columns of the matrix contain 
00163   // (dP/dpx, dP/dpy, ...).
00164 
00165   TMatrixD* DerivativeMatrix = new TMatrixD(4,4);
00166   (*DerivativeMatrix) *= 0.;
00167 
00168   //1st column: dP/dx
00169   (*DerivativeMatrix)(0,0)=1.;
00170   (*DerivativeMatrix)(1,0)=0.;
00171   (*DerivativeMatrix)(2,0)=0.;
00172   (*DerivativeMatrix)(3,0)=0.;
00173 
00174   //2nd column: dP/dy
00175   (*DerivativeMatrix)(0,1)=0;
00176   (*DerivativeMatrix)(1,1)=1;
00177   (*DerivativeMatrix)(2,1)=0;
00178   (*DerivativeMatrix)(3,1)=0.;
00179 
00180    //3rd column: dP/dz
00181   (*DerivativeMatrix)(0,2)=0.;
00182   (*DerivativeMatrix)(1,2)=0.;
00183   (*DerivativeMatrix)(2,2)=1.;
00184   (*DerivativeMatrix)(3,2)=0.;
00185 
00186    //4th column: dP/dm
00187   (*DerivativeMatrix)(0,3)=0.;
00188   (*DerivativeMatrix)(1,3)=0.;
00189   (*DerivativeMatrix)(2,3)=0.;
00190   (*DerivativeMatrix)(3,3)=1.;
00191 
00192   return DerivativeMatrix;  
00193 }

void TFitParticleECart::init ( TLorentzVector *  pini,
const TMatrixD *  theCovMatrix 
) [protected]

Definition at line 86 of file TFitParticleECart.cc.

References TAbsFitParticle::_nPar, TAbsFitParticle::setCovMatrix(), and setIni4Vec().

Referenced by TFitParticleECart().

00086                                                                                 {
00087 
00088   _nPar = 4;
00089   setIni4Vec(pini);
00090   setCovMatrix(theCovMatrix);
00091 
00092 }

void TFitParticleECart::setIni4Vec ( const TLorentzVector *  pini  )  [virtual]

Implements TAbsFitParticle.

Definition at line 118 of file TFitParticleECart.cc.

References TAbsFitParticle::_iniparameters, TAbsFitParticle::_nPar, TAbsFitParticle::_parameters, TAbsFitParticle::_pcurr, TAbsFitParticle::_pini, TAbsFitParticle::_u1, TAbsFitParticle::_u2, and TAbsFitParticle::_u3.

Referenced by init().

00118                                                              {
00119   // Set the initial 4vector. Will also set the 
00120   // inital parameter values
00121 
00122   if (pini == 0) {
00123 
00124     _u1.SetXYZ(0., 0., 0.);
00125     _u3.SetXYZ(0., 0., 0.);
00126     _u2.SetXYZ(0., 0., 0.);
00127     _pini.SetXYZT(0., 0., 0., 0.);
00128     _pcurr = _pini;
00129 
00130     _iniparameters.ResizeTo(_nPar,1);
00131     _iniparameters(0,0)=0;
00132     _iniparameters(1,0)=0;
00133     _iniparameters(2,0)=0;
00134     _iniparameters(3,0)=0.;
00135 
00136     _parameters.ResizeTo(_nPar,1);
00137     _parameters = _iniparameters;
00138     
00139   } else {
00140     
00141     _pini = (*pini);
00142     _pcurr = _pini;
00143 
00144     _u1.SetXYZ( 1., 0., 0. );
00145     _u2.SetXYZ( 0., 1., 0. );
00146     _u3.SetXYZ( 0., 0., 1. );
00147   
00148     _iniparameters.ResizeTo(_nPar,1);
00149     _iniparameters(0,0)=_pini.X();
00150     _iniparameters(1,0)=_pini.Y();
00151     _iniparameters(2,0)=_pini.Z();
00152     _iniparameters(3,0)=_pini.E();
00153     _parameters.ResizeTo(_nPar,1);
00154     _parameters = _iniparameters;
00155 
00156   }
00157 
00158 }

TMatrixD * TFitParticleECart::transform ( const TLorentzVector &  vec  )  [virtual]

Implements TAbsFitParticle.

Definition at line 195 of file TFitParticleECart.cc.

References TAbsFitParticle::_nPar.

00195                                                                 {
00196   // Returns the parameters corresponding to the given 
00197   // 4vector
00198 
00199   TMatrixD* tparams = new TMatrixD( _nPar, 1 );
00200   (*tparams)(0,0) = vec.X();
00201   (*tparams)(1,0) = vec.Y();
00202   (*tparams)(2,0) = vec.Z();
00203   (*tparams)(3,0) = vec.E();
00204 
00205   return tparams;
00206 
00207 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:33:23 2009 for CMSSW by  doxygen 1.5.4