]>
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" | |
8449e3e0 | 16 | #include "AliCentralCorrectionManager.h" |
17 | #include "AliCentralCorrAcceptance.h" | |
18 | #include "AliCentralCorrSecondaryMap.h" | |
52047b6f | 19 | #include "AliForwardUtil.h" |
20 | #include "AliLog.h" | |
21 | #include "AliAODHandler.h" | |
22 | #include "AliInputEventHandler.h" | |
23 | #include "AliESDInputHandler.h" | |
24 | #include "AliAnalysisManager.h" | |
25 | #include "AliESDEvent.h" | |
26 | #include "AliMultiplicity.h" | |
27 | #include "AliFMDEventInspector.h" | |
28 | #include <AliMCEvent.h> | |
29 | #include <AliTrackReference.h> | |
30 | #include <AliStack.h> | |
31 | #include <TROOT.h> | |
32 | #include <TH1D.h> | |
33 | #include <TH2D.h> | |
34 | #include <TH3D.h> | |
35 | #include <TFile.h> | |
36 | #include <TError.h> | |
37 | #include <iostream> | |
38 | #include <iomanip> | |
39 | ||
40 | //==================================================================== | |
41 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask(const char* name) | |
42 | : AliCentralMultiplicityTask(name), | |
c6d6aa81 | 43 | fTrackDensity(name), |
44 | fAODMCCentral(kTRUE) | |
52047b6f | 45 | { |
46 | // | |
47 | // Constructor | |
48 | // | |
60242a56 | 49 | DGUARD(fDebug,3,"Named CTOR of AliCentralMCMultiplicityTask: %s", |
50 | name); | |
3ecc3599 | 51 | fBranchNames = |
52 | "ESD:AliESDRun.,AliESDHeader.,AliMultiplicity.," | |
53 | "SPDVertex.,PrimaryVertex."; | |
52047b6f | 54 | } |
55 | //____________________________________________________________________ | |
56 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask() | |
57 | : AliCentralMultiplicityTask(), | |
c6d6aa81 | 58 | fTrackDensity(), |
59 | fAODMCCentral(kTRUE) | |
52047b6f | 60 | { |
61 | // | |
62 | // Constructor | |
63 | // | |
60242a56 | 64 | DGUARD(fDebug, 3,"Default CTOR of AliCentralMCMultiplicityTask"); |
52047b6f | 65 | } |
66 | //____________________________________________________________________ | |
67 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask(const AliCentralMCMultiplicityTask& o) | |
68 | : AliCentralMultiplicityTask(o), | |
c6d6aa81 | 69 | fTrackDensity(o.fTrackDensity), |
70 | fAODMCCentral(o.fAODMCCentral) | |
52047b6f | 71 | { |
72 | // | |
73 | // Copy constructor | |
74 | // | |
60242a56 | 75 | DGUARD(fDebug, 3,"COPY CTOR of AliCentralMCMultiplicityTask"); |
52047b6f | 76 | } |
77 | //____________________________________________________________________ | |
78 | AliCentralMCMultiplicityTask& | |
79 | AliCentralMCMultiplicityTask::operator=(const AliCentralMCMultiplicityTask& o) | |
80 | { | |
81 | // | |
82 | // Assignment operator | |
83 | // | |
6ab100ec | 84 | DGUARD(fDebug,3,"Assignment of AliCentralMCMultiplicityTask"); |
85 | if (&o == this) return *this; | |
52047b6f | 86 | AliCentralMultiplicityTask::operator=(o); |
87 | fAODMCCentral = o.fAODMCCentral; | |
c6d6aa81 | 88 | fTrackDensity = o.fTrackDensity; |
52047b6f | 89 | return *this; |
90 | } | |
91 | //____________________________________________________________________ | |
92 | void AliCentralMCMultiplicityTask::UserCreateOutputObjects() | |
93 | { | |
94 | // | |
95 | // Create output objects | |
96 | // | |
97 | // | |
6ab100ec | 98 | DGUARD(fDebug,1,"Create user output in AliCentralMCMultiplicityTask"); |
52047b6f | 99 | AliCentralMultiplicityTask::UserCreateOutputObjects(); |
100 | ||
101 | AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager(); | |
102 | AliAODHandler* ah = | |
103 | dynamic_cast<AliAODHandler*>(am->GetOutputEventHandler()); | |
8449e3e0 | 104 | if (ah) { |
105 | // AliFatal("No AOD output handler set in analysis manager"); | |
52047b6f | 106 | |
8449e3e0 | 107 | TObject* obj = &fAODMCCentral; |
108 | ah->AddBranch("AliAODCentralMult", &obj); | |
ca363570 | 109 | } |
5934a3e3 | 110 | fTrackDensity.CreateOutputObjects(fList); |
52047b6f | 111 | |
52047b6f | 112 | } |
113 | //____________________________________________________________________ | |
8449e3e0 | 114 | void AliCentralMCMultiplicityTask::FindEtaLimits() |
115 | { | |
116 | AliCentralMultiplicityTask::FindEtaLimits(); | |
117 | fAODMCCentral.Init(*(fAODCentral.GetHistogram().GetXaxis())); | |
118 | } | |
119 | //____________________________________________________________________ | |
52047b6f | 120 | void AliCentralMCMultiplicityTask::UserExec(Option_t* option) |
121 | { | |
122 | // | |
123 | // Process each event | |
124 | // | |
125 | // Parameters: | |
126 | // option Not used | |
127 | // | |
6ab100ec | 128 | DGUARD(fDebug,1,"Process event in AliCentralMCMultiplicityTask"); |
52047b6f | 129 | fAODMCCentral.Clear(""); |
8449e3e0 | 130 | |
52047b6f | 131 | // Call base class |
132 | AliCentralMultiplicityTask::UserExec(option); | |
8449e3e0 | 133 | |
52047b6f | 134 | // check if we need this event |
135 | AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager(); | |
136 | AliAODHandler* ah = | |
137 | dynamic_cast<AliAODHandler*>(am->GetOutputEventHandler()); | |
8449e3e0 | 138 | if (ah) { |
139 | // AliFatal("No AOD output handler set in analysis manager"); | |
140 | // if base class did not want this event, then neither to we | |
141 | if (!ah->GetFillAOD() || fIvz <= 0) return; | |
142 | } | |
c6d6aa81 | 143 | const AliMCEvent* mcEvent = MCEvent(); |
6ff251d8 | 144 | if (!mcEvent) return; |
c6d6aa81 | 145 | TH2D& hist = fAODMCCentral.GetHistogram(); |
52047b6f | 146 | |
8449e3e0 | 147 | AliCentralCorrectionManager& ccm = |
148 | AliCentralCorrectionManager::Instance(); | |
52047b6f | 149 | |
8449e3e0 | 150 | Double_t vz = ccm.GetSecondaryMap()->GetVertexAxis().GetBinCenter(fIvz); |
151 | // GetManager().GetSecMap()->GetVertexAxis().GetBinCenter(fIvz); | |
52047b6f | 152 | |
8449e3e0 | 153 | fTrackDensity.Calculate(*mcEvent, vz, hist, NULL); |
154 | ||
155 | VtxBin* bin = static_cast<VtxBin*>(fVtxList->At(fIvz)); | |
156 | if (!bin) return; | |
157 | bin->Correct(hist, fUseSecondary, fUseAcceptance, false); | |
52047b6f | 158 | } |
159 | ||
160 | //____________________________________________________________________ | |
161 | void AliCentralMCMultiplicityTask::Terminate(Option_t* option) | |
162 | { | |
163 | // | |
164 | // End of job | |
165 | // | |
166 | // Parameters: | |
167 | // option Not used | |
168 | // | |
6ab100ec | 169 | DGUARD(fDebug,1,"Final analysis of merge in AliCentralMCMultiplicityTask"); |
52047b6f | 170 | AliCentralMultiplicityTask::Terminate(option); |
171 | } | |
172 | //____________________________________________________________________ | |
173 | void | |
174 | AliCentralMCMultiplicityTask::Print(Option_t* option) const | |
175 | { | |
176 | // | |
177 | // Print information | |
178 | // | |
179 | // Parameters: | |
180 | // option Not used | |
181 | // | |
182 | AliCentralMultiplicityTask::Print(option); | |
c6d6aa81 | 183 | gROOT->IncreaseDirLevel(); |
184 | fTrackDensity.Print(option); | |
185 | gROOT->DecreaseDirLevel(); | |
52047b6f | 186 | } |
187 | // | |
188 | // EOF | |
189 | // |