Adding AOD task for FMDEventPlaneFinder
authorhansena <hansena@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Feb 2012 09:09:57 +0000 (09:09 +0000)
committerhansena <hansena@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Feb 2012 09:09:57 +0000 (09:09 +0000)
PWGLF/CMakelibPWGLFforward2.pkg
PWGLF/FORWARD/analysis2/AddTaskFMDEventPlane.C [new file with mode: 0644]
PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.cxx [new file with mode: 0644]
PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.h [new file with mode: 0644]
PWGLF/FORWARD/analysis2/MakeFMDEventPlane.C [new file with mode: 0644]
PWGLF/FORWARD/analysis2/trains/MakeFMDEventPlaneTrain.C [new file with mode: 0644]
PWGLF/PWGLFforward2LinkDef.h

index 7589ea8a40d09e0fca64b8b2c149ae097648358a..78ad0148b3be4c28b2129f3c234786db0cf15b87 100644 (file)
@@ -66,6 +66,7 @@ set ( SRCS
   FORWARD/analysis2/AliMCTruthdNdetaTask.cxx
   FORWARD/analysis2/AliForwardFlowTaskQC.cxx
   FORWARD/analysis2/AliForwardMCFlowTaskQC.cxx
+  FORWARD/analysis2/AliFMDEventPlaneTask.cxx
   FORWARD/analysis2/AliSPDMCTrackDensity.cxx
   FORWARD/analysis2/AliFMDMultCuts.cxx
   FORWARD/analysis2/AliPoissonCalculator.cxx
@@ -156,6 +157,8 @@ install ( FILES FORWARD/analysis2/AddTaskCentraldNdeta.C
                FORWARD/analysis2/AddTaskCentralTracks.C
                 FORWARD/analysis2/AddTaskCopyHeader.C
                FORWARD/analysis2/AddTaskFMDELoss.C
+               FORWARD/analysis2/AddTaskFMDEventPlane.C
+               FORWARD/analysis2/AddTaskForwardFlow.C
                FORWARD/analysis2/AddTaskForwardMCCorr.C
                 FORWARD/analysis2/AddTaskForwardMult.C
                 FORWARD/analysis2/AddTaskForwardQA.C
@@ -169,6 +172,8 @@ install ( FILES FORWARD/analysis2/AddTaskCentraldNdeta.C
                FORWARD/analysis2/MakedNdeta.C
                 FORWARD/analysis2/MakeELossFits.C
                FORWARD/analysis2/MakeEvaluateTriggers.C
+               FORWARD/analysis2/MakeFlow.C
+               FORWARD/analysis2/MakeFMDEventPlane.C
                 FORWARD/analysis2/MakeForwardQA.C
                FORWARD/analysis2/MakeMCCorr.C          
                 FORWARD/analysis2/OtherData.C
diff --git a/PWGLF/FORWARD/analysis2/AddTaskFMDEventPlane.C b/PWGLF/FORWARD/analysis2/AddTaskFMDEventPlane.C
new file mode 100644 (file)
index 0000000..cf888b2
--- /dev/null
@@ -0,0 +1,66 @@
+/**
+ * @file   AddTaskForwardFlow.C
+ * @author Alexander Hansen alexander.hansen@cern.ch 
+ * @date   Wed Sep 07 12:14:17 2011
+ * 
+ * @brief  
+ * 
+ * 
+ * @ingroup pwglf_forward_scripts_tasks
+ */
+/** 
+ * @defgroup pwglf_forward_flow Flow 
+ * @ingroup pwglf_forward_topical
+ */
+/** 
+ * Add Flow task to train 
+ * 
+ * @param type 
+ * @param etabins 
+ * @param mc 
+ * @param addFlow 
+ * @param addFType 
+ * @param addFOrder 
+ *
+ * @ingroup pwglf_forward_flow
+ */
+void AddTaskFMDEventPlane(Bool_t mc = kFALSE)
+{
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    Error("AddTaskFMDEventPlane", "No analysis manager to connect to.");
+    return NULL;
+  }   
+
+  AliAODInputHandler* aodInput = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+   
+  Bool_t aod = kFALSE;
+  if (aodInput) aod = kTRUE;
+  if (!aod) {
+    Error("AddTaskFMDEventPlane", "No analysis manager to connect to.");
+    return NULL;
+  }
+
+  // --- Create containers for output --- //
+  AliAnalysisDataContainer* sums = 
+    mgr->CreateContainer("FMDEventPlaneSums", TList::Class(), 
+                        AliAnalysisManager::kOutputContainer, 
+                        AliAnalysisManager::GetCommonFileName());
+  AliAnalysisDataContainer* output = 
+    mgr->CreateContainer("FMDEventPlaneResults", TList::Class(), 
+                        AliAnalysisManager::kParamContainer, 
+                        AliAnalysisManager::GetCommonFileName());
+
+  // --- For the selected flow tasks the input and output is set --- //
+  
+  AliFMDEventPlaneTask* task = new AliFMDEventPlaneTask("FMDEventPlane");
+  task->GetEventPlaneFinder().SetUsePhiWeights(false);
+
+  if (mc) task->SetMCInput(true);
+
+  mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
+  mgr->ConnectOutput(task, 1, sums);
+  mgr->ConnectOutput(task, 2, output);
+
+  return;
+}
diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.cxx b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.cxx
new file mode 100644 (file)
index 0000000..a1a503a
--- /dev/null
@@ -0,0 +1,229 @@
+//
+// Calculate the FMD eventplane 
+//
+// Inputs:
+//  - AliAODEvent
+//
+// Outputs:
+//  - AnalysisResults.root
+//
+#include <TList.h>
+#include <TMath.h>
+#include "TH2D.h"
+#include "AliLog.h"
+#include "TAxis.h"
+#include "AliAnalysisManager.h"
+#include "AliFMDEventPlaneTask.h"
+#include "AliAODHandler.h"
+#include "AliAODInputHandler.h"
+#include "AliAODForwardMult.h"
+#include "AliAODEvent.h"
+#include "AliAODForwardEP.h"
+
+ClassImp(AliFMDEventPlaneTask)
+#if 0
+; // For emacs 
+#endif
+
+AliFMDEventPlaneTask::AliFMDEventPlaneTask()
+  : AliAnalysisTaskSE(),
+    fSumList(0),        // Sum list
+    fOutputList(0),     // Output list
+    fAOD(0),            // AOD input event
+    fMC(0),              // MC flag
+    fEventPlaneFinder(), // EP finder
+    fZvertex(1111),     // Z vertex 
+    fCent(-1),          // Centrality
+    fHistCent(),         // Diagnostics histogram
+    fHistVertexSel(),    // Diagnostics histogram
+    fHistVertexAll()     // Diagnostics histogram
+{
+  // 
+  // Default constructor
+  //
+}
+//_____________________________________________________________________
+AliFMDEventPlaneTask::AliFMDEventPlaneTask(const char* name) 
+  : AliAnalysisTaskSE(name),
+    fSumList(0),                    // Sum list
+    fOutputList(0),                  // Output list
+    fAOD(0),                        // AOD input event
+    fMC(0),                          // MC flag
+    fEventPlaneFinder("eventPlane"), // EP finder
+    fZvertex(1111),                 // Z vertex 
+    fCent(-1),                       // Centrality
+    fHistCent(0),                    // Diagnostics histogram
+    fHistVertexSel(0),               // Diagnostics histogram
+    fHistVertexAll(0)                // Diagnostics histogram
+
+{
+  // 
+  // Constructor
+  //
+  // Parameters:
+  //  name: Name of task
+  //
+
+  DefineOutput(1, TList::Class());
+  DefineOutput(2, TList::Class());
+
+}
+//_____________________________________________________________________
+AliFMDEventPlaneTask::AliFMDEventPlaneTask(const AliFMDEventPlaneTask& o)
+  : AliAnalysisTaskSE(o),
+    fSumList(o.fSumList),                    // Sumlist
+    fOutputList(o.fOutputList),                     // Output list
+    fAOD(o.fAOD),                           // AOD input event
+    fMC(o.fMC),                              // MC flag
+    fEventPlaneFinder(o.fEventPlaneFinder),  // EP finder
+    fZvertex(o.fZvertex),                   // Z vertex 
+    fCent(o.fCent),                         // Centrality
+    fHistCent(o.fHistCent),                  // Diagnostics histogram
+    fHistVertexSel(o.fHistVertexSel),        // Diagnostics histogram
+    fHistVertexAll(o.fHistVertexAll)         // Diagnostics histogram
+{
+  // 
+  // Copy constructor 
+  // 
+  // Parameters:
+  //    o Object to copy from 
+  //
+}
+//_____________________________________________________________________
+AliFMDEventPlaneTask&
+AliFMDEventPlaneTask::operator=(const AliFMDEventPlaneTask& o)
+{
+  // 
+  // Assignment operator 
+  //
+  if (&o == this) return *this;
+  fSumList           = o.fSumList;
+  fOutputList        = o.fOutputList;
+  fAOD               = o.fAOD;
+  fMC                = o.fMC;
+  fEventPlaneFinder  = o.fEventPlaneFinder;
+  fZvertex           = o.fZvertex;
+  fCent              = o.fCent;
+  fHistCent          = o.fHistCent;
+  fHistVertexSel     = o.fHistVertexSel;
+  fHistVertexAll     = o.fHistVertexAll;
+
+  return *this;
+}
+//_____________________________________________________________________
+void AliFMDEventPlaneTask::UserCreateOutputObjects()
+{
+  //
+  // Create output objects
+  //
+  if (!fSumList)
+    fSumList = new TList();
+  fSumList->SetName("Sums");
+  fSumList->SetOwner();
+
+  // Diagnostics histograms
+  fHistCent          = new TH1D("hCent", "Centralities", 100, 0, 100);
+  fHistVertexSel     = new TH1D("hVertexSel", "Selectec vertices", 40, -20, 20);
+  fHistVertexAll     = new TH1D("hVertexAll", "All vertices", 40, -20, 20);
+
+  fSumList->Add(fHistCent);
+  fSumList->Add(fHistVertexSel);
+  fSumList->Add(fHistVertexAll);
+
+  // Init of EventPlaneFinder
+  TAxis* pe = new TAxis(200, -4., 6.);
+  fEventPlaneFinder.DefineOutput(fSumList);
+  fEventPlaneFinder.Init(*pe);
+
+  PostData(1, fSumList);
+
+}
+//_____________________________________________________________________
+void AliFMDEventPlaneTask::UserExec(Option_t */*option*/)
+{
+  // 
+  // Called each event
+  //
+  // Parameters:
+  //  option: Not used
+  //
+
+  // Reset data members
+  fCent = -1;
+  fZvertex = 1111;
+
+  // Get input event
+  fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
+  if (!fAOD) return;
+
+  AliAODForwardMult* aodfmult = static_cast<AliAODForwardMult*>(fAOD->FindListObject("Forward"));
+
+  if (!aodfmult) return;
+  if (!AODCheck(aodfmult)) return;
+
+  if (fAOD->GetRunNumber() != fEventPlaneFinder.GetRunNumber())
+    fEventPlaneFinder.SetRunNumber(fAOD->GetRunNumber());
+
+  AliAODForwardEP aodep;
+  TH2D fmdHist = aodfmult->GetHistogram();
+
+  fEventPlaneFinder.FindEventplane(fAOD, aodep, &fmdHist, 0);
+
+  PostData(1, fSumList);
+
+}
+//_____________________________________________________________________
+void AliFMDEventPlaneTask::Terminate(Option_t */*option*/)
+{
+  //
+  // Terminate - Called after all events
+  //
+  // Parameters:
+  //  option: Not used
+  //
+
+  // Reinitiate lists if Terminate is called separately!
+  fSumList = dynamic_cast<TList*> (GetOutputData(1));
+  if(!fSumList) {
+    AliError("Could not retrieve TList fSumList"); 
+    return; 
+  }
+  if (!fOutputList)
+    fOutputList = new TList();
+  fOutputList->SetName("Results");
+  fOutputList->SetOwner();
+
+ // Calculations can be done here: Currently there are none
+
+  PostData(2, fOutputList);
+
+}
+// _____________________________________________________________________
+Bool_t AliFMDEventPlaneTask::AODCheck(const AliAODForwardMult* aodfm) 
+{
+  // 
+  // Function to check that and AOD event meets the cuts
+  //
+  // Parameters: 
+  //  AliAODForwardMult: forward mult object with trigger and vertex info
+  //
+
+  if (!aodfm->IsTriggerBits(AliAODForwardMult::kOffline)) return kFALSE;
+
+  fCent = (Double_t)aodfm->GetCentrality();
+  if (0. >= fCent || fCent >= 80.) return kFALSE;
+  fHistCent->Fill(fCent);
+
+  fZvertex = aodfm->GetIpZ();
+  fHistVertexAll->Fill(fZvertex);
+  if (TMath::Abs(fZvertex) >= 10.) return kFALSE;
+  fHistVertexSel->Fill(fZvertex);
+
+  return kTRUE;
+
+}
+//_____________________________________________________________________
+//
+//
+// EOF
diff --git a/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.h b/PWGLF/FORWARD/analysis2/AliFMDEventPlaneTask.h
new file mode 100644 (file)
index 0000000..832ee92
--- /dev/null
@@ -0,0 +1,140 @@
+//
+// Calculate the event plane in the forward regions using the FMD 
+//
+#ifndef ALIFMDEVENTPLANETASK_H
+#define ALIFMDEVENTPLANETASK_H
+/**
+ * @file AliFMDEventPlaneTask.h
+ * @author Alexander Hansen
+ * @date   Tue Feb 21 2012
+ * 
+ * @brief
+ * 
+ * 
+ * @ingroup pwglf_forward_flow
+ */
+#include "AliAnalysisTaskSE.h"
+#include "AliFMDEventPlaneFinder.h"
+class AliAODForwardMult;
+class TH1D;
+class TH2D;
+
+ /**
+ * @defgroup pwg2_forward_tasks_flow Flow tasks 
+ * @ingroup pwg2_forward_tasks
+ */
+/**
+ * Calculate the event plane in the forward regions using the FMD
+ *
+ * @par Inputs:
+ *   - AliAODEvent
+ *
+ * Outputs:
+ *   - AnalysisResults.root
+ *
+ * @ingroup pwglf_forward_tasks_flow
+ * @ingroup pwglf_forward_flow
+ *
+ *
+ */
+class AliFMDEventPlaneTask : public AliAnalysisTaskSE
+{
+public:
+  /** 
+   * Constructor 
+   */
+  AliFMDEventPlaneTask();
+  /** 
+   * Constructor
+   * 
+   * @param name Name of task 
+   */
+  AliFMDEventPlaneTask(const char* name);
+  /**
+   * Destructor
+   */
+  virtual ~AliFMDEventPlaneTask() {}
+  /** 
+   * @{ 
+   * @name Task interface methods 
+   */
+  /** 
+   * Create output objects 
+   */
+  virtual void UserCreateOutputObjects();
+  /**
+   * Initialize the task
+   */
+  virtual void Init() {} 
+  /** 
+   * Process each event 
+   *
+   * @param option Not used
+   */  
+  virtual void UserExec(Option_t *option);
+  /** 
+   * End of job
+   * 
+   * @param option Not used 
+   */
+  virtual void Terminate(Option_t *option);
+ /**
+  * Check AODForwardMult object for trigger, vertex and centrality
+  * returns true if event is OK
+  * 
+  * @param const aodfm
+  * 
+  * @return Bool_t 
+  */
+  Bool_t AODCheck(const AliAODForwardMult* aodfm);
+ /**
+   * Get reference to the EventPlaneFinder algorithm 
+   * 
+   * @return Reference to AliFMDEventPlaneFinder object 
+   */
+  AliFMDEventPlaneFinder& GetEventPlaneFinder() { return fEventPlaneFinder; }
+  /**
+   * Get reference to the EventPlaneFinder algorithm 
+   * 
+   * @return Reference to AliFMDEventPlaneFinder object 
+   */
+  const AliFMDEventPlaneFinder& GetEventPlaneFinder() const { return fEventPlaneFinder; }
+  /*
+   * Set MC input flag - currently does nothing special
+   *
+   * @ param mc MC input flag
+   */
+  void SetMCInput(Bool_t mc = true) { fMC = mc; }
+
+protected:
+  /** 
+   * Copy constructor 
+   * 
+   * @param o Object to copy from 
+   */
+  AliFMDEventPlaneTask(const AliFMDEventPlaneTask& o);
+  /** 
+   * Assignment operator 
+   * 
+   * @return Reference to this object 
+   */
+  AliFMDEventPlaneTask& operator=(const AliFMDEventPlaneTask&);
+
+  TList*                  fSumList;          //  Sum list
+  TList*                  fOutputList;       //  Output list
+  AliAODEvent*            fAOD;              //  AOD event
+  Bool_t                  fMC;               //  MC input?
+  AliFMDEventPlaneFinder  fEventPlaneFinder; //  Eventplane finder for the FMD
+  Float_t                 fZvertex;         //  Z vertex
+  Double_t                fCent;             //  Centrality
+  TH1D*                   fHistCent;         //  Diagnostics histogram
+  TH1D*                   fHistVertexSel;    //  Diagnostics histogram
+  TH1D*                   fHistVertexAll;    //  Diagnostics histogram
+
+  ClassDef(AliFMDEventPlaneTask, 1); // Analysis task for FMD analysis
+};
+#endif
+// Local Variables:
+//   mode: C++ 
+// End:
diff --git a/PWGLF/FORWARD/analysis2/MakeFMDEventPlane.C b/PWGLF/FORWARD/analysis2/MakeFMDEventPlane.C
new file mode 100644 (file)
index 0000000..a03e2ce
--- /dev/null
@@ -0,0 +1,103 @@
+/**
+ * @file   MakeFlow.C
+ * @author Alexander Hansen 
+ * @date   Wed Mar 23 12:11:33 2011
+ * 
+ * @brief  
+ * 
+ * @ingroup pwglf_forward_scripts_makers
+ * 
+ */
+/**
+ * Script to analyse AOD input for flow
+ * 
+ * Takes either a single (AOD) .root file as input or a .txt
+ * The .txt file is expected to contain the path to the files 
+ * from the current directory or the absolute path.
+ * 
+ * @par Inputs: 
+ *  
+ * 
+ * @par Outputs: 
+ * - 
+ *
+ * @ingroup pwglf_forward_flow
+ */
+void MakeFMDEventPlane(TString data      = "", 
+                      Int_t   nEvents   = 0, 
+                       Bool_t  mc        = kFALSE,
+                      const char* name  = 0,
+                      Int_t   proof     = 0,
+                       Bool_t  gdb       = kFALSE)
+{
+  // --- Load libs ---------------------------------------------------
+  gROOT->Macro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/LoadLibs.C");
+
+  // --- Possibly use plug-in for this -------------------------------
+  if ((name && name[0] != '\0') && gSystem->Load("libRAliEn") >= 0) {
+    gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/trains/TrainSetup.C+");
+    gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/trains/MakeFMDEventPlaneTrain.C+");
+
+    MakeFMDEventPlaneTrain t(name, mc, false);
+    t.SetDataDir(data.Data());
+    t.SetDataSet("");
+    t.SetProofServer(Form("workers=%d", proof));
+    t.SetUseGDB(gdb);
+    t.Run(proof > 0 ? "proof" : "local", "full", nEvents, proof > 0);
+    return;
+  }
+
+  // --- Set the macro path ------------------------------------------
+  gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2:"
+                          "$ALICE_ROOT/ANALYSIS/macros",
+                          gROOT->GetMacroPath()));
+
+  // --- Add to chain either AOD ------------------------------------
+  if (data.IsNull()) {
+    AliError("You didn't add a data file");
+    return;
+  }
+  gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/MakeChain.C");
+  TChain* chain = MakeChain("AOD", data.Data(), true);
+  
+  // If 0 or less events is select, choose all 
+  if (nEvents <= 0) nEvents = chain->GetEntries();
+
+  // --- Initiate the event handlers --------------------------------
+  AliAnalysisManager *mgr  = new AliAnalysisManager("FMD Event Plane", 
+                                                   "Event plane forward region");
+
+  // --- AOD input handler -------------------------------------------
+  AliAODInputHandler *aodInputHandler = new AliAODInputHandler();
+  mgr->SetInputEventHandler(aodInputHandler); 
+
+  // --- Add the tasks ---------------------------------------------
+  gROOT->LoadMacro("AddTaskFMDEventPlane.C");
+  AddTaskFMDEventPlane(mc);
+
+  // --- Run the analysis --------------------------------------------
+  TStopwatch t;
+  if (!mgr->InitAnalysis()) {
+    Error("MakeFMDEventPlane", "Failed to initialize analysis train!");
+    return;
+  }
+  mgr->PrintStatus();
+  Printf("****************************************");
+  Printf("Doing FMD event plane analysis on %d Events", nEvents);
+  Printf("****************************************");
+  // 
+  if (mgr->GetDebugLevel() < 1) 
+    mgr->SetUseProgressBar(kTRUE, nEvents < 10000 ? 100 : 1000);
+
+//  mgr->SetSkipTerminate(true);
+
+  t.Start();
+  mgr->StartAnalysis("local", chain, nEvents);
+  t.Stop();
+  t.Print();
+}
+//----------------------------------------------------------------
+//
+// EOF
+//
diff --git a/PWGLF/FORWARD/analysis2/trains/MakeFMDEventPlaneTrain.C b/PWGLF/FORWARD/analysis2/trains/MakeFMDEventPlaneTrain.C
new file mode 100644 (file)
index 0000000..ba84440
--- /dev/null
@@ -0,0 +1,112 @@
+#include "TrainSetup.C"
+
+//====================================================================
+/**
+ * Analysis train to make @f$ flow@f$
+ * 
+ * To run, do 
+ * @code 
+ * gROOT->LoadMacro("TrainSetup.C");
+ * // Make train 
+ * MakeFMDEventPlaneTrain t("My Analysis");
+ * // Set variaous parameters on the train 
+ * t.SetDataDir("/home/of/data");
+ * t.AddRun(118506)
+ * // Run it 
+ * t.Run("LOCAL", "FULL", -1, false, false);
+ * @endcode 
+ *
+ * @ingroup pwglf_forward_flow
+ * @ingroup pwglf_forward_trains
+ */
+class MakeFMDEventPlaneTrain : public TrainSetup
+{
+public:
+  /** 
+   * Constructor.  Date and time must be specified when running this
+   * in Termiante mode on Grid
+   * 
+   * @param name     Name of train (free form)
+   * @param dateTime Append date and time to name 
+   * @param year     Year     - if not specified, current year
+   * @param month    Month    - if not specified, current month
+   * @param day      Day      - if not specified, current day
+   * @param hour     Hour     - if not specified, current hour
+   * @param min      Minutes  - if not specified, current minutes
+   */
+  MakeFMDEventPlaneTrain(const char* name, 
+               Bool_t      mc = false,
+               Bool_t      dateTime=false,
+               UShort_t    year  = 0, 
+               UShort_t    month = 0, 
+               UShort_t    day   = 0, 
+               UShort_t    hour  = 0, 
+               UShort_t    min   = 0) 
+    : TrainSetup(name, dateTime, year, month, day, hour, min),
+      fMC(mc)
+  {
+  }
+  /** 
+   * Run this analysis 
+   * 
+   * @param mode     Mode - see TrainSetup::EMode
+   * @param oper     Operation - see TrainSetup::EOperation
+   * @param nEvents  Number of events (negative means all)
+   * @param usePar   If true, use PARs 
+   */
+  void Run(const char* mode, const char* oper, 
+          Int_t nEvents=-1, Bool_t usePar=false)
+  {
+    Exec("AOD", mode, oper, nEvents, false, usePar);
+  }
+  /** 
+   * Run this analysis 
+   * 
+   * @param mode     Mode - see TrainSetup::EMode
+   * @param oper     Operation - see TrainSetup::EOperation
+   * @param nEvents  Number of events (negative means all)
+   * @param usePar   If true, use PARs 
+   */
+  void Run(EMode mode, EOper oper, Int_t nEvents=-1, 
+          Bool_t usePar=false)
+  {
+    Exec(kAOD, mode, oper, nEvents, false, usePar);
+  }
+protected:
+  /** 
+   * Create the tasks 
+   * 
+   * @param mode Processing mode
+   * @param par  Whether to use par files 
+   */
+  void CreateTasks(EMode mode, Bool_t par, AliAnalysisManager*)
+  {
+    // --- Output file name ------------------------------------------
+    AliAnalysisManager::SetCommonFileName("AnalysisResults.root");
+
+    // --- Load libraries/pars ---------------------------------------
+    LoadLibrary("PWGLFforward2", mode, par, true);
+    
+    // --- Set load path ---------------------------------------------
+    gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2:"
+                            "$ALICE_ROOT/ANALYSIS/macros",
+                            gROOT->GetMacroPath()));
+
+    // --- Add the task ----------------------------------------------
+    gROOT->Macro(Form("AddTaskFMDEventPlane.C(%d)", fMC));
+  }
+  /** 
+   * Do not the centrality selection
+   */
+  void CreateCentralitySelection(Bool_t, AliAnalysisManager*) {}
+  /** 
+   * Crete output handler - we don't want one here. 
+   * 
+   * @return 0
+   */
+  AliVEventHandler* CreateOutputHandler(EType) { return 0; }
+  Bool_t fMC;
+};
+//
+// EOF
+//
index 9e30e89fa3e975f3b2661a59d0a4ffdb14a647f1..48248084fc49474d865680f2de0ff02a171d75a0 100644 (file)
@@ -86,6 +86,7 @@
 #pragma link C++ class AliForwardFlowTaskQC+;
 #pragma link C++ class AliForwardFlowTaskQC::VertexBin+;
 #pragma link C++ class AliForwardMCFlowTaskQC+;
+#pragma link C++ class AliFMDEventPlaneTask+;
 #pragma link C++ class AliSPDMCTrackDensity+;
 #pragma link C++ class AliFMDMultCuts+;
 #pragma link C++ class AliPoissonCalculator+;