AliPhysics  dbaf93c (dbaf93c)
AliFMDEventPlaneTask.cxx
Go to the documentation of this file.
1 //
2 // Calculate the FMD eventplane
3 //
4 // Inputs:
5 // - AliAODEvent
6 //
7 // Outputs:
8 // - AnalysisResults.root
9 //
20 #include <TList.h>
21 #include <TMath.h>
22 #include "TH2D.h"
23 #include "AliLog.h"
24 #include "TAxis.h"
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"
32 
33 ClassImp(AliFMDEventPlaneTask)
34 #if 0
35 ; // For emacs
36 #endif
37 
39  : AliBaseAODTask(),
40  fEventPlaneFinder(), // EP finder
41  fHistVertexSel() // Diagnostics histogram
42 {
43  //
44  // Default constructor
45  //
46  DGUARD(fDebug, 3,"Default CTOR of AliFMDEventPlaneTask");
47 }
48 //_____________________________________________________________________
50  : AliBaseAODTask(name, "AliFMDEventPlaneTask"),
51  fEventPlaneFinder("eventPlane"), // EP finder
52  fHistVertexSel(0) // Diagnostics histogram
53 {
54  //
55  // Constructor
56  //
57  // Parameters:
58  // name: Name of task
59  //
60  DGUARD(fDebug, 3,"Named CTOR of AliFMDEventPlaneTask: %s", name);
61 }
62 //_____________________________________________________________________
64 {
65  //
66  // Create output objects
67  //
68  DGUARD(fDebug,1,"Create user objects of AliFMDEventPlaneTask");
69  // Diagnostics histograms
70  fHistVertexSel = new TH1D("hVertexSel", "Selected vertices", 40, -20, 20);
71 
72  fSums->Add(fHistVertexSel);
73 
74  // Init of EventPlaneFinder
75  TAxis* pe = new TAxis(200, -4., 6.);
78 
79  return true;
80 }
81 //_____________________________________________________________________
83 {
84  //
85  // Called each event
86  //
87  // Parameters:
88  // option: Not used
89  //
90  DGUARD(fDebug,1,"Process an event in AliFMDEventPlaneTask");
91 
92  // Reset data members
93  AliAODForwardMult* aodfmult = GetForward(aod);
94  fHistVertexSel->Fill(aodfmult->GetIpZ());
95 
96  if (aod.GetRunNumber() != fEventPlaneFinder.GetRunNumber())
97  fEventPlaneFinder.SetRunNumber(aod.GetRunNumber());
98 
99  AliAODForwardEP aodep;
100  TH2D& fmdHist = aodfmult->GetHistogram();
101 
102  fEventPlaneFinder.FindEventplane(&aod, aodep, &fmdHist, 0);
103 
104  return true;
105 }
106 //_____________________________________________________________________
108 {
109  //
110  // Terminate - Called after all events
111  //
112  // Parameters:
113  // option: Not used
114  //
115  DGUARD(fDebug,1,"Process merged output of AliFMDEventPlaneTask");
116 
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
120 
121  return true;
122 }
123 //_____________________________________________________________________
124 //
125 //
126 // EOF
virtual void SetupForData(const TAxis &etaAxis)
Float_t GetIpZ() const
virtual void CreateOutputObjects(TList *dir)
Per-event per bin.
virtual Bool_t Event(AliAODEvent &aod)
Definition: External.C:228
Definition: External.C:212
#define DGUARD(L, N, F,...)
AliAODForwardMult * GetForward(const AliAODEvent &aod, Bool_t mc=false, Bool_t verb=true)
bool Bool_t
Definition: External.C:53
Bool_t FindEventplane(AliVEvent *esd, AliAODForwardEP &aodEp, TH2D *h, AliForwardUtil::Histos *hists)
const TH2D & GetHistogram() const
AliFMDEventPlaneFinder fEventPlaneFinder