174 : fX(0.0), fY(0.0), fZ(0.0) {}
177 fX(p.fX), fY(p.fY), fZ(p.fZ) {}
180 : fX(xx), fY(yy), fZ(zz) {}
183 : fX(x0[0]), fY(x0[1]), fZ(x0[2]) {}
186 : fX(x0[0]), fY(x0[1]), fZ(x0[2]) {}
202 Error(
"operator()(i)",
"bad index (%d) returning 0",i);
219 Error(
"operator()(i)",
"bad index (%d) returning &fX",i);
228 return *
this = m * (*this);
235 return *
this = m * (*this);
248 if(arg > 1.0) arg = 1.0;
249 if(arg < -1.0) arg = -1.0;
284 return fX == 0.0 && fY == 0.0 ? 0.0 :
TMath::ATan2(fY,fX);
344 trans.
Rotate(angle, axis);
360 fX = (u1*u3*px - u2*py + u1*up*
pz)/up;
361 fY = (u2*u3*px + u1*py + u2*up*
pz)/up;
362 fZ = (u3*u3*px - px + u3*up*
pz)/up;
363 }
else if (u3 < 0.) { fX = -
fX; fZ = -
fZ; }
374 if (cosTheta*cosTheta < 1)
return -0.5*
TMath::Log( (1.0-cosTheta)/(1.0+cosTheta) );
375 if (fZ == 0)
return 0;
376 Warning(
"PseudoRapidity",
"transvers momentum = 0! return +/- 10e10");
377 if (fZ > 0)
return 10e10;
396 fZ = tanTheta ? pt / tanTheta : 0;
445 void TVector3::Streamer(
TBuffer &R__b)
455 if (R__v < 2) TObject::Streamer(R__b);
489 m(1,0)*v.
X()+
m(1,1)*v.
Y()+
m(1,2)*v.
Z(),
490 m(2,0)*v.
X()+
m(2,1)*v.
Y()+
m(2,2)*v.
Z());
501 Printf(
"%s %s (x,y,z)=(%f,%f,%f) (rho,theta,phi)=(%f,%f,%f)",
GetName(),
GetTitle(),
X(),
Y(),
Z(),
void RotateUz(const TVector3 &)
NewUzVector must be normalized !
Double_t Phi() const
return the azimuth angle. returns phi from -pi to pi
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TVector3 operator*(const TVector3 &p, Double_t a)
Double_t Theta() const
return the polar angle
Buffer base class used for serializing objects.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
Double_t Dot(const TVector3 &) const
Double_t Perp() const
return the transverse component (R in cylindrical coordinate system)
void RotateX(Double_t)
rotate vector around X
Double_t Mag() const
return the magnitude (rho in spherical coordinate system)
Double_t Angle(const TVector3 &) const
return the angle w.r.t. another 3-vector
Double_t PseudoRapidity() const
Double_t m = Mag(); return 0.5*log( (m+fZ)/(m-fZ) ); guard against Pt=0.
TVector3 & operator*=(Double_t)
TVector3 Unit() const
return unit vector parallel to this.
void Rotate(Double_t, const TVector3 &)
rotate vector
static Double_t Phi_mpi_pi(Double_t x)
(static function) returns phi angle in the interval [-PI,PI)
void SetXYZ(Double_t x, Double_t y, Double_t z)
Double_t ATan2(Double_t, Double_t)
Double_t CosTheta() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TRotation & Rotate(Double_t, const TVector3 &)
TVector3 operator-(const TVector3 &a, const TVector3 &b)
void RotateY(Double_t)
rotate vector around Y
void SetTheta(Double_t)
Set theta keeping mag and phi constant (BaBar).
ClassImp(TVector3) TVector3
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual const char * GetName() const
Returns name of object.
TVector3 & Transform(const TRotation &)
transform this vector with a TRotation
void RotateZ(Double_t)
rotate vector around Z
Mother of all ROOT objects.
void SetPhi(Double_t)
Set phi keeping mag and theta constant (BaBar).
Double_t operator()(int) const
dereferencing operator const
Double_t DeltaR(const TVector3 &) const
return deltaR with respect to v
Double_t Sqrt(Double_t x)
TVector3 operator+(const TVector3 &a, const TVector3 &b)
void SetPtThetaPhi(Double_t pt, Double_t theta, Double_t phi)
set Pt, Theta and Phi
virtual const char * GetTitle() const
Returns title of object.
void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
void SetMagThetaPhi(Double_t mag, Double_t theta, Double_t phi)
setter with mag, theta, phi
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
void SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi)
set Pt, Eta and Phi
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.