add event plane control histogram to counter and protection for proof
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2012 14:43:19 +0000 (14:43 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2012 14:43:19 +0000 (14:43 +0000)
PWG/CaloTrackCorrBase/AliAnalysisTaskCounter.cxx
PWG/CaloTrackCorrBase/AliAnalysisTaskCounter.h

index 27f7aef..abfc4f3 100644 (file)
@@ -64,7 +64,7 @@ AliAnalysisTaskCounter::AliAnalysisTaskCounter(const char *name)
   fhNEvents(0),
   fhXVertex(0),    fhYVertex(0),    fhZVertex(0),
   fhXGoodVertex(0),fhYGoodVertex(0),fhZGoodVertex(0),
-  fhCentrality(0)
+  fhCentrality(0), fhEventPlaneAngle(0)
 {
   //ctor
   DefineOutput(1, TList::Class());
@@ -83,7 +83,7 @@ AliAnalysisTaskCounter::AliAnalysisTaskCounter()
     fhNEvents(0),
     fhXVertex(0),    fhYVertex(0),    fhZVertex(0),
     fhXGoodVertex(0),fhYGoodVertex(0),fhZGoodVertex(0),
-    fhCentrality(0)
+    fhCentrality(0), fhEventPlaneAngle(0)
 {
   // ctor
   DefineOutput(1, TList::Class());
@@ -93,7 +93,11 @@ AliAnalysisTaskCounter::AliAnalysisTaskCounter()
 AliAnalysisTaskCounter::~AliAnalysisTaskCounter()
 {
   //Destructor
-  if(fOutputContainer){
+  
+  if (AliAnalysisManager::GetAnalysisManager()->IsProofMode()) return;
+  
+  if(fOutputContainer)
+  {
     fOutputContainer->Delete() ; 
     delete fOutputContainer ;
   }
@@ -139,6 +143,10 @@ void AliAnalysisTaskCounter::UserCreateOutputObjects()
   fhCentrality->SetXTitle("Centrality bin");
   fOutputContainer->Add(fhCentrality) ;  
   
+  fhEventPlaneAngle=new TH1F("hEventPlaneAngle","Number of events in event plane, |vz|<10 cm, method <V0> ",100,0.,TMath::Pi()) ;
+  fhEventPlaneAngle->SetXTitle("EP angle (rad)");
+  fOutputContainer->Add(fhEventPlaneAngle) ;
+  
   fhNEvents = new TH1I("hNEvents", "Number of analyzed events", 21, 0, 21) ;
   fhNEvents->SetXTitle("Selection");
   fhNEvents->SetYTitle("# events");
@@ -343,9 +351,19 @@ void AliAnalysisTaskCounter::UserExec(Option_t *)
                      fhNEvents->Fill(14.5); 
     if(!bPileup)     fhNEvents->Fill(15.5); 
 
-    if(TMath::Abs(v[2]) < 10 && InputEvent()->GetCentrality()) 
+    if(TMath::Abs(v[2]) < 10.) 
     {
-      fhCentrality->Fill(InputEvent()->GetCentrality()->GetCentralityPercentile("V0M"));
+      if(InputEvent()->GetCentrality()) 
+        fhCentrality->Fill(InputEvent()->GetCentrality()->GetCentralityPercentile("V0M"));
+      
+      if(InputEvent()->GetEventplane()) 
+      {
+        Float_t ep = InputEvent()->GetEventplane()->GetEventplane("V0", InputEvent());
+      
+        ep+=TMath::Pi()/2.; // put same range as for <Q> method, [0,pi]
+        
+        fhEventPlaneAngle->Fill(ep);
+      }
     }
   
   }
index 127fa6c..8a5fcf8 100644 (file)
@@ -58,11 +58,12 @@ class AliAnalysisTaskCounter : public AliAnalysisTaskSE {
   TH1F *  fhYGoodVertex;  //! Y Vertex good distribution
   TH1F *  fhZGoodVertex;  //! Z Vertex good distribution  
   TH1F *  fhCentrality;   //! centrality
-  
+  TH1F *  fhEventPlaneAngle; //! Histogram with Event plane angle
+
   AliAnalysisTaskCounter(           const AliAnalysisTaskCounter&); // not implemented  
   AliAnalysisTaskCounter& operator=(const AliAnalysisTaskCounter&); // not implemented
   
-  ClassDef(AliAnalysisTaskCounter, 2);
+  ClassDef(AliAnalysisTaskCounter, 3);
 
 };