]>
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 | // | |
6ab100ec | 47 | DGUARD(fDebug,0,"Named CTOR of AliCentralMCMultiplicityTask: %s", name); |
52047b6f | 48 | } |
49 | //____________________________________________________________________ | |
50 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask() | |
51 | : AliCentralMultiplicityTask(), | |
c6d6aa81 | 52 | fTrackDensity(), |
53 | fAODMCCentral(kTRUE) | |
52047b6f | 54 | { |
55 | // | |
56 | // Constructor | |
57 | // | |
6ab100ec | 58 | DGUARD(fDebug,0,"Default CTOR of AliCentralMCMultiplicityTask"); |
52047b6f | 59 | } |
60 | //____________________________________________________________________ | |
61 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask(const AliCentralMCMultiplicityTask& o) | |
62 | : AliCentralMultiplicityTask(o), | |
c6d6aa81 | 63 | fTrackDensity(o.fTrackDensity), |
64 | fAODMCCentral(o.fAODMCCentral) | |
52047b6f | 65 | { |
66 | // | |
67 | // Copy constructor | |
68 | // | |
6ab100ec | 69 | DGUARD(fDebug,0,"COPY CTOR of AliCentralMCMultiplicityTask"); |
52047b6f | 70 | } |
71 | //____________________________________________________________________ | |
72 | AliCentralMCMultiplicityTask& | |
73 | AliCentralMCMultiplicityTask::operator=(const AliCentralMCMultiplicityTask& o) | |
74 | { | |
75 | // | |
76 | // Assignment operator | |
77 | // | |
6ab100ec | 78 | DGUARD(fDebug,3,"Assignment of AliCentralMCMultiplicityTask"); |
79 | if (&o == this) return *this; | |
52047b6f | 80 | AliCentralMultiplicityTask::operator=(o); |
81 | fAODMCCentral = o.fAODMCCentral; | |
c6d6aa81 | 82 | fTrackDensity = o.fTrackDensity; |
52047b6f | 83 | return *this; |
84 | } | |
85 | //____________________________________________________________________ | |
86 | void AliCentralMCMultiplicityTask::UserCreateOutputObjects() | |
87 | { | |
88 | // | |
89 | // Create output objects | |
90 | // | |
91 | // | |
6ab100ec | 92 | DGUARD(fDebug,1,"Create user output in AliCentralMCMultiplicityTask"); |
52047b6f | 93 | AliCentralMultiplicityTask::UserCreateOutputObjects(); |
94 | ||
95 | AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager(); | |
96 | AliAODHandler* ah = | |
97 | dynamic_cast<AliAODHandler*>(am->GetOutputEventHandler()); | |
98 | if (!ah) AliFatal("No AOD output handler set in analysis manager"); | |
99 | ||
100 | ||
101 | TObject* obj = &fAODMCCentral; | |
102 | ah->AddBranch("AliAODCentralMult", &obj); | |
103 | ||
c6d6aa81 | 104 | |
105 | fTrackDensity.DefineOutput(fList); | |
52047b6f | 106 | |
52047b6f | 107 | } |
108 | //____________________________________________________________________ | |
109 | void AliCentralMCMultiplicityTask::UserExec(Option_t* option) | |
110 | { | |
111 | // | |
112 | // Process each event | |
113 | // | |
114 | // Parameters: | |
115 | // option Not used | |
116 | // | |
6ab100ec | 117 | DGUARD(fDebug,1,"Process event in AliCentralMCMultiplicityTask"); |
52047b6f | 118 | fAODMCCentral.Clear(""); |
119 | ||
120 | // Call base class | |
121 | AliCentralMultiplicityTask::UserExec(option); | |
122 | ||
123 | // check if we need this event | |
124 | AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager(); | |
125 | AliAODHandler* ah = | |
126 | dynamic_cast<AliAODHandler*>(am->GetOutputEventHandler()); | |
127 | if (!ah) | |
128 | AliFatal("No AOD output handler set in analysis manager"); | |
129 | ||
130 | // if base class did not want this event, then neither to we | |
131 | if (!ah->GetFillAOD() || fIvz <= 0) return; | |
132 | ||
c6d6aa81 | 133 | const AliMCEvent* mcEvent = MCEvent(); |
6ff251d8 | 134 | if (!mcEvent) return; |
c6d6aa81 | 135 | TH2D& hist = fAODMCCentral.GetHistogram(); |
52047b6f | 136 | |
52047b6f | 137 | Double_t vz = GetManager().GetSecMap()->GetVertexAxis().GetBinCenter(fIvz); |
138 | ||
c6d6aa81 | 139 | fTrackDensity.Calculate(*mcEvent, vz, hist, NULL); |
52047b6f | 140 | |
c6d6aa81 | 141 | CorrectData(hist, fIvz); |
52047b6f | 142 | |
52047b6f | 143 | } |
144 | ||
145 | //____________________________________________________________________ | |
146 | void AliCentralMCMultiplicityTask::Terminate(Option_t* option) | |
147 | { | |
148 | // | |
149 | // End of job | |
150 | // | |
151 | // Parameters: | |
152 | // option Not used | |
153 | // | |
6ab100ec | 154 | DGUARD(fDebug,1,"Final analysis of merge in AliCentralMCMultiplicityTask"); |
52047b6f | 155 | AliCentralMultiplicityTask::Terminate(option); |
156 | } | |
157 | //____________________________________________________________________ | |
158 | void | |
159 | AliCentralMCMultiplicityTask::Print(Option_t* option) const | |
160 | { | |
161 | // | |
162 | // Print information | |
163 | // | |
164 | // Parameters: | |
165 | // option Not used | |
166 | // | |
167 | AliCentralMultiplicityTask::Print(option); | |
c6d6aa81 | 168 | gROOT->IncreaseDirLevel(); |
169 | fTrackDensity.Print(option); | |
170 | gROOT->DecreaseDirLevel(); | |
52047b6f | 171 | } |
172 | // | |
173 | // EOF | |
174 | // |