]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/macros/AddTaskEventplane.C
Changes to the DEtaDPhi corr fun (making 0 in the center of the bin in the histogram...
[u/mrichter/AliRoot.git] / ANALYSIS / macros / AddTaskEventplane.C
index fe35e6ab592482933eabc788aa9acd6f838da212..69b9fd5ba56dec934dca22b2808ba8865e645114 100644 (file)
@@ -1,6 +1,12 @@
-AliEPSelectionTask *AddTaskEventplane()
+AliEPSelectionTask *AddTaskEventplane(Bool_t useEtaGap=kFALSE,Float_t etaGap=0.,Bool_t posTPCAOD=kFALSE,TString containername = "EPStat")
 {
   // Macro to connect an event plane selection task to an existing analysis manager.
+
+  if(useEtaGap && posTPCAOD){
+    ::Error("AddTaskEventplane", "eta-splitting of events and one side of TPC not possible at same time!");
+    return NULL;
+  }
+  
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
     ::Error("AddTaskEventplane", "No analysis manager to connect to.");
@@ -13,22 +19,31 @@ AliEPSelectionTask *AddTaskEventplane()
     return NULL;
   }
   TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
-  if (inputDataType != "ESD") {
-    ::Error("AddTaskEventplane", "This task works only on ESD analysis");
-    return NULL;
-  }
   
   AliEPSelectionTask *eventplaneTask = new AliEPSelectionTask("EventplaneSelection");
-  eventplaneTask->SelectCollisionCandidates(AliVEvent::kMB);
+  eventplaneTask->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kSemiCentral | AliVEvent::kCentral);
+  if (inputDataType == "AOD"){
+    eventplaneTask->SetInput("AOD");
+  }
   eventplaneTask->SetTrackType("TPC");
   eventplaneTask->SetUsePtWeight();
   eventplaneTask->SetUsePhiWeight();
   eventplaneTask->SetSaveTrackContribution();
+  if(useEtaGap){
+    eventplaneTask->SetSubeventsSplitMethod(AliEPSelectionTask::kEta); 
+    eventplaneTask->SetEtaGap(etaGap); 
+  }
+  if(posTPCAOD){
+    eventplaneTask->SetPersonalAODtrackCuts(128,0.,0.8,0.15,20.);
+    eventplaneTask->SetSubeventsSplitMethod(AliEPSelectionTask::kRandom);
+  }
+
   
   mgr->AddTask(eventplaneTask);
 
   AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
-  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("EPStat",
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(containername,
                 TList::Class(), AliAnalysisManager::kOutputContainer,
                 "EventStat_temp.root");