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