44 init(pini, theCovMatrix);
50 const TMatrixD* theCovMatrix)
52 init(pini, theCovMatrix);
59 if (newname.Length() > 0)
60 myclone->SetName(newname);
87 edm::LogError(
"WrongMatrixSize") << GetName() <<
"::calc4Vec - Parameter matrix has wrong size.";
91 Double_t
r = (*params)(0, 0);
92 Double_t
theta = (*params)(1, 0);
93 Double_t
phi = (*params)(2, 0);
94 Double_t
d = (*params)(3, 0);
96 Double_t
X =
r * TMath::Cos(
phi) * TMath::Sin(
theta);
97 Double_t
Y =
r * TMath::Sin(
phi) * TMath::Sin(
theta);
98 Double_t
Z =
r * TMath::Cos(
theta);
99 Double_t E = TMath::Sqrt(
X *
X +
Y *
Y +
Z *
Z +
d *
d *
_pini.M2());
101 TLorentzVector* vec =
new TLorentzVector(
X,
Y,
Z, E);
109 if (pini ==
nullptr) {
110 _u1.SetXYZ(0., 0., 0.);
111 _u3.SetXYZ(0., 0., 0.);
112 _u2.SetXYZ(0., 0., 0.);
113 _pini.SetXYZT(0., 0., 0., 0.);
129 Double_t
r = pini->P();
130 Double_t
theta = pini->Theta();
131 Double_t
phi = pini->Phi();
147 _u3.SetXYZ(-1. * TMath::Sin(
phi), TMath::Cos(
phi), 0.);
156 TMatrixD* DerivativeMatrix =
new TMatrixD(4, 4);
157 (*DerivativeMatrix) *= 0.;
165 (*DerivativeMatrix)(0, 0) = TMath::Cos(
phi) * TMath::Sin(
theta);
166 (*DerivativeMatrix)(1, 0) = TMath::Sin(
phi) * TMath::Sin(
theta);
167 (*DerivativeMatrix)(2, 0) = TMath::Cos(
theta);
168 (*DerivativeMatrix)(3, 0) = 0.;
171 (*DerivativeMatrix)(0, 1) =
r * TMath::Cos(
phi) * TMath::Cos(
theta);
172 (*DerivativeMatrix)(1, 1) =
r * TMath::Sin(
phi) * TMath::Cos(
theta);
173 (*DerivativeMatrix)(2, 1) = -1. *
r * TMath::Sin(
theta);
174 (*DerivativeMatrix)(3, 1) = 0.;
177 (*DerivativeMatrix)(0, 2) = -1. *
r * TMath::Sin(
phi) * TMath::Sin(
theta);
178 (*DerivativeMatrix)(1, 2) =
r * TMath::Cos(
phi) * TMath::Sin(
theta);
180 (*DerivativeMatrix)(2, 2) = 0.;
181 (*DerivativeMatrix)(3, 2) = 0.;
184 (*DerivativeMatrix)(0, 3) = 0.;
185 (*DerivativeMatrix)(1, 3) = 0.;
186 (*DerivativeMatrix)(2, 3) = 0.;
189 return DerivativeMatrix;
197 TMatrixD* tparams =
new TMatrixD(
_nPar, 1);
198 (*tparams)(0, 0) = vec.P();
199 (*tparams)(1, 0) = vec.Theta();
200 (*tparams)(2, 0) = vec.Phi();
201 (*tparams)(3, 0) = vec.M() /
_pini.M();
TMatrixD * transform(const TLorentzVector &vec) override
Log< level::Error, false > LogError
TAbsFitParticle * clone(const TString &newname=TString("")) const override
TMatrixD * getDerivative() override
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
TLorentzVector * calc4Vec(const TMatrixD *params) override
void init(TLorentzVector *pini, const TMatrixD *theCovMatrix)
void setIni4Vec(const TLorentzVector *pini) override
Geom::Theta< T > theta() const
~TFitParticleSpher() override