ROOT  6.06/09
Reference Guide
TVector3.cxx
Go to the documentation of this file.
1 // @(#)root/physics:$Id$
2 // Author: Pasha Murat, Peter Malzacher 12/02/99
3 // Aug 11 1999: added Pt == 0 guard to Eta()
4 // Oct 8 1999: changed Warning to Error and
5 // return fX in Double_t & operator()
6 // Oct 20 1999: Bug fix: sign in PseudoRapidity
7 // Warning-> Error in Double_t operator()
8 
9 //______________________________________________________________________________
10 //*-*-*-*-*-*-*-*-*-*-*-*The Physics Vector package *-*-*-*-*-*-*-*-*-*-*-*
11 //*-* ========================== *
12 //*-* The Physics Vector package consists of five classes: *
13 //*-* - TVector2 *
14 //*-* - TVector3 *
15 //*-* - TRotation *
16 //*-* - TLorentzVector *
17 //*-* - TLorentzRotation *
18 //*-* It is a combination of CLHEPs Vector package written by *
19 //*-* Leif Lonnblad, Andreas Nilsson and Evgueni Tcherniaev *
20 //*-* and a ROOT package written by Pasha Murat. *
21 //*-* for CLHEP see: http://wwwinfo.cern.ch/asd/lhc++/clhep/ *
22 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
23 //BEGIN_HTML <!--
24 /* -->
25 <H2>
26 TVector3</H2>
27 <TT>TVector3</TT> is a general three vector class, which can be used for
28 the description of different vectors in 3D.
29 <H3>
30 Declaration / Access to the components</H3>
31 <TT>TVector3</TT> has been implemented as a vector of three <TT>Double_t</TT>
32 variables, representing the cartesian coordinates. By default all components
33 are initialized to zero:
34 
35 <P><TT>&nbsp; TVector3 v1;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //
36 v1 = (0,0,0)</TT>
37 <BR><TT>&nbsp; TVector3 v3(1,2,3); // v3 = (1,2,3)</TT>
38 <BR><TT>&nbsp; TVector3 v4(v2);&nbsp;&nbsp;&nbsp; // v4 = v2</TT>
39 
40 <P>It is also possible (but not recommended) to initialize a <TT>TVector3</TT>
41 with a <TT>Double_t</TT> or <TT>Float_t</TT> C array.
42 
43 <P>You can get the basic components either by name or by index using <TT>operator()</TT>:
44 
45 <P><TT>&nbsp; xx = v1.X();&nbsp;&nbsp;&nbsp; or&nbsp;&nbsp;&nbsp; xx =
46 v1(0);</TT>
47 <BR><TT>&nbsp; yy = v1.Y();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
48 yy = v1(1);</TT>
49 <BR><TT>&nbsp; zz = v1.Z();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
50 zz = v1(2);</TT>
51 
52 <P>The memberfunctions <TT>SetX()</TT>, <TT>SetY()</TT>, <TT>SetZ()</TT>
53 and<TT> SetXYZ()</TT> allow to set the components:
54 
55 <P><TT>&nbsp; v1.SetX(1.); v1.SetY(2.); v1.SetZ(3.);</TT>
56 <BR><TT>&nbsp; v1.SetXYZ(1.,2.,3.);</TT>
57 <BR>&nbsp;
58 <H3>
59 Noncartesian coordinates</H3>
60 To get information on the <TT>TVector3</TT> in spherical (rho,phi,theta)
61 or cylindrical (z,r,theta) coordinates, the
62 <BR>the member functions <TT>Mag()</TT> (=magnitude=rho in spherical coordinates),
63 <TT>Mag2()</TT>, <TT>Theta()</TT>, <TT>CosTheta()</TT>, <TT>Phi()</TT>,
64 <TT>Perp()</TT> (the transverse component=r in cylindrical coordinates),
65 <TT>Perp2()</TT> can be used:
66 
67 <P><TT>&nbsp; Double_t m&nbsp; = v.Mag();&nbsp;&nbsp;&nbsp; // get magnitude
68 (=rho=Sqrt(x*x+y*y+z*z)))</TT>
69 <BR><TT>&nbsp; Double_t m2 = v.Mag2();&nbsp;&nbsp; // get magnitude squared</TT>
70 <BR><TT>&nbsp; Double_t t&nbsp; = v.Theta();&nbsp; // get polar angle</TT>
71 <BR><TT>&nbsp; Double_t ct = v.CosTheta();// get cos of theta</TT>
72 <BR><TT>&nbsp; Double_t p&nbsp; = v.Phi();&nbsp;&nbsp;&nbsp; // get azimuth
73 angle</TT>
74 <BR><TT>&nbsp; Double_t pp = v.Perp();&nbsp;&nbsp; // get transverse component</TT>
75 <BR><TT>&nbsp; Double_t pp2= v.Perp2();&nbsp; // get transvers component
76 squared</TT>
77 
78 <P>It is also possible to get the transverse component with respect to
79 another vector:
80 
81 <P><TT>&nbsp; Double_t ppv1 = v.Perp(v1);</TT>
82 <BR><TT>&nbsp; Double_t pp2v1 = v.Perp2(v1);</TT>
83 
84 <P>The pseudo-rapidity ( eta=-ln (tan (theta/2)) ) can be obtained by <TT>Eta()</TT>
85 or <TT>PseudoRapidity()</TT>:
86 <BR>&nbsp;
87 <BR><TT>&nbsp; Double_t eta = v.PseudoRapidity();</TT>
88 
89 <P>There are set functions to change one of the noncartesian coordinates:
90 
91 <P><TT>&nbsp; v.SetTheta(.5); // keeping rho and phi</TT>
92 <BR><TT>&nbsp; v.SetPhi(.8);&nbsp;&nbsp; // keeping rho and theta</TT>
93 <BR><TT>&nbsp; v.SetMag(10.);&nbsp; // keeping theta and phi</TT>
94 <BR><TT>&nbsp; v.SetPerp(3.);&nbsp; // keeping z and phi</TT>
95 <BR>&nbsp;
96 <H3>
97 Arithmetic / Comparison</H3>
98 The <TT>TVector3</TT> class provides the operators to add, subtract, scale and compare
99 vectors:
100 
101 <P><TT>&nbsp; v3&nbsp; = -v1;</TT>
102 <BR><TT>&nbsp; v1&nbsp; = v2+v3;</TT>
103 <BR><TT>&nbsp; v1 += v3;</TT>
104 <BR><TT>&nbsp; v1&nbsp; = v1 - v3</TT>
105 <BR><TT>&nbsp; v1 -= v3;</TT>
106 <BR><TT>&nbsp; v1 *= 10;</TT>
107 <BR><TT>&nbsp; v1&nbsp; = 5*v2;</TT>
108 
109 <P><TT>&nbsp; if(v1==v2) {...}</TT>
110 <BR><TT>&nbsp; if(v1!=v2) {...}</TT>
111 <BR>&nbsp;
112 <H3>
113 Related Vectors</H3>
114 <TT>&nbsp; v2 = v1.Unit();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // get unit
115 vector parallel to v1</TT>
116 <BR><TT>&nbsp; v2 = v1.Orthogonal(); // get vector orthogonal to v1</TT>
117 <H3>
118 Scalar and vector products</H3>
119 <TT>&nbsp; s = v1.Dot(v2);&nbsp;&nbsp; // scalar product</TT>
120 <BR><TT>&nbsp; s = v1 * v2;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // scalar product</TT>
121 <BR><TT>&nbsp; v = v1.Cross(v2); // vector product</TT>
122 <H3>
123 &nbsp;Angle between two vectors</H3>
124 <TT>&nbsp; Double_t a = v1.Angle(v2);</TT>
125 <H3>
126 Rotations</H3>
127 
128 <H5>
129 Rotation around axes</H5>
130 <TT>&nbsp; v.RotateX(.5);</TT>
131 <BR><TT>&nbsp; v.RotateY(TMath::Pi());</TT>
132 <BR><TT>&nbsp; v.RotateZ(angle);</TT>
133 <H5>
134 Rotation around a vector</H5>
135 <TT>&nbsp; v1.Rotate(TMath::Pi()/4, v2); // rotation around v2</TT>
136 <H5>
137 Rotation by TRotation</H5>
138 <TT>TVector3</TT> objects can be rotated by objects of the <TT>TRotation</TT>
139 class using the <TT>Transform()</TT> member functions,
140 <BR>the <TT>operator *=</TT> or the <TT>operator *</TT> of the TRotation
141 class:
142 
143 <P><TT>&nbsp; TRotation m;</TT>
144 <BR><TT>&nbsp; ...</TT>
145 <BR><TT>&nbsp; v1.transform(m);</TT>
146 <BR><TT>&nbsp; v1 = m*v1;</TT>
147 <BR><TT>&nbsp; v1 *= m; // Attention v1 = m*v1</TT>
148 <H5>
149 Transformation from rotated frame</H5>
150 <TT>&nbsp; TVector3 direction = v.Unit()</TT>
151 <BR><TT>&nbsp; v1.RotateUz(direction); // direction must be TVector3 of
152 unit length</TT>
153 
154 <P>transforms v1 from the rotated frame (z' parallel to direction, x' in
155 the theta plane and y' in the xy plane as well as perpendicular to the
156 theta plane) to the (x,y,z) frame.
157 
158 <!--*/
159 // -->END_HTML
160 //
161 
162 #include "TVector3.h"
163 #include "TRotation.h"
164 #include "TMath.h"
165 #include "TClass.h"
166 
168 
169 ////////////////////////////////////////////////////////////////////////////////
170 
172 : fX(0.0), fY(0.0), fZ(0.0) {}
173 
175  fX(p.fX), fY(p.fY), fZ(p.fZ) {}
176 
178 : fX(xx), fY(yy), fZ(zz) {}
179 
181 : fX(x0[0]), fY(x0[1]), fZ(x0[2]) {}
182 
184 : fX(x0[0]), fY(x0[1]), fZ(x0[2]) {}
185 
187 
188 ////////////////////////////////////////////////////////////////////////////////
189 ///dereferencing operator const
190 
192  switch(i) {
193  case 0:
194  return fX;
195  case 1:
196  return fY;
197  case 2:
198  return fZ;
199  default:
200  Error("operator()(i)", "bad index (%d) returning 0",i);
201  }
202  return 0.;
203 }
204 
205 ////////////////////////////////////////////////////////////////////////////////
206 ///dereferencing operator
207 
209  switch(i) {
210  case 0:
211  return fX;
212  case 1:
213  return fY;
214  case 2:
215  return fZ;
216  default:
217  Error("operator()(i)", "bad index (%d) returning &fX",i);
218  }
219  return fX;
220 }
221 
222 ////////////////////////////////////////////////////////////////////////////////
223 ///multiplication operator
224 
226  return *this = m * (*this);
227 }
228 
229 ////////////////////////////////////////////////////////////////////////////////
230 ///transform this vector with a TRotation
231 
233  return *this = m * (*this);
234 }
235 
236 ////////////////////////////////////////////////////////////////////////////////
237 /// return the angle w.r.t. another 3-vector
238 
240 {
241  Double_t ptot2 = Mag2()*q.Mag2();
242  if(ptot2 <= 0) {
243  return 0.0;
244  } else {
245  Double_t arg = Dot(q)/TMath::Sqrt(ptot2);
246  if(arg > 1.0) arg = 1.0;
247  if(arg < -1.0) arg = -1.0;
248  return TMath::ACos(arg);
249  }
250 }
251 
252 ////////////////////////////////////////////////////////////////////////////////
253 /// return the magnitude (rho in spherical coordinate system)
254 
256 {
257  return TMath::Sqrt(Mag2());
258 }
259 
260 ////////////////////////////////////////////////////////////////////////////////
261 ///return the transverse component (R in cylindrical coordinate system)
262 
264 {
265  return TMath::Sqrt(Perp2());
266 }
267 
268 
269 ////////////////////////////////////////////////////////////////////////////////
270 ///return the transverse component (R in cylindrical coordinate system)
271 
273 {
274  return TMath::Sqrt(Perp2(p));
275 }
276 
277 ////////////////////////////////////////////////////////////////////////////////
278 ///return the azimuth angle. returns phi from -pi to pi
279 
281 {
282  return fX == 0.0 && fY == 0.0 ? 0.0 : TMath::ATan2(fY,fX);
283 }
284 
285 ////////////////////////////////////////////////////////////////////////////////
286 ///return the polar angle
287 
289 {
290  return fX == 0.0 && fY == 0.0 && fZ == 0.0 ? 0.0 : TMath::ATan2(Perp(),fZ);
291 }
292 
293 ////////////////////////////////////////////////////////////////////////////////
294 /// return unit vector parallel to this.
295 
297 {
298  Double_t tot2 = Mag2();
299  Double_t tot = (tot2 > 0) ? 1.0/TMath::Sqrt(tot2) : 1.0;
300  TVector3 p(fX*tot,fY*tot,fZ*tot);
301  return p;
302 }
303 
304 ////////////////////////////////////////////////////////////////////////////////
305 ///rotate vector around X
306 
308  Double_t s = TMath::Sin(angle);
309  Double_t c = TMath::Cos(angle);
310  Double_t yy = fY;
311  fY = c*yy - s*fZ;
312  fZ = s*yy + c*fZ;
313 }
314 
315 ////////////////////////////////////////////////////////////////////////////////
316 ///rotate vector around Y
317 
319  Double_t s = TMath::Sin(angle);
320  Double_t c = TMath::Cos(angle);
321  Double_t zz = fZ;
322  fZ = c*zz - s*fX;
323  fX = s*zz + c*fX;
324 }
325 
326 ////////////////////////////////////////////////////////////////////////////////
327 ///rotate vector around Z
328 
330  Double_t s = TMath::Sin(angle);
331  Double_t c = TMath::Cos(angle);
332  Double_t xx = fX;
333  fX = c*xx - s*fY;
334  fY = s*xx + c*fY;
335 }
336 
337 ////////////////////////////////////////////////////////////////////////////////
338 ///rotate vector
339 
340 void TVector3::Rotate(Double_t angle, const TVector3 & axis){
341  TRotation trans;
342  trans.Rotate(angle, axis);
343  operator*=(trans);
344 }
345 
346 ////////////////////////////////////////////////////////////////////////////////
347 /// NewUzVector must be normalized !
348 
349 void TVector3::RotateUz(const TVector3& NewUzVector) {
350  Double_t u1 = NewUzVector.fX;
351  Double_t u2 = NewUzVector.fY;
352  Double_t u3 = NewUzVector.fZ;
353  Double_t up = u1*u1 + u2*u2;
354 
355  if (up) {
356  up = TMath::Sqrt(up);
357  Double_t px = fX, py = fY, pz = fZ;
358  fX = (u1*u3*px - u2*py + u1*up*pz)/up;
359  fY = (u2*u3*px + u1*py + u2*up*pz)/up;
360  fZ = (u3*u3*px - px + u3*up*pz)/up;
361  } else if (u3 < 0.) { fX = -fX; fZ = -fZ; } // phi=0 teta=pi
362  else {};
363 }
364 
365 ////////////////////////////////////////////////////////////////////////////////
366 ///Double_t m = Mag();
367 ///return 0.5*log( (m+fZ)/(m-fZ) );
368 /// guard against Pt=0
369 
371  double cosTheta = CosTheta();
372  if (cosTheta*cosTheta < 1) return -0.5* TMath::Log( (1.0-cosTheta)/(1.0+cosTheta) );
373  if (fZ == 0) return 0;
374  Warning("PseudoRapidity","transvers momentum = 0! return +/- 10e10");
375  if (fZ > 0) return 10e10;
376  else return -10e10;
377 }
378 
379 ////////////////////////////////////////////////////////////////////////////////
380 ///set Pt, Eta and Phi
381 
383  Double_t apt = TMath::Abs(pt);
384  SetXYZ(apt*TMath::Cos(phi), apt*TMath::Sin(phi), apt/TMath::Tan(2.0*TMath::ATan(TMath::Exp(-eta))) );
385 }
386 
387 ////////////////////////////////////////////////////////////////////////////////
388 ///set Pt, Theta and Phi
389 
391  fX = pt * TMath::Cos(phi);
392  fY = pt * TMath::Sin(phi);
393  Double_t tanTheta = TMath::Tan(theta);
394  fZ = tanTheta ? pt / tanTheta : 0;
395 }
396 
397 ////////////////////////////////////////////////////////////////////////////////
398 /// Set theta keeping mag and phi constant (BaBar).
399 
401 {
402  Double_t ma = Mag();
403  Double_t ph = Phi();
404  SetX(ma*TMath::Sin(th)*TMath::Cos(ph));
405  SetY(ma*TMath::Sin(th)*TMath::Sin(ph));
406  SetZ(ma*TMath::Cos(th));
407 }
408 
409 ////////////////////////////////////////////////////////////////////////////////
410 /// Set phi keeping mag and theta constant (BaBar).
411 
413 {
414  Double_t xy = Perp();
415  SetX(xy*TMath::Cos(ph));
416  SetY(xy*TMath::Sin(ph));
417 }
418 
419 ////////////////////////////////////////////////////////////////////////////////
420 ///return deltaR with respect to v
421 
423 {
424  Double_t deta = Eta()-v.Eta();
425  Double_t dphi = TVector2::Phi_mpi_pi(Phi()-v.Phi());
426  return TMath::Sqrt( deta*deta+dphi*dphi );
427 }
428 
429 ////////////////////////////////////////////////////////////////////////////////
430 ///setter with mag, theta, phi
431 
433 {
434  Double_t amag = TMath::Abs(mag);
435  fX = amag * TMath::Sin(theta) * TMath::Cos(phi);
436  fY = amag * TMath::Sin(theta) * TMath::Sin(phi);
437  fZ = amag * TMath::Cos(theta);
438 }
439 
440 ////////////////////////////////////////////////////////////////////////////////
441 /// Stream an object of class TVector3.
442 
443 void TVector3::Streamer(TBuffer &R__b)
444 {
445  if (R__b.IsReading()) {
446  UInt_t R__s, R__c;
447  Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
448  if (R__v > 2) {
449  R__b.ReadClassBuffer(TVector3::Class(), this, R__v, R__s, R__c);
450  return;
451  }
452  //====process old versions before automatic schema evolution
453  if (R__v < 2) TObject::Streamer(R__b);
454  R__b >> fX;
455  R__b >> fY;
456  R__b >> fZ;
457  R__b.CheckByteCount(R__s, R__c, TVector3::IsA());
458  //====end of old versions
459 
460  } else {
461  R__b.WriteClassBuffer(TVector3::Class(),this);
462  }
463 }
464 
465 TVector3 operator + (const TVector3 & a, const TVector3 & b) {
466  return TVector3(a.X() + b.X(), a.Y() + b.Y(), a.Z() + b.Z());
467 }
468 
469 TVector3 operator - (const TVector3 & a, const TVector3 & b) {
470  return TVector3(a.X() - b.X(), a.Y() - b.Y(), a.Z() - b.Z());
471 }
472 
474  return TVector3(a*p.X(), a*p.Y(), a*p.Z());
475 }
476 
478  return TVector3(a*p.X(), a*p.Y(), a*p.Z());
479 }
480 
481 Double_t operator * (const TVector3 & a, const TVector3 & b) {
482  return a.Dot(b);
483 }
484 
485 TVector3 operator * (const TMatrix & m, const TVector3 & v ) {
486  return TVector3( m(0,0)*v.X()+m(0,1)*v.Y()+m(0,2)*v.Z(),
487  m(1,0)*v.X()+m(1,1)*v.Y()+m(1,2)*v.Z(),
488  m(2,0)*v.X()+m(2,1)*v.Y()+m(2,2)*v.Z());
489 }
490 
491 
492 //const TVector3 kXHat(1.0, 0.0, 0.0);
493 //const TVector3 kYHat(0.0, 1.0, 0.0);
494 //const TVector3 kZHat(0.0, 0.0, 1.0);
495 
497 {
498  //print vector parameters
499  Printf("%s %s (x,y,z)=(%f,%f,%f) (rho,theta,phi)=(%f,%f,%f)",GetName(),GetTitle(),X(),Y(),Z(),
501 }
void RotateUz(const TVector3 &)
NewUzVector must be normalized !
Definition: TVector3.cxx:349
virtual ~TVector3()
Definition: TVector3.cxx:186
Double_t Phi() const
return the azimuth angle. returns phi from -pi to pi
Definition: TVector3.cxx:280
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TVector3 operator*(const TVector3 &p, Double_t a)
Definition: TVector3.cxx:473
Double_t Z() const
Definition: TVector3.h:222
Bool_t IsReading() const
Definition: TBuffer.h:81
Double_t Log(Double_t x)
Definition: TMath.h:526
void SetY(Double_t)
Definition: TVector3.h:228
short Version_t
Definition: RtypesCore.h:61
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
Double_t Theta() const
return the polar angle
Definition: TVector3.cxx:288
Buffer base class used for serializing objects.
Definition: TBuffer.h:40
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
Double_t RadToDeg()
Definition: TMath.h:49
TArc * a
Definition: textangle.C:12
Double_t fY
Definition: TVector3.h:190
Double_t Dot(const TVector3 &) const
Definition: TVector3.h:290
Double_t Perp() const
return the transverse component (R in cylindrical coordinate system)
Definition: TVector3.cxx:263
void RotateX(Double_t)
rotate vector around X
Definition: TVector3.cxx:307
Short_t Abs(Short_t d)
Definition: TMathBase.h:110
Double_t Mag() const
return the magnitude (rho in spherical coordinate system)
Definition: TVector3.cxx:255
Double_t Angle(const TVector3 &) const
return the angle w.r.t. another 3-vector
Definition: TVector3.cxx:239
Double_t PseudoRapidity() const
Double_t m = Mag(); return 0.5*log( (m+fZ)/(m-fZ) ); guard against Pt=0.
Definition: TVector3.cxx:370
Double_t fZ
Definition: TVector3.h:190
void Class()
Definition: Class.C:29
TVector3 & operator*=(Double_t)
Definition: TVector3.h:283
TVector3 Unit() const
return unit vector parallel to this.
Definition: TVector3.cxx:296
void Rotate(Double_t, const TVector3 &)
rotate vector
Definition: TVector3.cxx:340
static Double_t Phi_mpi_pi(Double_t x)
(static function) returns phi angle in the interval [-PI,PI)
Definition: TVector2.cxx:95
void SetXYZ(Double_t x, Double_t y, Double_t z)
Definition: TVector3.h:231
Double_t ATan2(Double_t, Double_t)
Definition: TMath.h:454
Double_t CosTheta() const
Definition: TVector3.h:330
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
TRotation & Rotate(Double_t, const TVector3 &)
Definition: TRotation.cxx:307
TVector3 operator-(const TVector3 &a, const TVector3 &b)
Definition: TVector3.cxx:469
void RotateY(Double_t)
rotate vector around Y
Definition: TVector3.cxx:318
TPaveText * pt
void SetTheta(Double_t)
Set theta keeping mag and phi constant (BaBar).
Definition: TVector3.cxx:400
SVector< double, 2 > v
Definition: Dict.h:5
XPoint xy[kMAXMK]
Definition: TGX11.cxx:122
Double_t Perp2() const
Definition: TVector3.h:312
TClass * IsA() const
unsigned int UInt_t
Definition: RtypesCore.h:42
TMarker * m
Definition: textangle.C:8
Double_t X() const
Definition: TVector3.h:220
Double_t Mag2() const
Definition: TVector3.h:298
ClassImp(TVector3) TVector3
Definition: TVector3.cxx:167
Double_t ACos(Double_t)
Definition: TMath.h:445
#define Printf
Definition: TGeoToOCC.h:18
Double_t Cos(Double_t)
Definition: TMath.h:424
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
Double_t Exp(Double_t x)
Definition: TMath.h:495
Double_t fX
Definition: TVector3.h:190
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:415
double Double_t
Definition: RtypesCore.h:55
void SetZ(Double_t)
Definition: TVector3.h:229
Double_t Eta() const
Definition: TVector3.h:359
TVector3 & Transform(const TRotation &)
transform this vector with a TRotation
Definition: TVector3.cxx:232
void RotateZ(Double_t)
rotate vector around Z
Definition: TVector3.cxx:329
Mother of all ROOT objects.
Definition: TObject.h:58
void SetPhi(Double_t)
Set phi keeping mag and theta constant (BaBar).
Definition: TVector3.cxx:412
Double_t operator()(int) const
dereferencing operator const
Definition: TVector3.cxx:191
Double_t DeltaR(const TVector3 &) const
return deltaR with respect to v
Definition: TVector3.cxx:422
Double_t Sin(Double_t)
Definition: TMath.h:421
Double_t Y() const
Definition: TVector3.h:221
void SetX(Double_t)
Definition: TVector3.h:227
Double_t Sqrt(Double_t x)
Definition: TMath.h:464
TVector3 operator+(const TVector3 &a, const TVector3 &b)
Definition: TVector3.cxx:465
void SetPtThetaPhi(Double_t pt, Double_t theta, Double_t phi)
set Pt, Theta and Phi
Definition: TVector3.cxx:390
float * q
Definition: THbookFile.cxx:87
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:459
void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Definition: TVector3.cxx:496
void SetMagThetaPhi(Double_t mag, Double_t theta, Double_t phi)
setter with mag, theta, phi
Definition: TVector3.cxx:432
Double_t Tan(Double_t)
Definition: TMath.h:427
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
Definition: TVector3.cxx:382
Double_t ATan(Double_t)
Definition: TMath.h:451
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:904