+Ali3Vector Ali4Vector::GetBetaVector() const
+{
+// Provide the beta 3-vector corresponding to this 4-vector.
+ Ali3Vector beta;
+ if (fabs(fV0)>0.) beta=fV/fV0;
+ if (fabs(fDv0)>0.)
+ {
+ Double_t vecv[3],errv[3],errb[3];
+ Double_t sqerr=0;
+ fV.GetVector(vecv,"car");
+ fV.GetErrors(errv,"car");
+ for (Int_t i=0; i<3; i++)
+ {
+ sqerr=pow((errv[i]/fV0),2)+pow((vecv[i]*fDv0/(fV0*fV0)),2);
+ errb[i]=sqrt(sqerr);
+ }
+ beta.SetErrors(errb,"car");
+ }
+ return beta;
+}
+///////////////////////////////////////////////////////////////////////////
+Double_t Ali4Vector::GetBeta()
+{
+// Provide the beta value (i.e. v/c) corresponding to this 4-vector.
+ Ali3Vector beta=GetBetaVector();
+ Double_t val=beta.GetNorm();
+ fDresult=beta.GetResultError();
+ return val;
+}
+///////////////////////////////////////////////////////////////////////////
+Double_t Ali4Vector::GetGamma()
+{
+// Provide the Lorentz gamma factor corresponding to this 4-vector.
+// In case the gamma factor is infinite a value of -1 is returned.
+ Double_t gamma=-1;
+ fDresult=0;
+ Double_t inv=sqrt(fabs(fV2));
+ if (inv>0.)
+ {
+ Double_t dinv=fDv2/(2.*inv);
+ gamma=fV0/inv;
+ Double_t sqerr=pow((fDv0/inv),2)+pow((fV0*dinv/fV2),2);
+ fDresult=sqrt(sqerr);
+ }
+ 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.
+// 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;
+ Ali3Vector v2=q.Get3Vector();
+
+ Double_t ang=v1.GetOpeningAngle(v2,u);
+ fDresult=v1.GetResultError();
+
+ 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;
+}
+///////////////////////////////////////////////////////////////////////////