]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - UNICOR/AliDEvent.cxx
ALICE version of the Universal Correlation analysis package UNICOR.
[u/mrichter/AliRoot.git] / UNICOR / AliDEvent.cxx
diff --git a/UNICOR/AliDEvent.cxx b/UNICOR/AliDEvent.cxx
new file mode 100644 (file)
index 0000000..438d140
--- /dev/null
@@ -0,0 +1,58 @@
+// Author: Dariusz Miskowiec <mailto:d.miskowiec@gsi.de> 2007
+
+//=============================================================================
+// parent class of all events; analyzers access data via this class
+//=============================================================================
+
+#include <TObject.h>
+#include "AliDEvent.h"
+
+ClassImp(AliDEvent)
+
+//=============================================================================
+void AliDEvent::RP(Double_t &qx, Double_t &qy, Int_t harmonic) const 
+{
+  // simplest flow vector
+
+  qx=0; 
+  qy=0;
+  for (int i=0; i<NParticles(); i++) {
+    if (!ParticleGood(i,0)) continue;
+    double pt = ParticlePt(i);
+    if (pt>2.0) pt = 2.0; // from 2 GeV flow saturates anyway
+    qx += pt*cos(harmonic*ParticlePhi(i));
+    qy += pt*sin(harmonic*ParticlePhi(i));
+  }
+}
+//=============================================================================
+Double_t AliDEvent::ParticleEta(Int_t i) const 
+{
+  // pseudorapidity
+
+  double the = ParticleTheta(i); 
+  if (the<0.0001) return 10; 
+  else if (the>TMath::Pi()-0.0001) return -10;
+  return -TMath::Log(TMath::Tan(the/2));
+}
+//=============================================================================
+Double_t AliDEvent::ParticleY(Int_t i, Double_t mass) const 
+{
+  // rapidity
+
+  double pp = ParticleP(i);
+  double ee = sqrt(fabs(mass*mass + pp*pp));
+  double pz = ParticlePz(i);
+  double yy = log((ee+pz)/(ee-pz))/2;
+  return yy;
+}
+//=============================================================================
+Double_t AliDEvent::PairDCA(Int_t i0, Int_t i1, 
+                        Double_t *x0, Double_t *y0, 
+                        Double_t *x1, Double_t *y1) const 
+{
+  // distance of closest approach for pair of tracks; under construction
+
+  return 10;
+}
+//=============================================================================
+