]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RALICE/Ali4Vector.cxx
08-oct-2007 NvE ADC (de)calibration function formula corrected for TWR data in IceDB2...
[u/mrichter/AliRoot.git] / RALICE / Ali4Vector.cxx
index ade85d3221fb043c50f60237fe1a568837797572..cb3b6659fd4d9264cf2b46a4a6d10c6f47871013 100644 (file)
@@ -970,6 +970,41 @@ Double_t Ali4Vector::GetGamma()
  return gamma;
 }
 ///////////////////////////////////////////////////////////////////////////
+Double_t Ali4Vector::GetX(Int_t i,TString f,TString u)
+{
+// Provide i-th vector component according to reference frame f.
+//
+// The string argument "u" allows to choose between different angular units
+// in case e.g. a spherical frame is selected.
+// u = "rad" : angles provided in radians
+//     "deg" : angles provided in degrees
+//
+// The default is u="rad".
+//
+// The vector components are addressed via the generic x0,x1,x2,x3 notation.
+// So, i=0 denotes the scalar component and i=1 denotes the first 3-vector component.
+// The error on the selected component can be obtained via the
+// usual GetResultError() facility.
+ fDresult=0;
+
+ if (i<0 || i>3) return 0;
+
+ Double_t x=0;
+
+ if (i==0)
+ {
+  x=GetScalar();
+ }
+ else
+ {
+  x=fV.GetX(i,f,u);
+  fDresult=fV.GetResultError();
+ }
+
+ return x;
+}
+///////////////////////////////////////////////////////////////////////////
 Double_t Ali4Vector::GetOpeningAngle(Ali4Vector& q,TString u)
 {
 // Provide the opening angle between 3-vector parts with 4-vector q.
@@ -988,3 +1023,20 @@ Double_t Ali4Vector::GetOpeningAngle(Ali4Vector& q,TString u)
  return ang;
 }
 ///////////////////////////////////////////////////////////////////////////
+Double_t Ali4Vector::GetOpeningAngle(Ali3Vector& q,TString u)
+{
+// Provide the opening angle between the 3-vector part and 3-vector q.
+// The string argument "u" allows to choose between different output units.
+// u = "rad" : opening angle provided in radians
+//     "deg" : opening angle provided in degrees
+//
+// The default is u="rad".
+
+ Ali3Vector v1=fV;
+
+ Double_t ang=v1.GetOpeningAngle(q,u);
+ fDresult=v1.GetResultError();
+
+ return ang;
+}
+///////////////////////////////////////////////////////////////////////////