]>
Commit | Line | Data |
---|---|---|
52047b6f | 1 | //==================================================================== |
2 | // | |
3 | // Base class for classes that calculate the multiplicity in the | |
4 | // central region event-by-event | |
5 | // | |
6 | // Inputs: | |
7 | // - AliESDEvent | |
8 | // | |
9 | // Outputs: | |
10 | // - AliAODCentralMult | |
11 | // | |
12 | // Histograms | |
13 | // | |
14 | // Corrections used | |
15 | #include "AliCentralMCMultiplicityTask.h" | |
16 | #include "AliForwardCorrectionManager.h" | |
17 | #include "AliForwardUtil.h" | |
18 | #include "AliLog.h" | |
19 | #include "AliAODHandler.h" | |
20 | #include "AliInputEventHandler.h" | |
21 | #include "AliESDInputHandler.h" | |
22 | #include "AliAnalysisManager.h" | |
23 | #include "AliESDEvent.h" | |
24 | #include "AliMultiplicity.h" | |
25 | #include "AliFMDEventInspector.h" | |
26 | #include <AliMCEvent.h> | |
27 | #include <AliTrackReference.h> | |
28 | #include <AliStack.h> | |
29 | #include <TROOT.h> | |
30 | #include <TH1D.h> | |
31 | #include <TH2D.h> | |
32 | #include <TH3D.h> | |
33 | #include <TFile.h> | |
34 | #include <TError.h> | |
35 | #include <iostream> | |
36 | #include <iomanip> | |
37 | ||
38 | //==================================================================== | |
39 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask(const char* name) | |
40 | : AliCentralMultiplicityTask(name), | |
c6d6aa81 | 41 | fTrackDensity(name), |
42 | fAODMCCentral(kTRUE) | |
52047b6f | 43 | { |
44 | // | |
45 | // Constructor | |
46 | // | |
47 | } | |
48 | //____________________________________________________________________ | |
49 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask() | |
50 | : AliCentralMultiplicityTask(), | |
c6d6aa81 | 51 | fTrackDensity(), |
52 | fAODMCCentral(kTRUE) | |
52047b6f | 53 | { |
54 | // | |
55 | // Constructor | |
56 | // | |
57 | } | |
58 | //____________________________________________________________________ | |
59 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask(const AliCentralMCMultiplicityTask& o) | |
60 | : AliCentralMultiplicityTask(o), | |
c6d6aa81 | 61 | fTrackDensity(o.fTrackDensity), |
62 | fAODMCCentral(o.fAODMCCentral) | |
52047b6f | 63 | { |
64 | // | |
65 | // Copy constructor | |
66 | // | |
67 | } | |
68 | //____________________________________________________________________ | |
69 | AliCentralMCMultiplicityTask& | |
70 | AliCentralMCMultiplicityTask::operator=(const AliCentralMCMultiplicityTask& o) | |
71 | { | |
72 | // | |
73 | // Assignment operator | |
74 | // | |
75 | AliCentralMultiplicityTask::operator=(o); | |
76 | fAODMCCentral = o.fAODMCCentral; | |
c6d6aa81 | 77 | fTrackDensity = o.fTrackDensity; |
52047b6f | 78 | return *this; |
79 | } | |
80 | //____________________________________________________________________ | |
81 | void AliCentralMCMultiplicityTask::UserCreateOutputObjects() | |
82 | { | |
83 | // | |
84 | // Create output objects | |
85 | // | |
86 | // | |
87 | AliCentralMultiplicityTask::UserCreateOutputObjects(); | |
88 | ||
89 | AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager(); | |
90 | AliAODHandler* ah = | |
91 | dynamic_cast<AliAODHandler*>(am->GetOutputEventHandler()); | |
92 | if (!ah) AliFatal("No AOD output handler set in analysis manager"); | |
93 | ||
94 | ||
95 | TObject* obj = &fAODMCCentral; | |
96 | ah->AddBranch("AliAODCentralMult", &obj); | |
97 | ||
c6d6aa81 | 98 | |
99 | fTrackDensity.DefineOutput(fList); | |
52047b6f | 100 | |
52047b6f | 101 | } |
102 | //____________________________________________________________________ | |
103 | void AliCentralMCMultiplicityTask::UserExec(Option_t* option) | |
104 | { | |
105 | // | |
106 | // Process each event | |
107 | // | |
108 | // Parameters: | |
109 | // option Not used | |
110 | // | |
111 | fAODMCCentral.Clear(""); | |
112 | ||
113 | // Call base class | |
114 | AliCentralMultiplicityTask::UserExec(option); | |
115 | ||
116 | // check if we need this event | |
117 | AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager(); | |
118 | AliAODHandler* ah = | |
119 | dynamic_cast<AliAODHandler*>(am->GetOutputEventHandler()); | |
120 | if (!ah) | |
121 | AliFatal("No AOD output handler set in analysis manager"); | |
122 | ||
123 | // if base class did not want this event, then neither to we | |
124 | if (!ah->GetFillAOD() || fIvz <= 0) return; | |
125 | ||
c6d6aa81 | 126 | const AliMCEvent* mcEvent = MCEvent(); |
127 | TH2D& hist = fAODMCCentral.GetHistogram(); | |
52047b6f | 128 | |
52047b6f | 129 | Double_t vz = GetManager().GetSecMap()->GetVertexAxis().GetBinCenter(fIvz); |
130 | ||
c6d6aa81 | 131 | fTrackDensity.Calculate(*mcEvent, vz, hist, NULL); |
52047b6f | 132 | |
c6d6aa81 | 133 | CorrectData(hist, fIvz); |
52047b6f | 134 | |
52047b6f | 135 | } |
136 | ||
137 | //____________________________________________________________________ | |
138 | void AliCentralMCMultiplicityTask::Terminate(Option_t* option) | |
139 | { | |
140 | // | |
141 | // End of job | |
142 | // | |
143 | // Parameters: | |
144 | // option Not used | |
145 | // | |
146 | AliCentralMultiplicityTask::Terminate(option); | |
147 | } | |
148 | //____________________________________________________________________ | |
149 | void | |
150 | AliCentralMCMultiplicityTask::Print(Option_t* option) const | |
151 | { | |
152 | // | |
153 | // Print information | |
154 | // | |
155 | // Parameters: | |
156 | // option Not used | |
157 | // | |
158 | AliCentralMultiplicityTask::Print(option); | |
c6d6aa81 | 159 | gROOT->IncreaseDirLevel(); |
160 | fTrackDensity.Print(option); | |
161 | gROOT->DecreaseDirLevel(); | |
52047b6f | 162 | } |
163 | // | |
164 | // EOF | |
165 | // |