30 init(
nullptr,
nullptr);
55 init(pini, theCovMatrix);
59 TLorentzVector* pini,
const TMatrixD* theCovMatrix)
62 init(pini, theCovMatrix);
69 if ( newname.Length() > 0 ) myclone->SetName(newname);
96 if (params ==
nullptr) {
100 if ( params->GetNcols() != 1 || params->GetNrows() !=
_nPar ) {
102 << GetName() <<
"::calc4Vec - Parameter matrix has wrong size.";
106 Double_t
r = (*params)(0,0);
107 Double_t
theta = (*params)(1,0);
108 Double_t
phi = (*params)(2,0);
109 Double_t
d = (*params)(3,0);
111 Double_t
X = r*TMath::Cos(phi)*TMath::Sin(theta);
112 Double_t
Y = r*TMath::Sin(phi)*TMath::Sin(theta);
113 Double_t
Z = r*TMath::Cos(theta);
114 Double_t E = TMath::Sqrt( X*X + Y*Y + Z*Z + d*d*
_pini.M2() );
116 TLorentzVector* vec =
new TLorentzVector( X, Y, Z, E );
125 if (pini ==
nullptr) {
127 _u1.SetXYZ(0., 0., 0.);
128 _u3.SetXYZ(0., 0., 0.);
129 _u2.SetXYZ(0., 0., 0.);
130 _pini.SetXYZT(0., 0., 0., 0.);
147 Double_t
r = pini->P();
148 Double_t
theta = pini->Theta();
149 Double_t
phi = pini->Phi();
163 _u1.SetXYZ( TMath::Cos(phi)*TMath::Sin(theta), TMath::Sin(phi)*TMath::Sin(theta), TMath::Cos(theta) );
164 _u2.SetXYZ( TMath::Cos(phi)*TMath::Cos(theta), TMath::Sin(phi)*TMath::Cos(theta), -1.*TMath::Sin(theta) );
165 _u3.SetXYZ( -1.*TMath::Sin(phi), TMath::Cos(phi), 0. );
176 TMatrixD* DerivativeMatrix =
new TMatrixD(4,4);
177 (*DerivativeMatrix) *= 0.;
185 (*DerivativeMatrix)(0,0) = TMath::Cos(phi)*TMath::Sin(theta);
186 (*DerivativeMatrix)(1,0) = TMath::Sin(phi)*TMath::Sin(theta);
187 (*DerivativeMatrix)(2,0) = TMath::Cos(theta);
188 (*DerivativeMatrix)(3,0) = 0.;
191 (*DerivativeMatrix)(0,1) = r*TMath::Cos(phi)*TMath::Cos(theta);
192 (*DerivativeMatrix)(1,1) = r*TMath::Sin(phi)*TMath::Cos(theta);
193 (*DerivativeMatrix)(2,1) = -1.*r*TMath::Sin(theta);
194 (*DerivativeMatrix)(3,1) = 0.;
197 (*DerivativeMatrix)(0,2) = -1.*r*TMath::Sin(phi)*TMath::Sin(theta);
198 (*DerivativeMatrix)(1,2) = r*TMath::Cos(phi)*TMath::Sin(theta);;
199 (*DerivativeMatrix)(2,2) = 0.;
200 (*DerivativeMatrix)(3,2) = 0.;
203 (*DerivativeMatrix)(0,3) = 0.;
204 (*DerivativeMatrix)(1,3) = 0.;
205 (*DerivativeMatrix)(2,3) = 0.;
208 return DerivativeMatrix;
217 TMatrixD* tparams =
new TMatrixD(
_nPar, 1 );
218 (*tparams)(0,0) = vec.P();
219 (*tparams)(1,0) = vec.Theta();
220 (*tparams)(2,0) = vec.Phi();
221 (*tparams)(3,0) = vec.M()/
_pini.M();
TMatrixD * transform(const TLorentzVector &vec) override
Geom::Theta< T > theta() const
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
TAbsFitParticle * clone(const TString &newname=TString("")) const override
~TFitParticleSpher() override