#include <PhysicsTools/KinFitter/interface/TFitParticleMCPInvSpher.h>
Public Member Functions | |
virtual TLorentzVector * | calc4Vec (const TMatrixD *params) |
virtual TAbsFitParticle * | clone (TString newname="") const |
virtual TMatrixD * | getDerivative () |
void | setIni4Vec (const TVector3 *p, Double_t M) |
virtual void | setIni4Vec (const TLorentzVector *pini) |
TFitParticleMCPInvSpher (const TString &name, const TString &title, TVector3 *p, Double_t M, const TMatrixD *theCovMatrix) | |
TFitParticleMCPInvSpher (TVector3 *p, Double_t M, const TMatrixD *theCovMatrix) | |
TFitParticleMCPInvSpher (const TFitParticleMCPInvSpher &fitParticle) | |
TFitParticleMCPInvSpher () | |
virtual TMatrixD * | transform (const TLorentzVector &vec) |
virtual | ~TFitParticleMCPInvSpher () |
Protected Member Functions | |
void | init (TVector3 *p, Double_t M, const TMatrixD *theCovMatrix) |
Definition at line 9 of file TFitParticleMCPInvSpher.h.
TFitParticleMCPInvSpher::TFitParticleMCPInvSpher | ( | ) |
Referenced by clone().
TFitParticleMCPInvSpher::TFitParticleMCPInvSpher | ( | const TFitParticleMCPInvSpher & | fitParticle | ) |
Definition at line 36 of file TFitParticleMCPInvSpher.cc.
References TAbsFitParticle::_covMatrix, TAbsFitParticle::_iniparameters, TAbsFitParticle::_nPar, TAbsFitParticle::_parameters, TAbsFitParticle::_pcurr, TAbsFitParticle::_pini, TAbsFitParticle::_u1, TAbsFitParticle::_u2, and TAbsFitParticle::_u3.
00037 :TAbsFitParticle( fitParticle.GetName(), fitParticle.GetTitle() ) 00038 { 00039 00040 _nPar = fitParticle._nPar; 00041 _u1 = fitParticle._u1; 00042 _u2 = fitParticle._u2; 00043 _u3 = fitParticle._u3; 00044 _covMatrix.ResizeTo( fitParticle._covMatrix ); 00045 _covMatrix = fitParticle._covMatrix; 00046 _iniparameters.ResizeTo( fitParticle._iniparameters ); 00047 _iniparameters = fitParticle._iniparameters; 00048 _parameters.ResizeTo( fitParticle._parameters ); 00049 _parameters = fitParticle._parameters; 00050 _pini = fitParticle._pini; 00051 _pcurr = fitParticle._pcurr; 00052 00053 }
TFitParticleMCPInvSpher::TFitParticleMCPInvSpher | ( | TVector3 * | p, | |
Double_t | M, | |||
const TMatrixD * | theCovMatrix | |||
) |
Definition at line 55 of file TFitParticleMCPInvSpher.cc.
References init().
00056 :TAbsFitParticle() 00057 { 00058 init(p, M, theCovMatrix); 00059 }
TFitParticleMCPInvSpher::TFitParticleMCPInvSpher | ( | const TString & | name, | |
const TString & | title, | |||
TVector3 * | p, | |||
Double_t | M, | |||
const TMatrixD * | theCovMatrix | |||
) |
Definition at line 61 of file TFitParticleMCPInvSpher.cc.
References init().
00063 :TAbsFitParticle(name, title) 00064 { 00065 init(p, M, theCovMatrix); 00066 }
TFitParticleMCPInvSpher::~TFitParticleMCPInvSpher | ( | ) | [virtual] |
TLorentzVector * TFitParticleMCPInvSpher::calc4Vec | ( | const TMatrixD * | params | ) | [virtual] |
Implements TAbsFitParticle.
Definition at line 96 of file TFitParticleMCPInvSpher.cc.
References TAbsFitParticle::_nPar, TAbsFitParticle::_pini, phi, r, theta, and X.
00096 { 00097 // Calculates a 4vector corresponding to the given 00098 // parameter values 00099 00100 if (params == 0) { 00101 return 0; 00102 } 00103 00104 if ( params->GetNcols() != 1 || params->GetNrows() !=_nPar ) { 00105 edm::LogError ("WrongMatrixSize") 00106 << GetName() << "::calc4Vec - Parameter matrix has wrong size."; 00107 return 0; 00108 } 00109 00110 Double_t r = (*params)(0,0); 00111 Double_t theta = (*params)(1,0); 00112 Double_t phi = (*params)(2,0); 00113 00114 Double_t X = 1/r*TMath::Cos(phi)*TMath::Sin(theta); 00115 Double_t Y = 1/r*TMath::Sin(phi)*TMath::Sin(theta); 00116 Double_t Z = 1/r*TMath::Cos(theta); 00117 Double_t E = TMath::Sqrt( X*X + Y*Y + Z*Z + _pini.M2() ); 00118 00119 TLorentzVector* vec = new TLorentzVector( X, Y, Z, E ); 00120 return vec; 00121 00122 }
TAbsFitParticle * TFitParticleMCPInvSpher::clone | ( | TString | newname = "" |
) | const [virtual] |
Implements TAbsFitParticle.
Definition at line 68 of file TFitParticleMCPInvSpher.cc.
References TFitParticleMCPInvSpher().
00068 { 00069 // Returns a copy of itself 00070 00071 TAbsFitParticle* myclone = new TFitParticleMCPInvSpher( *this ); 00072 if ( newname.Length() > 0 ) myclone->SetName(newname); 00073 return myclone; 00074 00075 }
TMatrixD * TFitParticleMCPInvSpher::getDerivative | ( | ) | [virtual] |
Implements TAbsFitParticle.
Definition at line 174 of file TFitParticleMCPInvSpher.cc.
References TAbsFitParticle::_parameters, TAbsFitParticle::_pcurr, p, phi, r, and theta.
00174 { 00175 // returns derivative dP/dy with P=(p,E) and y=(r, theta, phi) 00176 // the free parameters of the fit. The columns of the matrix contain 00177 // (dP/dr, dP/dtheta, ...). 00178 00179 TMatrixD* DerivativeMatrix = new TMatrixD(4,3); 00180 (*DerivativeMatrix) *= 0.; 00181 00182 Double_t r = _parameters(0,0); 00183 Double_t p = 1./r; 00184 Double_t theta = _parameters(1,0); 00185 Double_t phi = _parameters(2,0); 00186 00187 //1st column: dP/dr 00188 (*DerivativeMatrix)(0,0) = -1.*p*p*TMath::Cos(phi)*TMath::Sin(theta); 00189 (*DerivativeMatrix)(1,0) = -1.*p*p*TMath::Sin(phi)*TMath::Sin(theta); 00190 (*DerivativeMatrix)(2,0) = -1.*p*p*TMath::Cos(theta); 00191 (*DerivativeMatrix)(3,0) = -1.*p*p*p/_pcurr.E(); 00192 00193 //2nd column: dP/dtheta 00194 (*DerivativeMatrix)(0,1) = p*TMath::Cos(phi)*TMath::Cos(theta); 00195 (*DerivativeMatrix)(1,1) = p*TMath::Sin(phi)*TMath::Cos(theta); 00196 (*DerivativeMatrix)(2,1) = -1.*p*TMath::Sin(theta); 00197 (*DerivativeMatrix)(3,1) = 0.; 00198 00199 //3rd column: dP/dphi 00200 (*DerivativeMatrix)(0,2) = -1.*p*TMath::Sin(phi)*TMath::Sin(theta); 00201 (*DerivativeMatrix)(1,2) = p*TMath::Cos(phi)*TMath::Sin(theta);; 00202 (*DerivativeMatrix)(2,2) = 0.; 00203 (*DerivativeMatrix)(3,2) = 0.; 00204 00205 return DerivativeMatrix; 00206 00207 }
void TFitParticleMCPInvSpher::init | ( | TVector3 * | p, | |
Double_t | M, | |||
const TMatrixD * | theCovMatrix | |||
) | [protected] |
Definition at line 88 of file TFitParticleMCPInvSpher.cc.
References TAbsFitParticle::_nPar, TAbsFitParticle::setCovMatrix(), and setIni4Vec().
Referenced by TFitParticleMCPInvSpher().
00088 { 00089 00090 _nPar = 3; 00091 setIni4Vec(p, M); 00092 setCovMatrix(theCovMatrix); 00093 00094 }
void TFitParticleMCPInvSpher::setIni4Vec | ( | const TVector3 * | p, | |
Double_t | M | |||
) |
Definition at line 133 of file TFitParticleMCPInvSpher.cc.
References TAbsFitParticle::_iniparameters, TAbsFitParticle::_nPar, TAbsFitParticle::_parameters, TAbsFitParticle::_pcurr, TAbsFitParticle::_pini, TAbsFitParticle::_u1, TAbsFitParticle::_u2, TAbsFitParticle::_u3, phi, r, and theta.
00133 { 00134 // Set the initial 4vector. Will also set the 00135 // inital parameter values 00136 00137 if ( p == 0 ) { 00138 00139 _u1.SetXYZ(0., 0., 0.); 00140 _u3.SetXYZ(0., 0., 0.); 00141 _u2.SetXYZ(0., 0., 0.); 00142 _pini.SetXYZM(0., 0., 0., M); 00143 _pcurr = _pini; 00144 00145 _iniparameters.ResizeTo(_nPar,1); 00146 _iniparameters(0,0) = 0.; 00147 _parameters.ResizeTo(_nPar,1); 00148 _parameters = _iniparameters; 00149 00150 } else { 00151 00152 _pini.SetXYZM( p->x(), p->y(), p->z(), M); 00153 _pcurr = _pini; 00154 00155 Double_t r = 1/_pini.P(); 00156 Double_t theta = _pini.Theta(); 00157 Double_t phi = _pini.Phi(); 00158 00159 _iniparameters.ResizeTo(_nPar,1); 00160 _iniparameters(0,0) = r; 00161 _iniparameters(1,0) = theta; 00162 _iniparameters(2,0) = phi; 00163 _parameters.ResizeTo(_nPar,1); 00164 _parameters = _iniparameters; 00165 00166 _u1.SetXYZ( TMath::Cos(phi)*TMath::Sin(theta), TMath::Sin(phi)*TMath::Sin(theta), TMath::Cos(theta) ); 00167 _u2.SetXYZ( TMath::Cos(phi)*TMath::Cos(theta), TMath::Sin(phi)*TMath::Cos(theta), -1.*TMath::Sin(theta) ); 00168 _u3.SetXYZ( -1.*TMath::Sin(phi), TMath::Cos(phi), 0. ); 00169 00170 } 00171 00172 }
void TFitParticleMCPInvSpher::setIni4Vec | ( | const TLorentzVector * | pini | ) | [virtual] |
Implements TAbsFitParticle.
Definition at line 124 of file TFitParticleMCPInvSpher.cc.
References muonGeometry::TVector3().
Referenced by init().
00124 { 00125 // Set the initial 4vector. Will also set the 00126 // inital parameter values 00127 00128 TVector3 vec( pini->Vect() ); 00129 setIni4Vec( &vec, pini->M() ); 00130 00131 }
TMatrixD * TFitParticleMCPInvSpher::transform | ( | const TLorentzVector & | vec | ) | [virtual] |
Implements TAbsFitParticle.
Definition at line 209 of file TFitParticleMCPInvSpher.cc.
References TAbsFitParticle::_nPar.
00209 { 00210 // Returns the parameters corresponding to the given 00211 // 4vector 00212 00213 // retrieve parameters 00214 TMatrixD* tparams = new TMatrixD( _nPar, 1 ); 00215 (*tparams)(0,0) = 1./vec.P(); 00216 (*tparams)(1,0) = vec.Theta(); 00217 (*tparams)(2,0) = vec.Phi(); 00218 00219 return tparams; 00220 00221 }