]>
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" |
c8b1a7db | 20 | #include "AliAODForwardMult.h" |
52047b6f | 21 | #include "AliLog.h" |
22 | #include "AliAODHandler.h" | |
23 | #include "AliInputEventHandler.h" | |
24 | #include "AliESDInputHandler.h" | |
25 | #include "AliAnalysisManager.h" | |
26 | #include "AliESDEvent.h" | |
27 | #include "AliMultiplicity.h" | |
28 | #include "AliFMDEventInspector.h" | |
29 | #include <AliMCEvent.h> | |
30 | #include <AliTrackReference.h> | |
31 | #include <AliStack.h> | |
32 | #include <TROOT.h> | |
33 | #include <TH1D.h> | |
34 | #include <TH2D.h> | |
35 | #include <TH3D.h> | |
36 | #include <TFile.h> | |
37 | #include <TError.h> | |
38 | #include <iostream> | |
39 | #include <iomanip> | |
40 | ||
41 | //==================================================================== | |
42 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask(const char* name) | |
43 | : AliCentralMultiplicityTask(name), | |
c6d6aa81 | 44 | fTrackDensity(name), |
45 | fAODMCCentral(kTRUE) | |
52047b6f | 46 | { |
47 | // | |
48 | // Constructor | |
49 | // | |
60242a56 | 50 | DGUARD(fDebug,3,"Named CTOR of AliCentralMCMultiplicityTask: %s", |
51 | name); | |
3ecc3599 | 52 | fBranchNames = |
53 | "ESD:AliESDRun.,AliESDHeader.,AliMultiplicity.," | |
54 | "SPDVertex.,PrimaryVertex."; | |
52047b6f | 55 | } |
56 | //____________________________________________________________________ | |
57 | AliCentralMCMultiplicityTask::AliCentralMCMultiplicityTask() | |
58 | : AliCentralMultiplicityTask(), | |
c6d6aa81 | 59 | fTrackDensity(), |
60 | fAODMCCentral(kTRUE) | |
52047b6f | 61 | { |
62 | // | |
63 | // Constructor | |
64 | // | |
60242a56 | 65 | DGUARD(fDebug, 3,"Default CTOR of AliCentralMCMultiplicityTask"); |
52047b6f | 66 | } |
67 | //____________________________________________________________________ | |
c8b1a7db | 68 | void |
69 | AliCentralMCMultiplicityTask::CreateBranches(AliAODHandler* ah) | |
52047b6f | 70 | { |
71 | // | |
72 | // Create output objects | |
73 | // | |
74 | // | |
6ab100ec | 75 | DGUARD(fDebug,1,"Create user output in AliCentralMCMultiplicityTask"); |
c8b1a7db | 76 | AliCentralMultiplicityTask::CreateBranches(ah); |
52047b6f | 77 | |
c8b1a7db | 78 | if (!ah) |
8449e3e0 | 79 | // AliFatal("No AOD output handler set in analysis manager"); |
c8b1a7db | 80 | return; |
81 | ||
52047b6f | 82 | |
c8b1a7db | 83 | TObject* obj = &fAODMCCentral; |
84 | ah->AddBranch("AliAODCentralMult", &obj); | |
85 | } | |
86 | //____________________________________________________________________ | |
87 | Bool_t | |
88 | AliCentralMCMultiplicityTask::Book() | |
89 | { | |
90 | AliCentralMultiplicityTask::Book(); | |
5934a3e3 | 91 | fTrackDensity.CreateOutputObjects(fList); |
c8b1a7db | 92 | return true; |
52047b6f | 93 | } |
94 | //____________________________________________________________________ | |
c8b1a7db | 95 | Bool_t AliCentralMCMultiplicityTask::PreData(const TAxis& v, const TAxis& e) |
96 | { | |
97 | AliCentralMultiplicityTask::PreData(v, e); | |
98 | fAODMCCentral.Init(e); | |
99 | return true; | |
100 | } | |
101 | ||
102 | //____________________________________________________________________ | |
103 | Bool_t AliCentralMCMultiplicityTask::PreEvent() | |
8449e3e0 | 104 | { |
c8b1a7db | 105 | AliCentralMultiplicityTask::PreEvent(); |
106 | fAODMCCentral.Clear(""); | |
107 | return true; | |
8449e3e0 | 108 | } |
109 | //____________________________________________________________________ | |
c8b1a7db | 110 | Bool_t AliCentralMCMultiplicityTask::Event(AliESDEvent& esd) |
52047b6f | 111 | { |
112 | // | |
113 | // Process each event | |
114 | // | |
115 | // Parameters: | |
116 | // option Not used | |
117 | // | |
6ab100ec | 118 | DGUARD(fDebug,1,"Process event in AliCentralMCMultiplicityTask"); |
8449e3e0 | 119 | |
c8b1a7db | 120 | fIvz = 0; |
121 | Bool_t lowFlux = kFALSE; | |
122 | UInt_t triggers = 0; | |
123 | UShort_t ivz = 0; | |
124 | TVector3 ip; | |
125 | Double_t cent = -1; | |
126 | UShort_t nClusters = 0; | |
127 | UInt_t found = fInspector.Process(&esd, triggers, lowFlux, | |
128 | ivz, ip, cent, nClusters); | |
129 | ||
130 | // Make sure AOD is filled | |
131 | MarkEventForStore(); | |
132 | ||
133 | // Is this accepted for analysis? | |
134 | Bool_t isAccepted = true; | |
52047b6f | 135 | |
c8b1a7db | 136 | // No event or no trigger |
137 | if (found & AliFMDEventInspector::kNoEvent) isAccepted = false; | |
138 | if (found & AliFMDEventInspector::kNoTriggers) isAccepted = false; | |
139 | if (found & AliFMDEventInspector::kNoSPD) isAccepted = false; | |
140 | if (found & AliFMDEventInspector::kNoVertex) isAccepted = false; | |
141 | if (triggers & AliAODForwardMult::kPileUp) isAccepted = false; | |
142 | if (found & AliFMDEventInspector::kBadVertex) isAccepted = false; | |
52047b6f | 143 | |
c8b1a7db | 144 | VtxBin* bin = static_cast<VtxBin*>(fVtxList->At(ivz)); |
145 | if (!bin) return false; | |
52047b6f | 146 | |
c8b1a7db | 147 | //Doing analysis |
148 | if (isAccepted) { | |
149 | const AliMultiplicity* spdmult = esd.GetMultiplicity(); | |
150 | TH2D& aodHist = fAODCentral.GetHistogram(); | |
151 | ||
152 | ProcessESD(aodHist, spdmult); | |
153 | bin->Correct(aodHist, fUseSecondary, fUseAcceptance); | |
8449e3e0 | 154 | |
c8b1a7db | 155 | if (triggers & AliAODForwardMult::kInel) |
156 | fHData->Add(&(fAODCentral.GetHistogram())); | |
157 | } | |
158 | ||
159 | const AliMCEvent* mcEvent = MCEvent(); | |
160 | if (!mcEvent) return false; | |
161 | TH2D& hist = fAODMCCentral.GetHistogram(); | |
162 | ||
163 | ||
164 | fTrackDensity.Calculate(*mcEvent, ip.Z(), hist, NULL); | |
8449e3e0 | 165 | bin->Correct(hist, fUseSecondary, fUseAcceptance, false); |
52047b6f | 166 | |
c8b1a7db | 167 | return true; |
52047b6f | 168 | } |
c8b1a7db | 169 | |
52047b6f | 170 | //____________________________________________________________________ |
171 | void | |
172 | AliCentralMCMultiplicityTask::Print(Option_t* option) const | |
173 | { | |
174 | // | |
175 | // Print information | |
176 | // | |
177 | // Parameters: | |
178 | // option Not used | |
179 | // | |
180 | AliCentralMultiplicityTask::Print(option); | |
c6d6aa81 | 181 | gROOT->IncreaseDirLevel(); |
182 | fTrackDensity.Print(option); | |
183 | gROOT->DecreaseDirLevel(); | |
52047b6f | 184 | } |
185 | // | |
186 | // EOF | |
187 | // |