2 // Calculate the FMD eventplane
8 // - AnalysisResults.root
11 * @file AliFMDEventPlaneTask.cxx
12 * @author Christian Holm Christensen <cholm@master.hehi.nbi.dk>
13 * @date Thu Feb 7 01:09:40 2013
18 * @ingroup pwglf_forward_flow
25 #include "AliAnalysisManager.h"
26 #include "AliFMDEventPlaneTask.h"
27 #include "AliAODHandler.h"
28 #include "AliAODInputHandler.h"
29 #include "AliAODForwardMult.h"
30 #include "AliAODEvent.h"
31 #include "AliAODForwardEP.h"
33 ClassImp(AliFMDEventPlaneTask)
38 AliFMDEventPlaneTask::AliFMDEventPlaneTask()
40 fEventPlaneFinder(), // EP finder
41 fHistVertexSel() // Diagnostics histogram
44 // Default constructor
46 DGUARD(fDebug, 3,"Default CTOR of AliFMDEventPlaneTask");
48 //_____________________________________________________________________
49 AliFMDEventPlaneTask::AliFMDEventPlaneTask(const char* name)
50 : AliBaseAODTask(name, "AliFMDEventPlaneTask"),
51 fEventPlaneFinder("eventPlane"), // EP finder
52 fHistVertexSel(0) // Diagnostics histogram
60 DGUARD(fDebug, 3,"Named CTOR of AliFMDEventPlaneTask: %s", name);
62 //_____________________________________________________________________
63 Bool_t AliFMDEventPlaneTask::Book()
66 // Create output objects
68 DGUARD(fDebug,1,"Create user objects of AliFMDEventPlaneTask");
69 // Diagnostics histograms
70 fHistVertexSel = new TH1D("hVertexSel", "Selected vertices", 40, -20, 20);
72 fSums->Add(fHistVertexSel);
74 // Init of EventPlaneFinder
75 TAxis* pe = new TAxis(200, -4., 6.);
76 fEventPlaneFinder.CreateOutputObjects(fSums);
77 fEventPlaneFinder.SetupForData(*pe);
81 //_____________________________________________________________________
82 Bool_t AliFMDEventPlaneTask::Event(AliAODEvent& aod)
90 DGUARD(fDebug,1,"Process an event in AliFMDEventPlaneTask");
93 AliAODForwardMult* aodfmult = GetForward(aod);
94 fHistVertexSel->Fill(aodfmult->GetIpZ());
96 if (aod.GetRunNumber() != fEventPlaneFinder.GetRunNumber())
97 fEventPlaneFinder.SetRunNumber(aod.GetRunNumber());
99 AliAODForwardEP aodep;
100 TH2D& fmdHist = aodfmult->GetHistogram();
102 fEventPlaneFinder.FindEventplane(&aod, aodep, &fmdHist, 0);
106 //_____________________________________________________________________
107 Bool_t AliFMDEventPlaneTask::Finalize()
110 // Terminate - Called after all events
115 DGUARD(fDebug,1,"Process merged output of AliFMDEventPlaneTask");
117 // Calculations can be done here: Currently there are none
118 // Summed histograms can be found in the list fSums
119 // Output should be stored in the output list fResults
123 //_____________________________________________________________________