46 init(pini, theCovMatrix);
52 const TMatrixD* theCovMatrix)
54 init(pini, theCovMatrix);
61 if (newname.Length() > 0)
62 myclone->SetName(newname);
89 edm::LogError(
"WrongMatrixSize") << GetName() <<
"::calc4Vec - Parameter matrix has wrong size.";
93 Double_t
et = (*params)(0, 0);
94 Double_t
theta = (*params)(1, 0);
95 Double_t
phi = (*params)(2, 0);
97 Double_t
X =
et * TMath::Cos(
phi);
98 Double_t
Y =
et * TMath::Sin(
phi);
100 Double_t E =
et / TMath::Sin(
theta);
102 TLorentzVector* vec =
new TLorentzVector(
X,
Y,
Z, E);
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.);
128 Double_t
et = pini->E() * std::fabs(
sin(pini->Theta()));
129 Double_t
theta = pini->Theta();
130 Double_t
phi = pini->Phi();
143 _u1.SetXYZ(TMath::Cos(
phi), TMath::Sin(
phi), 0.);
145 TMath::Sin(
phi) * TMath::Cos(
theta),
146 -1. * TMath::Sin(
theta));
147 _u3.SetXYZ(-1. * TMath::Sin(
phi), TMath::Cos(
phi), 0.);
156 TMatrixD* DerivativeMatrix =
new TMatrixD(4, 3);
157 (*DerivativeMatrix) *= 0.;
163 Double_t CotanTheta = 1. / TMath::Tan(
theta);
166 (*DerivativeMatrix)(0, 0) = TMath::Cos(
phi);
167 (*DerivativeMatrix)(1, 0) = TMath::Sin(
phi);
168 (*DerivativeMatrix)(2, 0) = CotanTheta;
169 (*DerivativeMatrix)(3, 0) = 1. / TMath::Sin(
theta);
172 (*DerivativeMatrix)(0, 1) = 0.;
173 (*DerivativeMatrix)(1, 1) = 0.;
174 (*DerivativeMatrix)(2, 1) = -1. *
et * (1. + CotanTheta * CotanTheta);
175 (*DerivativeMatrix)(3, 1) = -1. *
et * CotanTheta / (TMath::Sin(
theta));
178 (*DerivativeMatrix)(0, 2) = -1. *
et * TMath::Sin(
phi);
179 (*DerivativeMatrix)(1, 2) =
et * TMath::Cos(
phi);
180 (*DerivativeMatrix)(2, 2) = 0.;
181 (*DerivativeMatrix)(3, 2) = 0.;
183 return DerivativeMatrix;
191 TMatrixD* tparams =
new TMatrixD(
_nPar, 1);
192 (*tparams)(0, 0) = vec.E() * std::fabs(
sin(vec.Theta()));
193 (*tparams)(1, 0) = vec.Theta();
194 (*tparams)(2, 0) = vec.Phi();
Sin< T >::type sin(const T &t)
Log< level::Error, false > LogError
TMatrixD * transform(const TLorentzVector &vec) override
TLorentzVector * calc4Vec(const TMatrixD *params) override
~TFitParticleEtThetaPhi() override
TAbsFitParticle * clone(const TString &newname="") const override
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
void setIni4Vec(const TLorentzVector *pini) override
TMatrixD * getDerivative() override
void init(TLorentzVector *pini, const TMatrixD *theCovMatrix)