]>
Commit | Line | Data |
---|---|---|
7984e5f7 | 1 | // |
2 | // Calculate the multiplicity in the forward regions event-by-event | |
3 | // | |
4 | // Inputs: | |
5 | // - AliESDEvent | |
6 | // | |
7 | // Outputs: | |
8 | // - AliAODForwardMult | |
9 | // | |
10 | // Histograms | |
11 | // | |
12 | // Corrections used | |
13 | // | |
0bd4b00f | 14 | #include "AliForwardMultiplicityTask.h" |
7e4038b5 | 15 | #include "AliTriggerAnalysis.h" |
16 | #include "AliPhysicsSelection.h" | |
17 | #include "AliLog.h" | |
7e4038b5 | 18 | #include "AliESDEvent.h" |
19 | #include "AliAODHandler.h" | |
20 | #include "AliMultiplicity.h" | |
21 | #include "AliInputEventHandler.h" | |
0bd4b00f | 22 | #include "AliForwardCorrectionManager.h" |
23 | #include "AliAnalysisManager.h" | |
7e4038b5 | 24 | #include <TH1.h> |
4f9319f3 | 25 | #include <TH3D.h> |
7e4038b5 | 26 | #include <TDirectory.h> |
27 | #include <TTree.h> | |
0bd4b00f | 28 | #include <TROOT.h> |
1f7aa5c7 | 29 | #include <TStopwatch.h> |
30 | #include <TProfile.h> | |
7e4038b5 | 31 | |
32 | //==================================================================== | |
0bd4b00f | 33 | AliForwardMultiplicityTask::AliForwardMultiplicityTask() |
eb865a4f | 34 | : AliForwardMultiplicityBase(), |
7e4038b5 | 35 | fESDFMD(), |
fffea31d | 36 | fEventInspector(), |
7e4038b5 | 37 | fSharingFilter(), |
38 | fDensityCalculator(), | |
39 | fCorrections(), | |
40 | fHistCollector(), | |
8449e3e0 | 41 | fEventPlaneFinder() |
7e4038b5 | 42 | { |
7984e5f7 | 43 | // |
44 | // Constructor | |
45 | // | |
5ca83fee | 46 | DGUARD(fDebug, 3,"Default CTOR of AliForwardMultiplicityTask"); |
7e4038b5 | 47 | } |
48 | ||
49 | //____________________________________________________________________ | |
0bd4b00f | 50 | AliForwardMultiplicityTask::AliForwardMultiplicityTask(const char* name) |
eb865a4f | 51 | : AliForwardMultiplicityBase(name), |
7e4038b5 | 52 | fESDFMD(), |
fffea31d | 53 | fEventInspector("event"), |
7e4038b5 | 54 | fSharingFilter("sharing"), |
55 | fDensityCalculator("density"), | |
56 | fCorrections("corrections"), | |
57 | fHistCollector("collector"), | |
8449e3e0 | 58 | fEventPlaneFinder("eventplane") |
7e4038b5 | 59 | { |
7984e5f7 | 60 | // |
61 | // Constructor | |
62 | // | |
63 | // Parameters: | |
64 | // name Name of task | |
65 | // | |
5ca83fee | 66 | DGUARD(fDebug, 3,"named CTOR of AliForwardMultiplicityTask: %s", name); |
7e4038b5 | 67 | } |
68 | ||
69 | //____________________________________________________________________ | |
0bd4b00f | 70 | AliForwardMultiplicityTask::AliForwardMultiplicityTask(const AliForwardMultiplicityTask& o) |
eb865a4f | 71 | : AliForwardMultiplicityBase(o), |
7e4038b5 | 72 | fESDFMD(o.fESDFMD), |
fffea31d | 73 | fEventInspector(o.fEventInspector), |
7e4038b5 | 74 | fSharingFilter(o.fSharingFilter), |
75 | fDensityCalculator(o.fDensityCalculator), | |
76 | fCorrections(o.fCorrections), | |
77 | fHistCollector(o.fHistCollector), | |
8449e3e0 | 78 | fEventPlaneFinder(o.fEventPlaneFinder) |
4f9319f3 | 79 | |
7e4038b5 | 80 | { |
7984e5f7 | 81 | // |
82 | // Copy constructor | |
83 | // | |
84 | // Parameters: | |
85 | // o Object to copy from | |
86 | // | |
5ca83fee | 87 | DGUARD(fDebug, 3,"Copy CTOR of AliForwardMultiplicityTask"); |
7e4038b5 | 88 | } |
89 | ||
90 | //____________________________________________________________________ | |
0bd4b00f | 91 | AliForwardMultiplicityTask& |
92 | AliForwardMultiplicityTask::operator=(const AliForwardMultiplicityTask& o) | |
7e4038b5 | 93 | { |
7984e5f7 | 94 | // |
95 | // Assignment operator | |
96 | // | |
97 | // Parameters: | |
98 | // o Object to assign from | |
99 | // | |
100 | // Return: | |
101 | // Reference to this object | |
102 | // | |
f53fb4f6 | 103 | DGUARD(fDebug,3,"Assignment to AliForwardMultiplicityTask"); |
d015ecfe | 104 | if (&o == this) return *this; |
eb865a4f | 105 | AliForwardMultiplicityBase::operator=(o); |
fffea31d | 106 | |
fffea31d | 107 | fEventInspector = o.fEventInspector; |
7e4038b5 | 108 | fSharingFilter = o.fSharingFilter; |
109 | fDensityCalculator = o.fDensityCalculator; | |
110 | fCorrections = o.fCorrections; | |
111 | fHistCollector = o.fHistCollector; | |
2b556440 | 112 | fEventPlaneFinder = o.fEventPlaneFinder; |
fffea31d | 113 | |
8449e3e0 | 114 | return *this; |
7e4038b5 | 115 | } |
116 | ||
7e4038b5 | 117 | //____________________________________________________________________ |
118 | void | |
0bd4b00f | 119 | AliForwardMultiplicityTask::UserExec(Option_t*) |
7e4038b5 | 120 | { |
7984e5f7 | 121 | // |
122 | // Process each event | |
123 | // | |
124 | // Parameters: | |
125 | // option Not used | |
126 | // | |
1f7aa5c7 | 127 | TStopwatch total; |
128 | TStopwatch individual; | |
129 | if (fDoTiming) total.Start(true); | |
130 | ||
f53fb4f6 | 131 | DGUARD(fDebug,1,"Process the input event"); |
0bd4b00f | 132 | // static Int_t cnt = 0; |
133 | // cnt++; | |
7e4038b5 | 134 | // Get the input data |
7ec4d843 | 135 | AliESDEvent* esd = GetESDEvent(); |
6ff251d8 | 136 | if (!esd) return; |
7e4038b5 | 137 | |
7e4038b5 | 138 | // Clear stuff |
139 | fHistos.Clear(); | |
140 | fESDFMD.Clear(); | |
141 | fAODFMD.Clear(); | |
2b556440 | 142 | fAODEP.Clear(); |
1f7aa5c7 | 143 | |
144 | // Inspect the event | |
145 | if (fDoTiming) individual.Start(true); | |
5bb5d1f6 | 146 | Bool_t lowFlux = kFALSE; |
147 | UInt_t triggers = 0; | |
148 | UShort_t ivz = 0; | |
5ca83fee | 149 | TVector3 ip; |
5bb5d1f6 | 150 | Double_t cent = -1; |
151 | UShort_t nClusters = 0; | |
152 | UInt_t found = fEventInspector.Process(esd, triggers, lowFlux, | |
5ca83fee | 153 | ivz, ip, cent, nClusters); |
1f7aa5c7 | 154 | if (fDoTiming) fHTiming->Fill(kTimingEventInspector, individual.CpuTime()); |
e58000b7 | 155 | |
9bff843b | 156 | if (found & AliFMDEventInspector::kNoEvent) return; |
157 | if (found & AliFMDEventInspector::kNoTriggers) return; | |
158 | ||
fffea31d | 159 | // Set trigger bits, and mark this event for storage |
9d99b0dd | 160 | fAODFMD.SetTriggerBits(triggers); |
b2e7f2d6 | 161 | fAODFMD.SetSNN(fEventInspector.GetEnergy()); |
162 | fAODFMD.SetSystem(fEventInspector.GetCollisionSystem()); | |
e58000b7 | 163 | fAODFMD.SetCentrality(cent); |
5bb5d1f6 | 164 | fAODFMD.SetNClusters(nClusters); |
7e4038b5 | 165 | MarkEventForStore(); |
2b556440 | 166 | |
3c5497d0 | 167 | if (found & AliFMDEventInspector::kNoSPD) return; |
168 | if (found & AliFMDEventInspector::kNoFMD) return; | |
169 | if (found & AliFMDEventInspector::kNoVertex) return; | |
e58000b7 | 170 | |
171 | if (triggers & AliAODForwardMult::kPileUp) return; | |
172 | ||
5ca83fee | 173 | fAODFMD.SetIpZ(ip.Z()); |
7e4038b5 | 174 | |
fffea31d | 175 | if (found & AliFMDEventInspector::kBadVertex) return; |
7e4038b5 | 176 | |
0bd4b00f | 177 | // We we do not want to use low flux specific code, we disable it here. |
178 | if (!fEnableLowFlux) lowFlux = false; | |
179 | ||
fffea31d | 180 | // Get FMD data |
1f7aa5c7 | 181 | AliESDFMD* esdFMD = esd->GetFMDData(); |
182 | ||
183 | // Apply the sharing filter (or hit merging or clustering if you like) | |
184 | if (fDoTiming) individual.Start(true); | |
5ca83fee | 185 | if (!fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD, ip.Z())) { |
fffea31d | 186 | AliWarning("Sharing filter failed!"); |
7e4038b5 | 187 | return; |
188 | } | |
1f7aa5c7 | 189 | if (fDoTiming) fHTiming->Fill(kTimingSharingFilter, individual.CpuTime()); |
2b556440 | 190 | |
7e4038b5 | 191 | // Calculate the inclusive charged particle density |
1f7aa5c7 | 192 | if (fDoTiming) individual.Start(true); |
5ca83fee | 193 | if (!fDensityCalculator.Calculate(fESDFMD, fHistos, lowFlux, cent, ip)) { |
f7cfc454 | 194 | // if (!fDensityCalculator.Calculate(*esdFMD, fHistos, ivz, lowFlux)) { |
7e4038b5 | 195 | AliWarning("Density calculator failed!"); |
196 | return; | |
197 | } | |
1f7aa5c7 | 198 | if (fDoTiming) fHTiming->Fill(kTimingDensityCalculator,individual.CpuTime()); |
2b556440 | 199 | |
1f7aa5c7 | 200 | // Check if we should do the event plane finder |
2b556440 | 201 | if (fEventInspector.GetCollisionSystem() == AliFMDEventInspector::kPbPb) { |
1f7aa5c7 | 202 | if (fDoTiming) individual.Start(true); |
5ca83fee | 203 | if (!fEventPlaneFinder.FindEventplane(esd, fAODEP, |
204 | &(fAODFMD.GetHistogram()), &fHistos)) | |
2b556440 | 205 | AliWarning("Eventplane finder failed!"); |
1f7aa5c7 | 206 | if (fDoTiming) fHTiming->Fill(kTimingEventPlaneFinder,individual.CpuTime()); |
2b556440 | 207 | } |
7e4038b5 | 208 | |
209 | // Do the secondary and other corrections. | |
1f7aa5c7 | 210 | if (fDoTiming) individual.Start(true); |
7e4038b5 | 211 | if (!fCorrections.Correct(fHistos, ivz)) { |
212 | AliWarning("Corrections failed"); | |
213 | return; | |
214 | } | |
1f7aa5c7 | 215 | if (fDoTiming) fHTiming->Fill(kTimingCorrections, individual.CpuTime()); |
7e4038b5 | 216 | |
1f7aa5c7 | 217 | // Collect our `super' histogram |
218 | if (fDoTiming) individual.Start(true); | |
5bb5d1f6 | 219 | if (!fHistCollector.Collect(fHistos, fRingSums, |
8449e3e0 | 220 | ivz, fAODFMD.GetHistogram(), |
221 | fAODFMD.GetCentrality())) { | |
7e4038b5 | 222 | AliWarning("Histogram collector failed"); |
223 | return; | |
224 | } | |
1f7aa5c7 | 225 | if (fDoTiming) fHTiming->Fill(kTimingHistCollector, individual.CpuTime()); |
7e4038b5 | 226 | |
227 | if (fAODFMD.IsTriggerBits(AliAODForwardMult::kInel)) | |
228 | fHData->Add(&(fAODFMD.GetHistogram())); | |
2d68d438 | 229 | |
230 | PostData(1, fList); | |
1f7aa5c7 | 231 | |
232 | if (fDoTiming) fHTiming->Fill(kTimingTotal, total.CpuTime()); | |
7e4038b5 | 233 | } |
234 | ||
36ffcf83 | 235 | //____________________________________________________________________ |
236 | void | |
237 | AliForwardMultiplicityTask::FinishTaskOutput() | |
238 | { | |
239 | if (!fList) | |
240 | Warning("FinishTaskOutput", "No list defined"); | |
241 | else { | |
242 | if (fDebug) | |
243 | fList->ls(); | |
244 | } | |
245 | AliAnalysisTaskSE::FinishTaskOutput(); | |
246 | } | |
247 | ||
7e4038b5 | 248 | |
249 | // | |
250 | // EOF | |
251 | // |