51 inline Double_t
x()
const;
52 inline Double_t
y()
const;
53 inline Double_t
z()
const;
54 inline Double_t
X()
const;
55 inline Double_t
Y()
const;
56 inline Double_t
Z()
const;
57 inline Double_t
Px()
const;
58 inline Double_t
Py()
const;
59 inline Double_t
Pz()
const;
62 inline void SetX(Double_t);
63 inline void SetY(Double_t);
64 inline void SetZ(Double_t);
65 inline void SetXYZ(Double_t x, Double_t y, Double_t z);
66 void SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi);
67 void SetPtThetaPhi(Double_t pt, Double_t theta, Double_t phi);
69 inline void GetXYZ(Double_t *carray)
const;
70 inline void GetXYZ(Float_t *carray)
const;
77 Double_t
Theta()
const;
83 inline Double_t
Mag2()
const;
95 inline void SetMag(Double_t);
98 inline Double_t
Perp2()
const;
101 inline Double_t
Pt()
const;
102 Double_t
Perp()
const;
158 inline Double_t
Eta()
const;
181 void Print(Option_t* option=
"")
const;
197 TVector3 operator - (const TVector3 &, const TVector3 &);
200 Double_t operator * (const TVector3 &, const TVector3 &);
203 TVector3 operator * (const TVector3 &, Double_t a);
204 TVector3 operator * (Double_t a, const TVector3 &);
207 TVector3 operator * (const
TMatrix &, const TVector3 &);
210 inline Double_t & TVector3::operator[] (
int i) {
return operator()(i); }
248 : fX(0.0), fY(0.0), fZ(0.0) {}
251 fX(p.fX), fY(p.fY), fZ(p.fZ) {}
254 : fX(xx), fY(yy), fZ(zz) {}
257 : fX(x0[0]), fY(x0[1]), fZ(x0[2]) {}
260 : fX(x0[0]), fY(x0[1]), fZ(x0[2]) {}
272 Error(
"operator()(i)",
"bad index (%d) returning 0",i);
286 Error(
"operator()(i)",
"bad index (%d) returning &fX",i);
299 return (v.
fX==fX && v.
fY==fY && v.
fZ==fZ) ? kTRUE : kFALSE;
303 return (v.
fX!=fX || v.
fY!=fY || v.
fZ!=fZ) ? kTRUE : kFALSE;
332 return fX*p.
fX + fY*p.
fY + fZ*p.
fZ;
343 Double_t xx = fX < 0.0 ? -
fX :
fX;
344 Double_t yy = fY < 0.0 ? -
fY :
fY;
345 Double_t zz = fZ < 0.0 ? -
fZ :
fZ;
359 Double_t tot = p.
Mag2();
360 Double_t ss =
Dot(p);
361 Double_t per =
Mag2();
362 if (tot > 0.0) per -= ss*ss/tot;
363 if (per < 0) per = 0;
372 Double_t ptot =
Mag();
373 return ptot == 0.0 ? 1.0 : fZ/ptot;
377 Double_t factor =
Mag();
379 Warning(
"SetMag",
"zero vector can't be stretched");
TVector3 & operator=(const TVector3 &)
Double_t Dot(const TVector3 &) const
void RotateUz(const TVector3 &)
NewUzVector must be normalized !
Double_t DeltaPhi(const TVector3 &) const
Bool_t operator==(const TVector3 &) const
Double_t operator()(int) const
Double_t CosTheta() const
void RotateX(Double_t)
Rotate vector around X.
Double_t Angle(const TVector3 &) const
Return the angle w.r.t. another 3-vector.
Double_t DrEtaPhi(const TVector3 &) const
TVector2 is a general two vector class, which can be used for the description of different vectors in...
TVector3 Unit() const
Return unit vector parallel to this.
TVector3 operator-() const
TVector3 & operator*=(Double_t)
void Rotate(Double_t, const TVector3 &)
Rotate vector.
static Double_t Phi_mpi_pi(Double_t x)
Returns phi angle in the interval [-PI,PI)
void SetXYZ(Double_t x, Double_t y, Double_t z)
void GetXYZ(Double_t *carray) const
TVector2 EtaPhiVector() const
TVector2 XYvector() const
Double_t Perp() const
Return the transverse component (R in cylindrical coordinate system)
void RotateY(Double_t)
Rotate vector around Y.
TVector3 is a general three vector class, which can be used for the description of different vectors ...
TVector3 Cross(const TVector3 &) const
The TRotation class describes a rotation of objects of the TVector3 class.
void SetTheta(Double_t)
Set theta keeping mag and phi constant (BaBar).
TLorentzVector is a general four-vector class, which can be used either for the description of positi...
TVector3 & operator+=(const TVector3 &)
Double_t Theta() const
Return the polar angle.
void Print(Option_t *option="") const
Print vector parameters.
TVector3 & operator-=(const TVector3 &)
Double_t PseudoRapidity() const
Double_t m = Mag(); return 0.5*log( (m+fZ)/(m-fZ) ); guard against Pt=0.
Bool_t operator!=(const TVector3 &) const
TVector3 Orthogonal() const
TVector3 & Transform(const TRotation &)
Transform this vector with a TRotation.
void RotateZ(Double_t)
Rotate vector around Z.
void SetPhi(Double_t)
Set phi keeping mag and theta constant (BaBar).
Double_t DeltaR(const TVector3 &) const
Return deltaR with respect to v.
Double_t operator[](int) const
Double_t Phi() const
Return the azimuth angle. Returns phi from -pi to pi.
Double_t Sqrt(Double_t x)
void SetPtThetaPhi(Double_t pt, Double_t theta, Double_t phi)
Set Pt, Theta and Phi.
void SetMagThetaPhi(Double_t mag, Double_t theta, Double_t phi)
Setter with mag, theta, phi.
void SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi)
Set Pt, Eta and Phi.