CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions
TFitParticleECart Class Reference

#include <TFitParticleECart.h>

Inheritance diagram for TFitParticleECart:
TAbsFitParticle

Public Member Functions

virtual TLorentzVector * calc4Vec (const TMatrixD *params)
 
virtual TAbsFitParticleclone (const TString &newname=TString("")) const
 
virtual TMatrixD * getDerivative ()
 
virtual void setIni4Vec (const TLorentzVector *pini)
 
 TFitParticleECart ()
 
 TFitParticleECart (const TFitParticleECart &fitParticle)
 
 TFitParticleECart (TLorentzVector *pini, const TMatrixD *theCovMatrix)
 
 TFitParticleECart (const TString &name, const TString &title, TLorentzVector *pini, const TMatrixD *theCovMatrix)
 
virtual TMatrixD * transform (const TLorentzVector &vec)
 
virtual ~TFitParticleECart ()
 
- Public Member Functions inherited from TAbsFitParticle
virtual void applycorr (TMatrixD *corrMatrix)
 
virtual const TMatrixD * getCovMatrix () const
 
virtual const TMatrixD * getCovMatrixDeltaY ()
 
virtual const TMatrixD * getCovMatrixFit () const
 
const TLorentzVector * getCurr4Vec ()
 
TString getInfoString ()
 
const TLorentzVector * getIni4Vec ()
 
Int_t getNPar () const
 
const TMatrixD * getParCurr ()
 
const TMatrixD * getParIni ()
 
virtual const TMatrixD * getPull ()
 
const TVector3 * getu1 ()
 
const TVector3 * getu2 ()
 
const TVector3 * getu3 ()
 
virtual void print ()
 
virtual void reset ()
 
virtual void setCovMatrix (const TMatrixD *theCovMatrix)
 
virtual void setCovMatrixFit (const TMatrixD *theCovMatrixFit)
 
void setParIni (const TMatrixD *parini)
 
 TAbsFitParticle ()
 
 TAbsFitParticle (const TString &name, const TString &title)
 
virtual ~TAbsFitParticle ()
 

Protected Member Functions

void init (TLorentzVector *pini, const TMatrixD *theCovMatrix)
 
- Protected Member Functions inherited from TAbsFitParticle
void calcCovMatrixDeltaY ()
 

Additional Inherited Members

- Protected Attributes inherited from TAbsFitParticle
TMatrixD _covMatrix
 
TMatrixD _covMatrixDeltaY
 
TMatrixD _covMatrixFit
 
TMatrixD _iniparameters
 
Int_t _nPar
 
TMatrixD _parameters
 
TLorentzVector _pcurr
 
TLorentzVector _pini
 
TMatrixD _pull
 
TVector3 _u1
 
TVector3 _u2
 
TVector3 _u3
 

Detailed Description

Definition at line 10 of file TFitParticleECart.h.

Constructor & Destructor Documentation

TFitParticleECart::TFitParticleECart ( )

Definition at line 26 of file TFitParticleECart.cc.

References init().

Referenced by clone().

27  :TAbsFitParticle()
28 {
29  init(0, 0);
30 }
void init(TLorentzVector *pini, const TMatrixD *theCovMatrix)
TFitParticleECart::TFitParticleECart ( const TFitParticleECart fitParticle)

Definition at line 32 of file TFitParticleECart.cc.

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

33  :TAbsFitParticle( fitParticle.GetName(), fitParticle.GetTitle() )
34 {
35 
36  _nPar = fitParticle._nPar;
37  _u1 = fitParticle._u1;
38  _u2 = fitParticle._u2;
39  _u3 = fitParticle._u3;
40  _covMatrix.ResizeTo( fitParticle._covMatrix );
41  _covMatrix = fitParticle._covMatrix;
42  _iniparameters.ResizeTo( fitParticle._iniparameters );
43  _iniparameters = fitParticle._iniparameters;
44  _parameters.ResizeTo( fitParticle._parameters );
45  _parameters = fitParticle._parameters;
46  _pini = fitParticle._pini;
47  _pcurr = fitParticle._pcurr;
48 
49 }
TLorentzVector _pini
TMatrixD _parameters
TLorentzVector _pcurr
TMatrixD _iniparameters
TFitParticleECart::TFitParticleECart ( TLorentzVector *  pini,
const TMatrixD *  theCovMatrix 
)

Definition at line 51 of file TFitParticleECart.cc.

References init().

52  :TAbsFitParticle()
53 {
54  init(pini, theCovMatrix);
55 }
void init(TLorentzVector *pini, const TMatrixD *theCovMatrix)
TFitParticleECart::TFitParticleECart ( const TString &  name,
const TString &  title,
TLorentzVector *  pini,
const TMatrixD *  theCovMatrix 
)

Definition at line 57 of file TFitParticleECart.cc.

References init().

60 {
61  init(pini, theCovMatrix);
62 }
void init(TLorentzVector *pini, const TMatrixD *theCovMatrix)
TFitParticleECart::~TFitParticleECart ( )
virtual

Definition at line 76 of file TFitParticleECart.cc.

76  {
77 
78 }

Member Function Documentation

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

Implements TAbsFitParticle.

Definition at line 91 of file TFitParticleECart.cc.

References TAbsFitParticle::_nPar, X, and Gflash::Z.

91  {
92  // Calculates a 4vector corresponding to the given
93  // parameter values
94 
95  if (params == 0) {
96  return 0;
97  }
98 
99  if ( params->GetNcols() != 1 || params->GetNrows() !=_nPar ) {
100  edm::LogError ("WrongMatrixSize")
101  << GetName() << "::calc4Vec - Parameter matrix has wrong size.";
102  return 0;
103  }
104 
105  Double_t X = (*params)(0,0);
106  Double_t Y = (*params)(1,0);
107  Double_t Z = (*params)(2,0);
108  Double_t E = (*params)(3,0);
109 
110  TLorentzVector* vec = new TLorentzVector( X, Y, Z, E );
111  return vec;
112 
113 }
const double Z[kNumberCalorimeter]
#define X(str)
Definition: MuonsGrabber.cc:48
TAbsFitParticle * TFitParticleECart::clone ( const TString &  newname = TString("")) const
virtual

Implements TAbsFitParticle.

Definition at line 64 of file TFitParticleECart.cc.

References TFitParticleECart().

64  {
65  // Returns a copy of itself
66 
67  TAbsFitParticle* myclone = new TFitParticleECart( *this );
68  if ( newname.Length() > 0 ) myclone->SetName(newname);
69  return myclone;
70 
71 }
TMatrixD * TFitParticleECart::getDerivative ( )
virtual

Implements TAbsFitParticle.

Definition at line 157 of file TFitParticleECart.cc.

157  {
158  // returns derivative dP/dy with P=(p,E) and y=(px, py, pz, d)
159  // the free parameters of the fit. The columns of the matrix contain
160  // (dP/dpx, dP/dpy, ...).
161 
162  TMatrixD* DerivativeMatrix = new TMatrixD(4,4);
163  (*DerivativeMatrix) *= 0.;
164 
165  //1st column: dP/dx
166  (*DerivativeMatrix)(0,0)=1.;
167  (*DerivativeMatrix)(1,0)=0.;
168  (*DerivativeMatrix)(2,0)=0.;
169  (*DerivativeMatrix)(3,0)=0.;
170 
171  //2nd column: dP/dy
172  (*DerivativeMatrix)(0,1)=0;
173  (*DerivativeMatrix)(1,1)=1;
174  (*DerivativeMatrix)(2,1)=0;
175  (*DerivativeMatrix)(3,1)=0.;
176 
177  //3rd column: dP/dz
178  (*DerivativeMatrix)(0,2)=0.;
179  (*DerivativeMatrix)(1,2)=0.;
180  (*DerivativeMatrix)(2,2)=1.;
181  (*DerivativeMatrix)(3,2)=0.;
182 
183  //4th column: dP/dm
184  (*DerivativeMatrix)(0,3)=0.;
185  (*DerivativeMatrix)(1,3)=0.;
186  (*DerivativeMatrix)(2,3)=0.;
187  (*DerivativeMatrix)(3,3)=1.;
188 
189  return DerivativeMatrix;
190 }
void TFitParticleECart::init ( TLorentzVector *  pini,
const TMatrixD *  theCovMatrix 
)
protected

Definition at line 83 of file TFitParticleECart.cc.

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

Referenced by TFitParticleECart().

83  {
84 
85  _nPar = 4;
86  setIni4Vec(pini);
87  setCovMatrix(theCovMatrix);
88 
89 }
virtual void setIni4Vec(const TLorentzVector *pini)
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
void TFitParticleECart::setIni4Vec ( const TLorentzVector *  pini)
virtual

Implements TAbsFitParticle.

Definition at line 115 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().

115  {
116  // Set the initial 4vector. Will also set the
117  // inital parameter values
118 
119  if (pini == 0) {
120 
121  _u1.SetXYZ(0., 0., 0.);
122  _u3.SetXYZ(0., 0., 0.);
123  _u2.SetXYZ(0., 0., 0.);
124  _pini.SetXYZT(0., 0., 0., 0.);
125  _pcurr = _pini;
126 
127  _iniparameters.ResizeTo(_nPar,1);
128  _iniparameters(0,0)=0;
129  _iniparameters(1,0)=0;
130  _iniparameters(2,0)=0;
131  _iniparameters(3,0)=0.;
132 
133  _parameters.ResizeTo(_nPar,1);
135 
136  } else {
137 
138  _pini = (*pini);
139  _pcurr = _pini;
140 
141  _u1.SetXYZ( 1., 0., 0. );
142  _u2.SetXYZ( 0., 1., 0. );
143  _u3.SetXYZ( 0., 0., 1. );
144 
145  _iniparameters.ResizeTo(_nPar,1);
146  _iniparameters(0,0)=_pini.X();
147  _iniparameters(1,0)=_pini.Y();
148  _iniparameters(2,0)=_pini.Z();
149  _iniparameters(3,0)=_pini.E();
150  _parameters.ResizeTo(_nPar,1);
152 
153  }
154 
155 }
TLorentzVector _pini
TMatrixD _parameters
TLorentzVector _pcurr
TMatrixD _iniparameters
TMatrixD * TFitParticleECart::transform ( const TLorentzVector &  vec)
virtual

Implements TAbsFitParticle.

Definition at line 192 of file TFitParticleECart.cc.

References TAbsFitParticle::_nPar.

192  {
193  // Returns the parameters corresponding to the given
194  // 4vector
195 
196  TMatrixD* tparams = new TMatrixD( _nPar, 1 );
197  (*tparams)(0,0) = vec.X();
198  (*tparams)(1,0) = vec.Y();
199  (*tparams)(2,0) = vec.Z();
200  (*tparams)(3,0) = vec.E();
201 
202  return tparams;
203 
204 }