CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions
TFitParticleMCCart Class Reference

#include <TFitParticleMCCart.h>

Inheritance diagram for TFitParticleMCCart:
TAbsFitParticle

Public Member Functions

TLorentzVector * calc4Vec (const TMatrixD *params) override
 
TAbsFitParticleclone (const TString &newname=TString("")) const override
 
TMatrixD * getDerivative () override
 
void setIni4Vec (const TLorentzVector *pini) override
 
void setIni4Vec (const TVector3 *p, Double_t M)
 
 TFitParticleMCCart ()
 
 TFitParticleMCCart (const TFitParticleMCCart &fitParticle)
 
 TFitParticleMCCart (TVector3 *p, Double_t M, const TMatrixD *theCovMatrix)
 
 TFitParticleMCCart (const TString &name, const TString &title, TVector3 *p, Double_t M, const TMatrixD *theCovMatrix)
 
TMatrixD * transform (const TLorentzVector &vec) override
 
 ~TFitParticleMCCart () override
 
- 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)
 
 ~TAbsFitParticle () override
 

Protected Member Functions

void init (TVector3 *p, Double_t M, 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 9 of file TFitParticleMCCart.h.

Constructor & Destructor Documentation

◆ TFitParticleMCCart() [1/4]

TFitParticleMCCart::TFitParticleMCCart ( )

Definition at line 25 of file TFitParticleMCCart.cc.

References init().

Referenced by clone().

25 : TAbsFitParticle() { init(nullptr, 0., nullptr); }
void init(TVector3 *p, Double_t M, const TMatrixD *theCovMatrix)

◆ TFitParticleMCCart() [2/4]

TFitParticleMCCart::TFitParticleMCCart ( const TFitParticleMCCart fitParticle)

Definition at line 27 of file TFitParticleMCCart.cc.

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

28  : TAbsFitParticle(fitParticle.GetName(), fitParticle.GetTitle()) {
29  _nPar = fitParticle._nPar;
30  _u1 = fitParticle._u1;
31  _u2 = fitParticle._u2;
32  _u3 = fitParticle._u3;
33  _covMatrix.ResizeTo(fitParticle._covMatrix);
34  _covMatrix = fitParticle._covMatrix;
35  _iniparameters.ResizeTo(fitParticle._iniparameters);
36  _iniparameters = fitParticle._iniparameters;
37  _parameters.ResizeTo(fitParticle._parameters);
38  _parameters = fitParticle._parameters;
39  _pini = fitParticle._pini;
40  _pcurr = fitParticle._pcurr;
41 }
TLorentzVector _pini
TMatrixD _parameters
TLorentzVector _pcurr
TMatrixD _iniparameters

◆ TFitParticleMCCart() [3/4]

TFitParticleMCCart::TFitParticleMCCart ( TVector3 *  p,
Double_t  M,
const TMatrixD *  theCovMatrix 
)

Definition at line 43 of file TFitParticleMCCart.cc.

References init(), and AlCaHLTBitMon_ParallelJobs::p.

43  : TAbsFitParticle() {
44  init(p, M, theCovMatrix);
45 }
void init(TVector3 *p, Double_t M, const TMatrixD *theCovMatrix)

◆ TFitParticleMCCart() [4/4]

TFitParticleMCCart::TFitParticleMCCart ( const TString &  name,
const TString &  title,
TVector3 *  p,
Double_t  M,
const TMatrixD *  theCovMatrix 
)

Definition at line 47 of file TFitParticleMCCart.cc.

References init(), and AlCaHLTBitMon_ParallelJobs::p.

50  init(p, M, theCovMatrix);
51 }
void init(TVector3 *p, Double_t M, const TMatrixD *theCovMatrix)

◆ ~TFitParticleMCCart()

TFitParticleMCCart::~TFitParticleMCCart ( )
override

Definition at line 65 of file TFitParticleMCCart.cc.

65 {}

Member Function Documentation

◆ calc4Vec()

TLorentzVector * TFitParticleMCCart::calc4Vec ( const TMatrixD *  params)
overridevirtual

Implements TAbsFitParticle.

Definition at line 76 of file TFitParticleMCCart.cc.

References TAbsFitParticle::_nPar, TAbsFitParticle::_pini, submitPVValidationJobs::params, X, beamSpotPI::Y, and beamSpotPI::Z.

76  {
77  // Calculates a 4vector corresponding to the given
78  // parameter values
79 
80  if (params == nullptr) {
81  return nullptr;
82  }
83 
84  if (params->GetNcols() != 1 || params->GetNrows() != _nPar) {
85  edm::LogError("WrongMatrixSize") << GetName() << "::calc4Vec - Parameter matrix has wrong size.";
86  return nullptr;
87  }
88 
89  Double_t X = (*params)(0, 0);
90  Double_t Y = (*params)(1, 0);
91  Double_t Z = (*params)(2, 0);
92  Double_t E = TMath::Sqrt(X * X + Y * Y + Z * Z + _pini.M2());
93 
94  TLorentzVector* vec = new TLorentzVector(X, Y, Z, E);
95  return vec;
96 }
#define X(str)
Definition: MuonsGrabber.cc:38
Log< level::Error, false > LogError
TLorentzVector _pini

◆ clone()

TAbsFitParticle * TFitParticleMCCart::clone ( const TString &  newname = TString("")) const
overridevirtual

Implements TAbsFitParticle.

Definition at line 53 of file TFitParticleMCCart.cc.

References TFitParticleMCCart().

53  {
54  // Returns a copy of itself
55 
56  TAbsFitParticle* myclone = new TFitParticleMCCart(*this);
57  if (newname.Length() > 0)
58  myclone->SetName(newname);
59  return myclone;
60 }

◆ getDerivative()

TMatrixD * TFitParticleMCCart::getDerivative ( )
overridevirtual

Implements TAbsFitParticle.

Definition at line 138 of file TFitParticleMCCart.cc.

References TAbsFitParticle::_parameters, and TAbsFitParticle::_pcurr.

138  {
139  // returns derivative dP/dy with P=(p,E) and y=(px, py, pz)
140  // the free parameters of the fit. The columns of the matrix contain
141  // (dP/dpx, dP/dpy, ...).
142 
143  TMatrixD* DerivativeMatrix = new TMatrixD(4, 3);
144  (*DerivativeMatrix) *= 0.;
145 
146  //1st column: dP/dx
147  (*DerivativeMatrix)(0, 0) = 1.;
148  (*DerivativeMatrix)(1, 0) = 0.;
149  (*DerivativeMatrix)(2, 0) = 0.;
150  (*DerivativeMatrix)(3, 0) = _parameters(0, 0) / _pcurr.E();
151 
152  //2nd column: dP/dy
153  (*DerivativeMatrix)(0, 1) = 0.;
154  (*DerivativeMatrix)(1, 1) = 1.;
155  (*DerivativeMatrix)(2, 1) = 0.;
156  (*DerivativeMatrix)(3, 1) = _parameters(1, 0) / _pcurr.E();
157 
158  //3rd column: dP/dz
159  (*DerivativeMatrix)(0, 2) = 0.;
160  (*DerivativeMatrix)(1, 2) = 0.;
161  (*DerivativeMatrix)(2, 2) = 1.;
162  (*DerivativeMatrix)(3, 2) = _parameters(2, 0) / _pcurr.E();
163 
164  return DerivativeMatrix;
165 }
TMatrixD _parameters
TLorentzVector _pcurr

◆ init()

void TFitParticleMCCart::init ( TVector3 *  p,
Double_t  M,
const TMatrixD *  theCovMatrix 
)
protected

Definition at line 70 of file TFitParticleMCCart.cc.

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

Referenced by TFitParticleMCCart().

70  {
71  _nPar = 3;
72  setIni4Vec(p, M);
73  setCovMatrix(theCovMatrix);
74 }
void setIni4Vec(const TLorentzVector *pini) override
virtual void setCovMatrix(const TMatrixD *theCovMatrix)

◆ setIni4Vec() [1/2]

void TFitParticleMCCart::setIni4Vec ( const TLorentzVector *  pini)
overridevirtual

Implements TAbsFitParticle.

Definition at line 98 of file TFitParticleMCCart.cc.

Referenced by init().

98  {
99  // Set the initial 4vector. Will also set the
100  // inital parameter values
101 
102  TVector3 vec(pini->Vect());
103  setIni4Vec(&vec, pini->M());
104 }
void setIni4Vec(const TLorentzVector *pini) override

◆ setIni4Vec() [2/2]

void TFitParticleMCCart::setIni4Vec ( const TVector3 *  p,
Double_t  M 
)

Definition at line 106 of file TFitParticleMCCart.cc.

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

106  {
107  // Set the initial 4vector. Will also set the
108  // inital parameter values
109 
110  if (p == nullptr) {
111  _iniparameters.ResizeTo(_nPar, 1);
112  _iniparameters(0, 0) = 0.;
113  _iniparameters(1, 0) = 0.;
114  _iniparameters(2, 0) = 0.;
115  _parameters.ResizeTo(_nPar, 1);
117 
118  _pini.SetXYZM(0., 0., 0., M);
119  _pcurr = _pini;
120 
121  } else {
122  _iniparameters.ResizeTo(_nPar, 1);
123  _iniparameters(0, 0) = p->x();
124  _iniparameters(1, 0) = p->y();
125  _iniparameters(2, 0) = p->z();
126  _parameters.ResizeTo(_nPar, 1);
128 
129  _pini.SetXYZM(p->x(), p->y(), p->z(), M);
130  _pcurr = _pini;
131 
132  _u1.SetXYZ(1., 0., 0.);
133  _u2.SetXYZ(0., 1., 0.);
134  _u3.SetXYZ(0., 0., 1.);
135  }
136 }
TLorentzVector _pini
TMatrixD _parameters
TLorentzVector _pcurr
TMatrixD _iniparameters

◆ transform()

TMatrixD * TFitParticleMCCart::transform ( const TLorentzVector &  vec)
overridevirtual

Implements TAbsFitParticle.

Definition at line 167 of file TFitParticleMCCart.cc.

References TAbsFitParticle::_nPar.

167  {
168  // Returns the parameters corresponding to the given
169  // 4vector
170 
171  TVector3 vec3(vec.Vect());
172 
173  // retrieve parameters
174  TMatrixD* tparams = new TMatrixD(_nPar, 1);
175  (*tparams)(0, 0) = vec3.x();
176  (*tparams)(1, 0) = vec3.y();
177  (*tparams)(2, 0) = vec3.z();
178 
179  return tparams;
180 }
std::vector< vec2 > vec3
Definition: HCALResponse.h:17