]>
Commit | Line | Data |
---|---|---|
9632bb06 | 1 | // |
2 | // Calculate the FMD eventplane | |
3 | // | |
4 | // Inputs: | |
5 | // - AliAODEvent | |
6 | // | |
7 | // Outputs: | |
8 | // - AnalysisResults.root | |
9 | // | |
33438b4c | 10 | /** |
11 | * @file AliFMDEventPlaneTask.cxx | |
12 | * @author Christian Holm Christensen <cholm@master.hehi.nbi.dk> | |
13 | * @date Thu Feb 7 01:09:40 2013 | |
14 | * | |
15 | * @brief | |
16 | * | |
17 | * | |
18 | * @ingroup pwglf_forward_flow | |
19 | */ | |
9632bb06 | 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 | ||
38 | AliFMDEventPlaneTask::AliFMDEventPlaneTask() | |
c8b1a7db | 39 | : AliBaseAODTask(), |
9632bb06 | 40 | fEventPlaneFinder(), // EP finder |
c8b1a7db | 41 | fHistVertexSel() // Diagnostics histogram |
9632bb06 | 42 | { |
43 | // | |
44 | // Default constructor | |
45 | // | |
60242a56 | 46 | DGUARD(fDebug, 3,"Default CTOR of AliFMDEventPlaneTask"); |
9632bb06 | 47 | } |
48 | //_____________________________________________________________________ | |
49 | AliFMDEventPlaneTask::AliFMDEventPlaneTask(const char* name) | |
c8b1a7db | 50 | : AliBaseAODTask(name), |
9632bb06 | 51 | fEventPlaneFinder("eventPlane"), // EP finder |
c8b1a7db | 52 | fHistVertexSel(0) // Diagnostics histogram |
9632bb06 | 53 | { |
54 | // | |
55 | // Constructor | |
56 | // | |
57 | // Parameters: | |
58 | // name: Name of task | |
59 | // | |
60242a56 | 60 | DGUARD(fDebug, 3,"Named CTOR of AliFMDEventPlaneTask: %s", name); |
9632bb06 | 61 | } |
62 | //_____________________________________________________________________ | |
c8b1a7db | 63 | Bool_t AliFMDEventPlaneTask::Book() |
9632bb06 | 64 | { |
65 | // | |
66 | // Create output objects | |
67 | // | |
6ab100ec | 68 | DGUARD(fDebug,1,"Create user objects of AliFMDEventPlaneTask"); |
9632bb06 | 69 | // Diagnostics histograms |
c8b1a7db | 70 | fHistVertexSel = new TH1D("hVertexSel", "Selected vertices", 40, -20, 20); |
9632bb06 | 71 | |
c8b1a7db | 72 | fSums->Add(fHistVertexSel); |
9632bb06 | 73 | |
74 | // Init of EventPlaneFinder | |
75 | TAxis* pe = new TAxis(200, -4., 6.); | |
c8b1a7db | 76 | fEventPlaneFinder.CreateOutputObjects(fSums); |
5934a3e3 | 77 | fEventPlaneFinder.SetupForData(*pe); |
9632bb06 | 78 | |
c8b1a7db | 79 | return true; |
9632bb06 | 80 | } |
81 | //_____________________________________________________________________ | |
c8b1a7db | 82 | Bool_t AliFMDEventPlaneTask::Event(AliAODEvent& aod) |
9632bb06 | 83 | { |
84 | // | |
85 | // Called each event | |
86 | // | |
87 | // Parameters: | |
88 | // option: Not used | |
89 | // | |
6ab100ec | 90 | DGUARD(fDebug,1,"Process an event in AliFMDEventPlaneTask"); |
9632bb06 | 91 | |
92 | // Reset data members | |
c8b1a7db | 93 | AliAODForwardMult* aodfmult = GetForward(aod); |
94 | fHistVertexSel->Fill(aodfmult->GetIpZ()); | |
9632bb06 | 95 | |
c8b1a7db | 96 | if (aod.GetRunNumber() != fEventPlaneFinder.GetRunNumber()) |
97 | fEventPlaneFinder.SetRunNumber(aod.GetRunNumber()); | |
9632bb06 | 98 | |
99 | AliAODForwardEP aodep; | |
c8b1a7db | 100 | TH2D& fmdHist = aodfmult->GetHistogram(); |
9632bb06 | 101 | |
c8b1a7db | 102 | fEventPlaneFinder.FindEventplane(&aod, aodep, &fmdHist, 0); |
9632bb06 | 103 | |
c8b1a7db | 104 | return true; |
9632bb06 | 105 | } |
106 | //_____________________________________________________________________ | |
c8b1a7db | 107 | Bool_t AliFMDEventPlaneTask::Finalize() |
9632bb06 | 108 | { |
109 | // | |
110 | // Terminate - Called after all events | |
111 | // | |
112 | // Parameters: | |
113 | // option: Not used | |
114 | // | |
6ab100ec | 115 | DGUARD(fDebug,1,"Process merged output of AliFMDEventPlaneTask"); |
c8b1a7db | 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 | |
9632bb06 | 120 | |
c8b1a7db | 121 | return true; |
9632bb06 | 122 | } |
123 | //_____________________________________________________________________ | |
124 | // | |
125 | // | |
126 | // EOF |