and accuracy improved in Ali3Vector::GetPseudoRapidity().
// Provide the pseudo-rapidity w.r.t. the z-axis.
// In other words : eta=-log(tan(theta/2))
// The error on the scalar result (pseudo-rap.) is updated accordingly
+ Double_t pi=acos(-1.);
Double_t v[3];
GetVector(v,"sph");
Double_t thetahalf=v[1]/2.;
- Double_t arg=tan(thetahalf);
- Double_t eta=0;
+ Double_t arg=0;
+ if (v[1]<pi) arg=tan(thetahalf);
+ Double_t eta=9999;
if (arg>0) eta=-log(arg);
Double_t e[3];
GetErrors(e,"sph");
Double_t AliJet::GetPl()
{
// Provide long. momentum value w.r.t. z-axis.
+// Note : the returned value can also be negative.
// The error on the value can be obtained by GetResultError()
// after invokation of GetPl().
Ali3Vector v;
v=GetVecLong();
- Double_t norm=v.GetNorm();
+
+ Double_t pl=v.GetNorm();
fDresult=v.GetResultError();
- return norm;
+ Double_t a[3];
+ v.GetVector(a,"sph");
+ if (cos(a[1])<0) pl=-pl;
+
+ return pl;
}
///////////////////////////////////////////////////////////////////////////
Double_t AliJet::GetEt()
Double_t AliJet::GetEl()
{
// Provide long. energy value w.r.t. z-axis.
+// Note : the returned value can also be negative.
// The error on the value can be obtained by GetResultError()
// after invokation of GetEl().
Double_t el=GetScaLong();
return mt;
}
///////////////////////////////////////////////////////////////////////////
+Double_t AliJet::GetRapidity()
+{
+// Provide rapidity value w.r.t. z-axis.
+// The error on the value can be obtained by GetResultError()
+// after invokation of GetRapidity().
+// Note : Also GetPseudoRapidity() is available since this class is
+// derived from Ali4Vector.
+ Double_t e=GetEnergy();
+ Double_t de=GetResultError();
+ Double_t pl=GetPl();
+ Double_t dpl=GetResultError();
+ Double_t sum=e+pl;
+ Double_t dif=e-pl;
+
+ Double_t y=9999,dy2=0;
+ if (sum && dif) y=0.5*log(sum/dif);
+
+ if (sum*dif) dy2=(1./(sum*dif))*(pow((pl*de),2)+pow((e*dpl),2));
+
+ fDresult=sqrt(dy2);
+ return y;
+}
+///////////////////////////////////////////////////////////////////////////
Double_t GetEt(); // Provide trans. energy w.r.t. z-axis
Double_t GetEl(); // Provide long. energy w.r.t. z-axis
Double_t GetMt(); // Provide trans. mass w.r.t. z-axis
+ Double_t GetRapidity(); // Provide rapidity value w.r.t. z-axis
protected:
void SetNtinit(Int_t n=2); // Set the initial max. number of tracks for this Jet
Double_t AliTrack::GetPl()
{
// Provide long. momentum value w.r.t. z-axis.
+// Note : the returned value can also be negative.
// The error on the value can be obtained by GetResultError()
// after invokation of GetPl().
Ali3Vector v;
v=GetVecLong();
- Double_t norm=v.GetNorm();
+
+ Double_t pl=v.GetNorm();
fDresult=v.GetResultError();
- return norm;
+ Double_t a[3];
+ v.GetVector(a,"sph");
+ if (cos(a[1])<0) pl=-pl;
+
+ return pl;
}
///////////////////////////////////////////////////////////////////////////
Double_t AliTrack::GetEt()
Double_t AliTrack::GetEl()
{
// Provide long. energy value w.r.t. z-axis.
+// Note : the returned value can also be negative.
// The error on the value can be obtained by GetResultError()
// after invokation of GetEl().
Double_t el=GetScaLong();
return mt;
}
///////////////////////////////////////////////////////////////////////////
+Double_t AliTrack::GetRapidity()
+{
+// Provide rapidity value w.r.t. z-axis.
+// The error on the value can be obtained by GetResultError()
+// after invokation of GetRapidity().
+// Note : Also GetPseudoRapidity() is available since this class is
+// derived from Ali4Vector.
+ Double_t e=GetEnergy();
+ Double_t de=GetResultError();
+ Double_t pl=GetPl();
+ Double_t dpl=GetResultError();
+ Double_t sum=e+pl;
+ Double_t dif=e-pl;
+
+ Double_t y=9999,dy2=0;
+ if (sum && dif) y=0.5*log(sum/dif);
+
+ if (sum*dif) dy2=(1./(sum*dif))*(pow((pl*de),2)+pow((e*dpl),2));
+
+ fDresult=sqrt(dy2);
+ return y;
+}
+///////////////////////////////////////////////////////////////////////////
Double_t GetEl(); // Provide long. energy w.r.t. z-axis
Double_t GetMt(); // Provide trans. mass w.r.t. z-axis
Double_t GetMt(Int_t j); // Provide trans. mass w.r.t. z-axis and jth mass hypothesis
+ Double_t GetRapidity(); // Provide rapidity value w.r.t. z-axis
protected:
Float_t fQ; // The charge of the particle
introduced for AliTrack and AliJet.
For AliTrack there is an additional GetMt(j) to provide the Mt
value for the jth mass hypothesis.
+14-jun-2001 NvE Memberfunction GetRapidity() introduced for AliTrack and AliJet
+ and accuracy improved in Ali3Vector::GetPseudoRapidity().