14-jun-2001 NvE Memberfunction GetRapidity() introduced for AliTrack and AliJet
authornick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Jun 2001 10:37:48 +0000 (10:37 +0000)
committernick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Jun 2001 10:37:48 +0000 (10:37 +0000)
                and accuracy improved in Ali3Vector::GetPseudoRapidity().

RALICE/Ali3Vector.cxx
RALICE/AliJet.cxx
RALICE/AliJet.h
RALICE/AliTrack.cxx
RALICE/AliTrack.h
RALICE/history.txt

index cdf6d31e141a7cecbb7e0c5ae82d7aa38c16dd75..a4cbdcb0160ffd8f4cd57b886b027c118f73c35d 100644 (file)
@@ -443,11 +443,13 @@ Double_t 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");
index 7e41e7c3134ded36a8d7d6191ed7dc8715045fec..2d65bc28d4034304abb1564c7f7bb54517e404e2 100644 (file)
@@ -262,14 +262,20 @@ Double_t AliJet::GetPt()
 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()
@@ -285,6 +291,7 @@ 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();
@@ -310,3 +317,26 @@ Double_t AliJet::GetMt()
  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;
+}
+///////////////////////////////////////////////////////////////////////////
index 6ee693faac038283bd96ce312d53bd63b6a97a05..a71ec51b73023217f0433b952faf2ae18441a698 100644 (file)
@@ -38,6 +38,7 @@ class AliJet : public TObject,public Ali4Vector
   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
index 1d66ae3ee9ace5f2ca38f977f0848ef6eb9e498b..191300dec6338725ed1327b3c350365557df4e69 100644 (file)
@@ -681,14 +681,20 @@ Double_t AliTrack::GetPt()
 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()
@@ -704,6 +710,7 @@ 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();
@@ -749,3 +756,26 @@ Double_t AliTrack::GetMt(Int_t j)
  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;
+}
+///////////////////////////////////////////////////////////////////////////
index 60c757243cb9c673410bde55e55a817cedd22a3e..eff2b9eadda20d49db27b408a82cccfc8243e1ff 100644 (file)
@@ -56,6 +56,7 @@ class AliTrack : public TObject,public Ali4Vector
   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
index 7488abb7145db9d95a292fd5f7b9762e44d5719c..8d8864d83bae04376bd29abc0a1f901161d23be5 100644 (file)
                 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().