]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Introduction of VZERO event plane using the equalized channels.
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Nov 2011 13:47:37 +0000 (13:47 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Nov 2011 13:47:37 +0000 (13:47 +0000)
STEER/STEERBase/AliEventplane.cxx
STEER/STEERBase/AliEventplane.h

index c1875d1f0f8d942d9617542aa21b66a79167ce84..654c6179d9a0dc966e81c5ee57fc9d75f917e2ee 100644 (file)
 //*****************************************************
 /// A container for the event plane stored in AOD in ESD
  
+#include "AliLog.h"
 #include "AliEventplane.h"
 #include "TVector2.h"
 #include "AliVTrack.h"
 #include "TObjArray.h"
 #include "TArrayF.h"
+#include "AliVEvent.h"
+#include "AliVVZERO.h"
 
 ClassImp(AliEventplane)
 
@@ -150,13 +153,52 @@ TVector2* AliEventplane::GetQVector()
   return fQVector;
 }
 
-Double_t AliEventplane::GetEventplane(const char *x)
+Double_t AliEventplane::GetEventplane(const char *x, const AliVEvent *event, Int_t harmonic) const
 {
   TString method = x;
   if(method.CompareTo("Q")==0)      return fEventplaneQ;
-  return -1;
+  else if(method.CompareTo("V0A")==0) return CalculateVZEROEventPlane(event, 4, 7, harmonic);
+  else if(method.CompareTo("V0C")==0) return CalculateVZEROEventPlane(event, 0, 3, harmonic);
+  else if(method.CompareTo("V0")==0)  return CalculateVZEROEventPlane(event, 0, 7, harmonic);
+
+  return -1000.;
+}
+
+Double_t AliEventplane::CalculateVZEROEventPlane(const AliVEvent *  event, Int_t firstRing, Int_t lastRing, Int_t harmonic) const
+{
+  if(!event) {
+    AliError("No Event received");
+    return -1000.;
+  }
+  AliVVZERO *vzeroData = event->GetVZEROData();
+  if(!vzeroData) {
+    AliError("Enable to get VZERO Data");
+    return -1000.;
+  }
+  if(harmonic <= 0) {
+    AliError("Required harmonic is less or equal to 0");
+    return -1000.;
+  }
+
+  Double_t qx=0., qy=0.;
+  for(Int_t iCh = firstRing*8; iCh < (lastRing+1)*8; ++iCh) {
+    if(iCh<32) {
+      if(!vzeroData->BBTriggerV0C(iCh)) continue;
+    }
+    else {
+      if(!vzeroData->BBTriggerV0A(iCh)) continue;                              
+    }
+    Double_t phi = TMath::Pi()/8. + (iCh%8) * TMath::Pi()/4.;
+
+    Double_t mult = event->GetVZEROEqMultiplicity(iCh);
+
+    qx += mult*TMath::Cos(harmonic*phi);
+    qy += mult*TMath::Sin(harmonic*phi);
+  }
+  return (TMath::ATan2(qy,qx)/harmonic);
 }
 
+
 TVector2* AliEventplane::GetQsub1()
 {
   return fQsub1;
index 5eaf30ed29c13768b95b571a6617cb0bae411b7e..d19017157ad392a12c2edf18a33af84402db7384 100644 (file)
@@ -15,6 +15,7 @@ class TVector2;
 class AliVTrack;
 class TObjArray;
 class TArrayF;
+class AliVEvent;
 
 class AliEventplane : public TNamed
 {
@@ -46,11 +47,12 @@ class AliEventplane : public TNamed
   TArrayF*  GetQContributionYArraysub1() { return fQContributionYsub1; }
   TArrayF*  GetQContributionXArraysub2() { return fQContributionXsub2; }
   TArrayF*  GetQContributionYArraysub2() { return fQContributionYsub2; }
-  Double_t  GetEventplane(const char *method);
+  Double_t  GetEventplane(const char *x, const AliVEvent *event = NULL, Int_t harmonic = 2) const;
   TVector2* GetQsub1();
   TVector2* GetQsub2();
   Double_t  GetQsubRes();
   Bool_t    IsEventInEventplaneClass(Double_t a, Double_t b, const char *method);
+  Double_t  CalculateVZEROEventPlane(const AliVEvent *event, Int_t firstRing, Int_t lastRing, Int_t harmonic) const;
 
   void Reset();
 
@@ -67,6 +69,6 @@ class AliEventplane : public TNamed
    TVector2* fQsub2;            // Q-Vector of subevent 2
    Double_t fQsubRes;           // Difference of EP angles of subevents
  
-  ClassDef(AliEventplane, 2)
+  ClassDef(AliEventplane, 3)
 };
 #endif //ALIEVENTPLANE_H