CMS 3D CMS Logo

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

#include <TFitParticleECart.h>

Inheritance diagram for TFitParticleECart:
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
 
 TFitParticleECart ()
 
 TFitParticleECart (const TFitParticleECart &fitParticle)
 
 TFitParticleECart (const TString &name, const TString &title, TLorentzVector *pini, const TMatrixD *theCovMatrix)
 
 TFitParticleECart (TLorentzVector *pini, const TMatrixD *theCovMatrix)
 
TMatrixD * transform (const TLorentzVector &vec) override
 
 ~TFitParticleECart () 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 (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 8 of file TFitParticleECart.h.

Constructor & Destructor Documentation

◆ TFitParticleECart() [1/4]

TFitParticleECart::TFitParticleECart ( )

Definition at line 24 of file TFitParticleECart.cc.

24 : TAbsFitParticle() { init(nullptr, nullptr); }

References init().

Referenced by clone().

◆ TFitParticleECart() [2/4]

TFitParticleECart::TFitParticleECart ( const TFitParticleECart fitParticle)

Definition at line 26 of file TFitParticleECart.cc.

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

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

◆ TFitParticleECart() [3/4]

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

Definition at line 42 of file TFitParticleECart.cc.

42  : TAbsFitParticle() {
43  init(pini, theCovMatrix);
44 }

References init().

◆ TFitParticleECart() [4/4]

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

Definition at line 46 of file TFitParticleECart.cc.

51  init(pini, theCovMatrix);
52 }

References init().

◆ ~TFitParticleECart()

TFitParticleECart::~TFitParticleECart ( )
override

Definition at line 66 of file TFitParticleECart.cc.

66 {}

Member Function Documentation

◆ calc4Vec()

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

Implements TAbsFitParticle.

Definition at line 77 of file TFitParticleECart.cc.

77  {
78  // Calculates a 4vector corresponding to the given
79  // parameter values
80 
81  if (params == nullptr) {
82  return nullptr;
83  }
84 
85  if (params->GetNcols() != 1 || params->GetNrows() != _nPar) {
86  edm::LogError("WrongMatrixSize") << GetName() << "::calc4Vec - Parameter matrix has wrong size.";
87  return nullptr;
88  }
89 
90  Double_t X = (*params)(0, 0);
91  Double_t Y = (*params)(1, 0);
92  Double_t Z = (*params)(2, 0);
93  Double_t E = (*params)(3, 0);
94 
95  TLorentzVector* vec = new TLorentzVector(X, Y, Z, E);
96  return vec;
97 }

References TAbsFitParticle::_nPar, CalibrationSummaryClient_cfi::params, X, BeamSpotPI::Y, and BeamSpotPI::Z.

◆ clone()

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

Implements TAbsFitParticle.

Definition at line 54 of file TFitParticleECart.cc.

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

References TFitParticleECart().

◆ getDerivative()

TMatrixD * TFitParticleECart::getDerivative ( )
overridevirtual

Implements TAbsFitParticle.

Definition at line 137 of file TFitParticleECart.cc.

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

◆ init()

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

Definition at line 71 of file TFitParticleECart.cc.

71  {
72  _nPar = 4;
73  setIni4Vec(pini);
74  setCovMatrix(theCovMatrix);
75 }

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

Referenced by TFitParticleECart().

◆ setIni4Vec()

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

Implements TAbsFitParticle.

Definition at line 99 of file TFitParticleECart.cc.

99  {
100  // Set the initial 4vector. Will also set the
101  // inital parameter values
102 
103  if (pini == nullptr) {
104  _u1.SetXYZ(0., 0., 0.);
105  _u3.SetXYZ(0., 0., 0.);
106  _u2.SetXYZ(0., 0., 0.);
107  _pini.SetXYZT(0., 0., 0., 0.);
108  _pcurr = _pini;
109 
110  _iniparameters.ResizeTo(_nPar, 1);
111  _iniparameters(0, 0) = 0;
112  _iniparameters(1, 0) = 0;
113  _iniparameters(2, 0) = 0;
114  _iniparameters(3, 0) = 0.;
115 
116  _parameters.ResizeTo(_nPar, 1);
118 
119  } else {
120  _pini = (*pini);
121  _pcurr = _pini;
122 
123  _u1.SetXYZ(1., 0., 0.);
124  _u2.SetXYZ(0., 1., 0.);
125  _u3.SetXYZ(0., 0., 1.);
126 
127  _iniparameters.ResizeTo(_nPar, 1);
128  _iniparameters(0, 0) = _pini.X();
129  _iniparameters(1, 0) = _pini.Y();
130  _iniparameters(2, 0) = _pini.Z();
131  _iniparameters(3, 0) = _pini.E();
132  _parameters.ResizeTo(_nPar, 1);
134  }
135 }

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

Referenced by init().

◆ transform()

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

Implements TAbsFitParticle.

Definition at line 172 of file TFitParticleECart.cc.

172  {
173  // Returns the parameters corresponding to the given
174  // 4vector
175 
176  TMatrixD* tparams = new TMatrixD(_nPar, 1);
177  (*tparams)(0, 0) = vec.X();
178  (*tparams)(1, 0) = vec.Y();
179  (*tparams)(2, 0) = vec.Z();
180  (*tparams)(3, 0) = vec.E();
181 
182  return tparams;
183 }

References TAbsFitParticle::_nPar.

TAbsFitParticle::_iniparameters
TMatrixD _iniparameters
Definition: TAbsFitParticle.h:58
TFitParticleECart::TFitParticleECart
TFitParticleECart()
Definition: TFitParticleECart.cc:24
TFitParticleECart::init
void init(TLorentzVector *pini, const TMatrixD *theCovMatrix)
Definition: TFitParticleECart.cc:71
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
X
#define X(str)
Definition: MuonsGrabber.cc:38
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
TAbsFitParticle::_parameters
TMatrixD _parameters
Definition: TAbsFitParticle.h:59
TAbsFitParticle::_pcurr
TLorentzVector _pcurr
Definition: TAbsFitParticle.h:61
TAbsFitParticle::_pini
TLorentzVector _pini
Definition: TAbsFitParticle.h:60
TAbsFitParticle::_covMatrix
TMatrixD _covMatrix
Definition: TAbsFitParticle.h:54
TFitParticleECart::setIni4Vec
void setIni4Vec(const TLorentzVector *pini) override
Definition: TFitParticleECart.cc:99
TAbsFitParticle::_u2
TVector3 _u2
Definition: TAbsFitParticle.h:51
TAbsFitParticle::_nPar
Int_t _nPar
Definition: TAbsFitParticle.h:49
TAbsFitParticle
Definition: TAbsFitParticle.h:9
TAbsFitParticle::setCovMatrix
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
Definition: TAbsFitParticle.cc:98
TAbsFitParticle::TAbsFitParticle
TAbsFitParticle()
Definition: TAbsFitParticle.cc:18
TAbsFitParticle::_u3
TVector3 _u3
Definition: TAbsFitParticle.h:52
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
TAbsFitParticle::_u1
TVector3 _u1
Definition: TAbsFitParticle.h:50
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
BeamSpotPI::Y
Definition: BeamSpotPayloadInspectorHelper.h:31
BeamSpotPI::Z
Definition: BeamSpotPayloadInspectorHelper.h:32