CMS 3D CMS Logo

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

#include <TFitParticleEtEtaPhi.h>

Inheritance diagram for TFitParticleEtEtaPhi:
TAbsFitParticle

Public Member Functions

TLorentzVector * calc4Vec (const TMatrixD *params) override
 
TAbsFitParticleclone (const TString &newname="") const override
 
TMatrixD * getDerivative () override
 
void setIni4Vec (const TLorentzVector *pini) override
 
 TFitParticleEtEtaPhi ()
 
 TFitParticleEtEtaPhi (const TFitParticleEtEtaPhi &fitParticle)
 
 TFitParticleEtEtaPhi (const TString &name, const TString &title, TLorentzVector *pini, const TMatrixD *theCovMatrix)
 
 TFitParticleEtEtaPhi (TLorentzVector *pini, const TMatrixD *theCovMatrix)
 
TMatrixD * transform (const TLorentzVector &vec) override
 
 ~TFitParticleEtEtaPhi () 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 TFitParticleEtEtaPhi.h.

Constructor & Destructor Documentation

◆ TFitParticleEtEtaPhi() [1/4]

TFitParticleEtEtaPhi::TFitParticleEtEtaPhi ( )

Definition at line 27 of file TFitParticleEtEtaPhi.cc.

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

References init().

Referenced by clone().

◆ TFitParticleEtEtaPhi() [2/4]

TFitParticleEtEtaPhi::TFitParticleEtEtaPhi ( const TFitParticleEtEtaPhi fitParticle)

Definition at line 29 of file TFitParticleEtEtaPhi.cc.

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

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

◆ TFitParticleEtEtaPhi() [3/4]

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

Definition at line 45 of file TFitParticleEtEtaPhi.cc.

45  : TAbsFitParticle() {
46  init(pini, theCovMatrix);
47 }

References init().

◆ TFitParticleEtEtaPhi() [4/4]

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

Definition at line 49 of file TFitParticleEtEtaPhi.cc.

54  init(pini, theCovMatrix);
55 }

References init().

◆ ~TFitParticleEtEtaPhi()

TFitParticleEtEtaPhi::~TFitParticleEtEtaPhi ( )
override

Definition at line 69 of file TFitParticleEtEtaPhi.cc.

69 {}

Member Function Documentation

◆ calc4Vec()

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

Implements TAbsFitParticle.

Definition at line 80 of file TFitParticleEtEtaPhi.cc.

80  {
81  // Calculates a 4vector corresponding to the given
82  // parameter values
83 
84  if (params == nullptr) {
85  return nullptr;
86  }
87 
88  if (params->GetNcols() != 1 || params->GetNrows() != _nPar) {
89  edm::LogError("WrongMatrixSize") << GetName() << "::calc4Vec - Parameter matrix has wrong size.";
90  return nullptr;
91  }
92 
93  Double_t et = (*params)(0, 0);
94  Double_t eta = (*params)(1, 0);
95  Double_t phi = (*params)(2, 0);
96 
97  Double_t X = et * TMath::Cos(phi);
98  Double_t Y = et * TMath::Sin(phi);
99  Double_t Z = et * TMath::SinH(eta);
100  Double_t E = et * TMath::CosH(eta);
101 
102  TLorentzVector* vec = new TLorentzVector(X, Y, Z, E);
103  return vec;
104 }

References TAbsFitParticle::_nPar, EgHLTOffHistBins_cfi::et, PVValHelper::eta, CalibrationSummaryClient_cfi::params, phi, X, BeamSpotPI::Y, and BeamSpotPI::Z.

◆ clone()

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

Implements TAbsFitParticle.

Definition at line 57 of file TFitParticleEtEtaPhi.cc.

57  {
58  // Returns a copy of itself
59 
60  TAbsFitParticle* myclone = new TFitParticleEtEtaPhi(*this);
61  if (newname.Length() > 0)
62  myclone->SetName(newname);
63  return myclone;
64 }

References TFitParticleEtEtaPhi().

◆ getDerivative()

TMatrixD * TFitParticleEtEtaPhi::getDerivative ( )
overridevirtual

Implements TAbsFitParticle.

Definition at line 151 of file TFitParticleEtEtaPhi.cc.

151  {
152  // returns derivative dP/dy with P=(p,E) and y=(et, eta, phi)
153  // the free parameters of the fit. The columns of the matrix contain
154  // (dP/d(et), dP/d(eta), dP/d(phi)).
155 
156  TMatrixD* DerivativeMatrix = new TMatrixD(4, 3);
157  (*DerivativeMatrix) *= 0.;
158 
159  Double_t et = _parameters(0, 0);
160  Double_t eta = _parameters(1, 0);
161  Double_t phi = _parameters(2, 0);
162 
163  //1st column: dP/d(et)
164  (*DerivativeMatrix)(0, 0) = TMath::Cos(phi);
165  (*DerivativeMatrix)(1, 0) = TMath::Sin(phi);
166  (*DerivativeMatrix)(2, 0) = TMath::SinH(eta);
167  (*DerivativeMatrix)(3, 0) = TMath::CosH(eta);
168 
169  //2nd column: dP/d(eta)
170  (*DerivativeMatrix)(0, 1) = 0.;
171  (*DerivativeMatrix)(1, 1) = 0.;
172  (*DerivativeMatrix)(2, 1) = et * TMath::CosH(eta);
173  (*DerivativeMatrix)(3, 1) = et * TMath::SinH(eta);
174 
175  //3rd column: dP/d(phi)
176  (*DerivativeMatrix)(0, 2) = -1. * et * TMath::Sin(phi);
177  (*DerivativeMatrix)(1, 2) = et * TMath::Cos(phi);
178  (*DerivativeMatrix)(2, 2) = 0.;
179  (*DerivativeMatrix)(3, 2) = 0.;
180 
181  return DerivativeMatrix;
182 }

References TAbsFitParticle::_parameters, EgHLTOffHistBins_cfi::et, PVValHelper::eta, and phi.

◆ init()

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

Definition at line 74 of file TFitParticleEtEtaPhi.cc.

74  {
75  _nPar = 3;
76  setIni4Vec(pini);
77  setCovMatrix(theCovMatrix);
78 }

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

Referenced by TFitParticleEtEtaPhi().

◆ setIni4Vec()

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

Implements TAbsFitParticle.

Definition at line 106 of file TFitParticleEtEtaPhi.cc.

106  {
107  // Set the initial 4vector. Will also set the
108  // inital parameter values
109 
110  if (pini == nullptr) {
111  _u1.SetXYZ(0., 0., 0.);
112  _u3.SetXYZ(0., 0., 0.);
113  _u2.SetXYZ(0., 0., 0.);
114  _pini.SetXYZT(0., 0., 0., 0.);
115  _pcurr = _pini;
116 
117  _iniparameters.ResizeTo(_nPar, 1);
118  _iniparameters(0, 0) = 0.;
119  _iniparameters(1, 0) = 0.;
120  _iniparameters(2, 0) = 0.;
121 
122  _parameters.ResizeTo(_nPar, 1);
123  _parameters(0, 0) = 0.;
124  _parameters(1, 0) = 0.;
125  _parameters(2, 0) = 0.;
126 
127  } else {
128  Double_t et = pini->E() * std::fabs(sin(pini->Theta()));
129  Double_t eta = pini->Eta();
130  Double_t phi = pini->Phi();
131 
132  _pini = (*pini);
133  _pcurr = _pini;
134 
135  _iniparameters.ResizeTo(_nPar, 1);
136  _iniparameters(0, 0) = et;
137  _iniparameters(1, 0) = eta;
138  _iniparameters(2, 0) = phi;
139 
140  _parameters.ResizeTo(_nPar, 1);
142 
143  _u1.SetXYZ(TMath::Cos(phi), TMath::Sin(phi), 0.); // the base vector of Et
144  _u2.SetXYZ(-1. * TMath::Cos(phi) * TMath::TanH(eta),
145  -1. * TMath::Sin(phi) * TMath::TanH(eta),
146  1. / TMath::CosH(eta)); // the base vector of Eta ( same as the base vector for Theta)
147  _u3.SetXYZ(-1. * TMath::Sin(phi), TMath::Cos(phi), 0.); // the base vector of Phi
148  }
149 }

References TAbsFitParticle::_iniparameters, TAbsFitParticle::_nPar, TAbsFitParticle::_parameters, TAbsFitParticle::_pcurr, TAbsFitParticle::_pini, TAbsFitParticle::_u1, TAbsFitParticle::_u2, TAbsFitParticle::_u3, EgHLTOffHistBins_cfi::et, PVValHelper::eta, phi, and funct::sin().

Referenced by init().

◆ transform()

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

Implements TAbsFitParticle.

Definition at line 184 of file TFitParticleEtEtaPhi.cc.

184  {
185  // Returns the parameters corresponding to the given
186  // 4vector
187 
188  // retrieve parameters
189  TMatrixD* tparams = new TMatrixD(_nPar, 1);
190  (*tparams)(0, 0) = vec.E() * std::fabs(sin(vec.Theta()));
191  (*tparams)(1, 0) = vec.Eta();
192  (*tparams)(2, 0) = vec.Phi();
193 
194  return tparams;
195 }

References TAbsFitParticle::_nPar, and funct::sin().

TAbsFitParticle::_iniparameters
TMatrixD _iniparameters
Definition: TAbsFitParticle.h:58
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
TFitParticleEtEtaPhi::init
void init(TLorentzVector *pini, const TMatrixD *theCovMatrix)
Definition: TFitParticleEtEtaPhi.cc:74
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
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
TAbsFitParticle::_u2
TVector3 _u2
Definition: TAbsFitParticle.h:51
PVValHelper::eta
Definition: PVValidationHelpers.h:70
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
TFitParticleEtEtaPhi::setIni4Vec
void setIni4Vec(const TLorentzVector *pini) override
Definition: TFitParticleEtEtaPhi.cc:106
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DDAxes::phi
TFitParticleEtEtaPhi::TFitParticleEtEtaPhi
TFitParticleEtEtaPhi()
Definition: TFitParticleEtEtaPhi.cc:27
TAbsFitParticle::_u1
TVector3 _u1
Definition: TAbsFitParticle.h:50
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
BeamSpotPI::Y
Definition: BeamSpotPayloadInspectorHelper.h:32
BeamSpotPI::Z
Definition: BeamSpotPayloadInspectorHelper.h:33