184 return *
this = m * (*this);
191 return *
this = m * (*this);
204 if(arg > 1.0) arg = 1.0;
205 if(arg < -1.0) arg = -1.0;
248 Double_t tot2 =
Mag2();
249 Double_t tot = (tot2 > 0) ? 1.0/
TMath::Sqrt(tot2) : 1.0;
292 trans.
Rotate(angle, axis);
300 Double_t u1 = NewUzVector.
fX;
301 Double_t u2 = NewUzVector.
fY;
302 Double_t u3 = NewUzVector.
fZ;
303 Double_t up = u1*u1 + u2*u2;
307 Double_t px =
fX, py =
fY, pz =
fZ;
308 fX = (u1*u3*px - u2*py + u1*up*pz)/up;
309 fY = (u2*u3*px + u1*py + u2*up*pz)/up;
310 fZ = (u3*u3*px - px + u3*up*pz)/up;
311 }
else if (u3 < 0.) {
fX = -
fX;
fZ = -
fZ; }
322 if (cosTheta*cosTheta < 1)
return -0.5*
TMath::Log( (1.0-cosTheta)/(1.0+cosTheta) );
323 if (
fZ == 0)
return 0;
325 if (
fZ > 0)
return 10e10;
333 Double_t apt = TMath::Abs(pt);
344 fZ = tanTheta ? pt / tanTheta : 0;
364 Double_t xy =
Perp();
374 Double_t deta =
Eta()-v.
Eta();
384 Double_t amag = TMath::Abs(mag);
393 void TVector3::Streamer(TBuffer &R__b)
395 if (R__b.IsReading()) {
397 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
399 R__b.ReadClassBuffer(TVector3::Class(),
this, R__v, R__s, R__c);
403 if (R__v < 2) TObject::Streamer(R__b);
407 R__b.CheckByteCount(R__s, R__c, TVector3::IsA());
411 R__b.WriteClassBuffer(TVector3::Class(),
this);
453 m(1,0)*v.
X()+
m(1,1)*v.
Y()+
m(1,2)*v.
Z(),
454 m(2,0)*v.
X()+
m(2,1)*v.
Y()+
m(2,2)*v.
Z());
462 Printf(
"%s %s (x,y,z)=(%f,%f,%f) (rho,theta,phi)=(%f,%f,%f)",GetName(),GetTitle(),
X(),
Y(),
Z(),
Double_t Dot(const TVector3 &) const
void RotateUz(const TVector3 &)
NewUzVector must be normalized !
TVector3 operator*(const TVector3 &p, Double_t a)
Operator *.
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.
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)
Double_t ATan2(Double_t, Double_t)
TRotation & Rotate(Double_t, const TVector3 &)
Rotate along an axis.
Double_t Perp() const
Return the transverse component (R in cylindrical coordinate system)
void RotateY(Double_t)
Rotate vector around Y.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t Int_t m
TVector3 is a general three vector class, which can be used for the description of different vectors ...
The TRotation class describes a rotation of objects of the TVector3 class.
void SetTheta(Double_t)
Set theta keeping mag and phi constant (BaBar).
Double_t Theta() const
Return the polar angle.
void Print(Option_t *option="") const
Print vector parameters.
Double_t PseudoRapidity() const
Double_t m = Mag(); return 0.5*log( (m+fZ)/(m-fZ) ); guard against Pt=0.
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).
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Double_t DeltaR(const TVector3 &) const
Return deltaR with respect to v.
Double_t Phi() const
Return the azimuth angle. Returns phi from -pi to pi.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Double_t Sqrt(Double_t x)
TVector3 operator+(const TVector3 &a, const TVector3 &b)
Operator +.
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.