]>
Commit | Line | Data |
---|---|---|
1c1d4332 | 1 | /************************************************************************* |
2 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
940a5ed1 | 13 | * provided "as is" without express or implied warranty. * |
1c1d4332 | 14 | **************************************************************************/ |
15 | ||
fdff44c8 | 16 | //////////////////////////////////////////////////// |
17 | // AliAnalysisTaskFlowEvent: | |
18 | // | |
19 | // analysis task for filling the flow event | |
20 | // from MCEvent, ESD, AOD .... | |
940a5ed1 | 21 | // and put it in an output stream so it can |
22 | // be used by the various flow analysis methods | |
fdff44c8 | 23 | // for cuts the correction framework is used |
24 | // which also outputs QA histograms to view | |
25 | // the effects of the cuts | |
26 | //////////////////////////////////////////////////// | |
27 | ||
1c1d4332 | 28 | #include "Riostream.h" //needed as include |
29 | #include "TChain.h" | |
30 | #include "TTree.h" | |
31 | #include "TFile.h" //needed as include | |
32 | #include "TList.h" | |
44e060e0 | 33 | #include "TH2F.h" |
489fdf79 | 34 | #include "TRandom3.h" |
35 | #include "TTimeStamp.h" | |
1c1d4332 | 36 | |
7183fe85 | 37 | // ALICE Analysis Framework |
1c1d4332 | 38 | #include "AliAnalysisManager.h" |
fbdb53fa | 39 | #include "AliAnalysisTaskSE.h" |
85d2ee8d | 40 | #include "AliESDtrackCuts.h" |
1c1d4332 | 41 | |
7183fe85 | 42 | // ESD interface |
1c1d4332 | 43 | #include "AliESDEvent.h" |
44 | #include "AliESDInputHandler.h" | |
45 | ||
7183fe85 | 46 | // AOD interface |
1c1d4332 | 47 | #include "AliAODEvent.h" |
48 | #include "AliAODInputHandler.h" | |
49 | ||
7183fe85 | 50 | // Monte Carlo Event |
1c1d4332 | 51 | #include "AliMCEventHandler.h" |
52 | #include "AliMCEvent.h" | |
53 | ||
7183fe85 | 54 | // ALICE Correction Framework |
1c1d4332 | 55 | #include "AliCFManager.h" |
56 | ||
7183fe85 | 57 | // Interface to Event generators to get Reaction Plane Angle |
58 | #include "AliGenCocktailEventHeader.h" | |
59 | #include "AliGenHijingEventHeader.h" | |
48ad51a1 | 60 | #include "AliGenGeVSimEventHeader.h" |
26f120fa | 61 | #include "AliGenEposEventHeader.h" |
7183fe85 | 62 | |
6e214c87 | 63 | // Interface to Load short life particles |
64 | #include "TObjArray.h" | |
65 | #include "AliFlowCandidateTrack.h" | |
66 | ||
7183fe85 | 67 | // Interface to make the Flow Event Simple used in the flow analysis methods |
940a5ed1 | 68 | #include "AliFlowEvent.h" |
daf66719 | 69 | #include "AliFlowTrackCuts.h" |
70 | #include "AliFlowEventCuts.h" | |
d459546b | 71 | #include "AliFlowCommonConstants.h" |
7183fe85 | 72 | #include "AliAnalysisTaskFlowEvent.h" |
73 | ||
77111ee6 | 74 | #include "AliLog.h" |
75 | ||
1c1d4332 | 76 | ClassImp(AliAnalysisTaskFlowEvent) |
940a5ed1 | 77 | |
1c1d4332 | 78 | //________________________________________________________________________ |
940a5ed1 | 79 | AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent() : |
80 | AliAnalysisTaskSE(), | |
46bec39c | 81 | // fOutputFile(NULL), |
12b2b8bc | 82 | fAnalysisType("AUTOMATIC"), |
ef4799a7 | 83 | fRPType("Global"), |
1c1d4332 | 84 | fCFManager1(NULL), |
85 | fCFManager2(NULL), | |
daf66719 | 86 | fCutsEvent(NULL), |
87 | fCutsRP(NULL), | |
88 | fCutsPOI(NULL), | |
1c1d4332 | 89 | fQAInt(NULL), |
90 | fQADiff(NULL), | |
fdff44c8 | 91 | fMinMult(0), |
92 | fMaxMult(10000000), | |
7a01f4a7 | 93 | fMinA(-1.0), |
94 | fMaxA(-0.01), | |
95 | fMinB(0.01), | |
96 | fMaxB(1.0), | |
489fdf79 | 97 | fQA(kFALSE), |
6e214c87 | 98 | fLoadCandidates(kFALSE), |
d459546b | 99 | fNbinsMult(10000), |
100 | fNbinsPt(100), | |
101 | fNbinsPhi(100), | |
102 | fNbinsEta(200), | |
103 | fNbinsQ(500), | |
104 | fMultMin(0.), | |
105 | fMultMax(10000.), | |
106 | fPtMin(0.), | |
107 | fPtMax(10.), | |
108 | fPhiMin(0.), | |
109 | fPhiMax(TMath::TwoPi()), | |
110 | fEtaMin(-5.), | |
111 | fEtaMax(5.), | |
112 | fQMin(0.), | |
113 | fQMax(3.), | |
f6f8c3fc | 114 | fExcludedEtaMin(0.), |
115 | fExcludedEtaMax(0.), | |
116 | fExcludedPhiMin(0.), | |
117 | fExcludedPhiMax(0.), | |
54089829 | 118 | fAfterburnerOn(kFALSE), |
119 | fNonFlowNumberOfTrackClones(0), | |
120 | fV1(0.), | |
121 | fV2(0.), | |
122 | fV3(0.), | |
123 | fV4(0.), | |
aab6527a | 124 | fMyTRandom3(NULL) |
1c1d4332 | 125 | { |
126 | // Constructor | |
127 | cout<<"AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent()"<<endl; | |
128 | } | |
129 | ||
489fdf79 | 130 | //________________________________________________________________________ |
6e214c87 | 131 | AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, TString RPtype, Bool_t on, UInt_t iseed, Bool_t bCandidates) : |
940a5ed1 | 132 | AliAnalysisTaskSE(name), |
133 | // fOutputFile(NULL), | |
12b2b8bc | 134 | fAnalysisType("AUTOMATIC"), |
44e060e0 | 135 | fRPType(RPtype), |
489fdf79 | 136 | fCFManager1(NULL), |
137 | fCFManager2(NULL), | |
daf66719 | 138 | fCutsEvent(NULL), |
139 | fCutsRP(NULL), | |
140 | fCutsPOI(NULL), | |
489fdf79 | 141 | fQAInt(NULL), |
142 | fQADiff(NULL), | |
fdff44c8 | 143 | fMinMult(0), |
144 | fMaxMult(10000000), | |
7a01f4a7 | 145 | fMinA(-1.0), |
146 | fMaxA(-0.01), | |
147 | fMinB(0.01), | |
148 | fMaxB(1.0), | |
489fdf79 | 149 | fQA(on), |
6e214c87 | 150 | fLoadCandidates(bCandidates), |
d459546b | 151 | fNbinsMult(10000), |
152 | fNbinsPt(100), | |
153 | fNbinsPhi(100), | |
154 | fNbinsEta(200), | |
155 | fNbinsQ(500), | |
156 | fMultMin(0.), | |
157 | fMultMax(10000.), | |
158 | fPtMin(0.), | |
159 | fPtMax(10.), | |
160 | fPhiMin(0.), | |
161 | fPhiMax(TMath::TwoPi()), | |
162 | fEtaMin(-5.), | |
163 | fEtaMax(5.), | |
164 | fQMin(0.), | |
165 | fQMax(3.), | |
f6f8c3fc | 166 | fExcludedEtaMin(0.), |
167 | fExcludedEtaMax(0.), | |
168 | fExcludedPhiMin(0.), | |
169 | fExcludedPhiMax(0.), | |
54089829 | 170 | fAfterburnerOn(kFALSE), |
171 | fNonFlowNumberOfTrackClones(0), | |
172 | fV1(0.), | |
173 | fV2(0.), | |
174 | fV3(0.), | |
175 | fV4(0.), | |
aab6527a | 176 | fMyTRandom3(NULL) |
489fdf79 | 177 | { |
178 | // Constructor | |
179 | cout<<"AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, Bool_t on, UInt_t iseed)"<<endl; | |
940a5ed1 | 180 | fMyTRandom3 = new TRandom3(iseed); |
489fdf79 | 181 | gRandom->SetSeed(fMyTRandom3->Integer(65539)); |
65201059 | 182 | |
6e214c87 | 183 | int availableINslot=1; |
44e060e0 | 184 | //FMD input slot |
185 | if (strcmp(RPtype,"FMD")==0) { | |
6e214c87 | 186 | DefineInput(availableINslot++, TList::Class()); |
44e060e0 | 187 | } |
6e214c87 | 188 | //Candidates input slot |
189 | if( fLoadCandidates ) | |
190 | DefineInput(availableINslot, TObjArray::Class()); | |
65201059 | 191 | |
192 | // Define output slots here | |
489fdf79 | 193 | // Define here the flow event output |
940a5ed1 | 194 | DefineOutput(1, AliFlowEventSimple::Class()); |
195 | if(on) | |
196 | { | |
65201059 | 197 | DefineOutput(2, TList::Class()); |
940a5ed1 | 198 | DefineOutput(3, TList::Class()); |
199 | } | |
6e214c87 | 200 | |
489fdf79 | 201 | // and for testing open an output file |
202 | // fOutputFile = new TFile("FlowEvents.root","RECREATE"); | |
203 | ||
204 | } | |
205 | ||
1c1d4332 | 206 | //________________________________________________________________________ |
207 | AliAnalysisTaskFlowEvent::~AliAnalysisTaskFlowEvent() | |
208 | { | |
209 | // | |
210 | // Destructor | |
211 | // | |
32b846cd | 212 | delete fMyTRandom3; |
940a5ed1 | 213 | // objects in the output list are deleted |
1c1d4332 | 214 | // by the TSelector dtor (I hope) |
215 | ||
216 | } | |
217 | ||
32b846cd | 218 | //________________________________________________________________________ |
219 | void AliAnalysisTaskFlowEvent::NotifyRun() | |
220 | { | |
221 | //at the beginning of each new run | |
222 | AliESDEvent* fESD = dynamic_cast<AliESDEvent*> (InputEvent()); | |
2a745a5f | 223 | if (!fESD) return; |
3abf7ecc | 224 | |
225 | Int_t run = fESD->GetRunNumber(); | |
226 | AliInfo(Form("Stariting run #%i",run)); | |
32b846cd | 227 | } |
228 | ||
1c1d4332 | 229 | //________________________________________________________________________ |
940a5ed1 | 230 | void AliAnalysisTaskFlowEvent::UserCreateOutputObjects() |
1c1d4332 | 231 | { |
232 | // Called at every worker node to initialize | |
233 | cout<<"AliAnalysisTaskFlowEvent::CreateOutputObjects()"<<endl; | |
234 | ||
12b2b8bc | 235 | if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "ESDMCkineESD" || fAnalysisType == "ESDMCkineMC" || fAnalysisType == "MC" || fAnalysisType == "AUTOMATIC")) |
940a5ed1 | 236 | { |
12b2b8bc | 237 | AliError("WRONG ANALYSIS TYPE! only ESD, ESDMCkineESD, ESDMCkineMC, AOD, MC and AUTOMATIC are allowed."); |
1c1d4332 | 238 | exit(1); |
239 | } | |
d459546b | 240 | |
241 | //set the common constants | |
242 | AliFlowCommonConstants* cc = AliFlowCommonConstants::GetMaster(); | |
243 | cc->SetNbinsMult(fNbinsMult); | |
244 | cc->SetNbinsPt(fNbinsPt); | |
245 | cc->SetNbinsPhi(fNbinsPhi); | |
246 | cc->SetNbinsEta(fNbinsEta); | |
247 | cc->SetNbinsQ(fNbinsQ); | |
248 | cc->SetMultMin(fMultMin); | |
249 | cc->SetMultMax(fMultMax); | |
250 | cc->SetPtMin(fPtMin); | |
251 | cc->SetPtMax(fPtMax); | |
252 | cc->SetPhiMin(fPhiMin); | |
253 | cc->SetPhiMax(fPhiMax); | |
254 | cc->SetEtaMin(fEtaMin); | |
255 | cc->SetEtaMax(fEtaMax); | |
256 | cc->SetQMin(fQMin); | |
257 | cc->SetQMax(fQMax); | |
258 | ||
1c1d4332 | 259 | } |
260 | ||
261 | //________________________________________________________________________ | |
940a5ed1 | 262 | void AliAnalysisTaskFlowEvent::UserExec(Option_t *) |
1c1d4332 | 263 | { |
264 | // Main loop | |
265 | // Called for each event | |
940a5ed1 | 266 | AliFlowEvent* flowEvent = NULL; |
267 | AliMCEvent* mcEvent = MCEvent(); // from TaskSE | |
268 | AliESDEvent* myESD = dynamic_cast<AliESDEvent*>(InputEvent()); // from TaskSE | |
269 | AliAODEvent* myAOD = dynamic_cast<AliAODEvent*>(InputEvent()); // from TaskSE | |
ef4799a7 | 270 | AliMultiplicity* myTracklets = NULL; |
333ce021 | 271 | AliESDPmdTrack* pmdtracks = NULL;//pmd |
44e060e0 | 272 | TH2F* histFMD = NULL; |
ef4799a7 | 273 | |
6e214c87 | 274 | int availableINslot=1; |
275 | if(strcmp(fRPType,"FMD")==0) { | |
276 | TList* FMDdata = dynamic_cast<TList*>(GetInputData(availableINslot++)); | |
44e060e0 | 277 | if(!FMDdata) { |
278 | cout<<" No FMDdata "<<endl; | |
a0241c3a | 279 | return; |
44e060e0 | 280 | } |
281 | histFMD = dynamic_cast<TH2F*>(FMDdata->FindObject("dNdetadphiHistogramTrVtx")); | |
282 | if (!histFMD) { | |
283 | cout<< "No histFMD"<<endl; | |
a0241c3a | 284 | return; |
44e060e0 | 285 | } |
286 | } | |
3ca4688a | 287 | |
2a745a5f | 288 | if (!(fCutsRP&&fCutsPOI&&fCutsEvent)) |
289 | { | |
290 | AliError("cuts not set"); | |
291 | return; | |
292 | } | |
293 | ||
3abf7ecc | 294 | //use the new and temporarily incomplete way of doing things |
12b2b8bc | 295 | if (fAnalysisType == "AUTOMATIC") |
daf66719 | 296 | { |
7d9ab4fb | 297 | //check event cuts |
2a745a5f | 298 | if (!fCutsEvent->IsSelected(InputEvent())) return; |
7d9ab4fb | 299 | |
03d364db | 300 | //first attach all possible information to the cuts |
441ea1cf | 301 | fCutsRP->SetEvent( InputEvent(), MCEvent() ); //attach event |
302 | fCutsPOI->SetEvent( InputEvent(), MCEvent() ); | |
32b846cd | 303 | |
03d364db | 304 | //then make the event |
305 | flowEvent = new AliFlowEvent( fCutsRP, fCutsPOI ); | |
daf66719 | 306 | if (myESD) |
9a0783cc | 307 | flowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity(InputEvent())); |
333ce021 | 308 | if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent); |
daf66719 | 309 | } |
940a5ed1 | 310 | |
311 | // Make the FlowEvent for MC input | |
a0241c3a | 312 | else if (fAnalysisType == "MC") |
940a5ed1 | 313 | { |
1c1d4332 | 314 | // Process MC truth, therefore we receive the AliAnalysisManager and ask it for the AliMCEventHandler |
315 | // This handler can return the current MC event | |
940a5ed1 | 316 | if (!(fCFManager1&&fCFManager2)) |
317 | { | |
77111ee6 | 318 | AliError("ERROR: No pointer to correction framework cuts! "); |
940a5ed1 | 319 | return; |
320 | } | |
321 | if (!mcEvent) | |
322 | { | |
77111ee6 | 323 | AliError("ERROR: Could not retrieve MC event"); |
940a5ed1 | 324 | return; |
325 | } | |
1c1d4332 | 326 | |
6d7734d2 | 327 | fCFManager1->SetMCEventInfo(mcEvent); |
328 | fCFManager2->SetMCEventInfo(mcEvent); | |
940a5ed1 | 329 | |
77111ee6 | 330 | AliInfo(Form("Number of MC particles: %d", mcEvent->GetNumberOfTracks())); |
331 | ||
332 | //check multiplicity | |
333 | if (!fCFManager1->CheckEventCuts(AliCFManager::kEvtGenCuts,mcEvent)) | |
334 | { | |
335 | AliWarning("Event does not pass multiplicity cuts"); return; | |
336 | } | |
337 | //make event | |
940a5ed1 | 338 | flowEvent = new AliFlowEvent(mcEvent,fCFManager1,fCFManager2); |
1c1d4332 | 339 | } |
ef4799a7 | 340 | |
940a5ed1 | 341 | // Make the FlowEvent for ESD input |
342 | else if (fAnalysisType == "ESD") | |
343 | { | |
344 | if (!(fCFManager1&&fCFManager2)) | |
345 | { | |
77111ee6 | 346 | AliError("ERROR: No pointer to correction framework cuts!"); |
940a5ed1 | 347 | return; |
348 | } | |
349 | if (!myESD) | |
350 | { | |
77111ee6 | 351 | AliError("ERROR: ESD not available"); |
940a5ed1 | 352 | return; |
353 | } | |
77111ee6 | 354 | |
b0569f96 | 355 | //check the offline trigger (check if the event has the correct trigger) |
ade93aa4 | 356 | AliInfo(Form("ESD has %d tracks", fInputEvent->GetNumberOfTracks())); |
77111ee6 | 357 | |
358 | //check multiplicity | |
359 | if (!fCFManager1->CheckEventCuts(AliCFManager::kEvtRecCuts,myESD)) | |
360 | { | |
361 | AliWarning("Event does not pass multiplicity cuts"); return; | |
362 | } | |
363 | ||
364 | //make event | |
ef4799a7 | 365 | if (fRPType == "Global") { |
366 | flowEvent = new AliFlowEvent(myESD,fCFManager1,fCFManager2); | |
367 | } | |
a0241c3a | 368 | else if (fRPType == "TPCOnly") { |
cd755f77 | 369 | flowEvent = new AliFlowEvent(myESD,fCFManager2,kFALSE); |
370 | } | |
a0241c3a | 371 | else if (fRPType == "TPCHybrid") { |
cd755f77 | 372 | flowEvent = new AliFlowEvent(myESD,fCFManager2,kTRUE); |
373 | } | |
ef4799a7 | 374 | else if (fRPType == "Tracklet"){ |
375 | flowEvent = new AliFlowEvent(myESD,myTracklets,fCFManager2); | |
376 | } | |
44e060e0 | 377 | else if (fRPType == "FMD"){ |
378 | flowEvent = new AliFlowEvent(myESD,histFMD,fCFManager2); | |
379 | } | |
333ce021 | 380 | else if (fRPType == "PMD"){ |
381 | flowEvent = new AliFlowEvent(myESD,pmdtracks,fCFManager2); | |
382 | } | |
5104aa35 | 383 | else return; |
44e060e0 | 384 | |
ef4799a7 | 385 | // if monte carlo event get reaction plane from monte carlo (depends on generator) |
5104aa35 | 386 | if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent); |
387 | //set reference multiplicity, TODO: maybe move it to the constructor? | |
388 | flowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE)); | |
1c1d4332 | 389 | } |
ef4799a7 | 390 | |
940a5ed1 | 391 | // Make the FlowEvent for ESD input combined with MC info |
392 | else if (fAnalysisType == "ESDMCkineESD" || fAnalysisType == "ESDMCkineMC" ) | |
393 | { | |
394 | if (!(fCFManager1&&fCFManager2)) | |
395 | { | |
77111ee6 | 396 | AliError("ERROR: No pointer to correction framework cuts! "); |
940a5ed1 | 397 | return; |
398 | } | |
399 | if (!myESD) | |
400 | { | |
77111ee6 | 401 | AliError("ERROR: ESD not available"); |
940a5ed1 | 402 | return; |
403 | } | |
77111ee6 | 404 | AliInfo(Form("There are %d tracks in this event", fInputEvent->GetNumberOfTracks())); |
940a5ed1 | 405 | |
406 | if (!mcEvent) | |
407 | { | |
77111ee6 | 408 | AliError("ERROR: Could not retrieve MC event"); |
940a5ed1 | 409 | return; |
410 | } | |
1c1d4332 | 411 | |
6d7734d2 | 412 | fCFManager1->SetMCEventInfo(mcEvent); |
413 | fCFManager2->SetMCEventInfo(mcEvent); | |
1c1d4332 | 414 | |
77111ee6 | 415 | //check multiplicity |
416 | if (!fCFManager1->CheckEventCuts(AliCFManager::kEvtRecCuts,myESD)) | |
417 | { | |
418 | AliWarning("Event does not pass multiplicity cuts"); return; | |
419 | } | |
420 | ||
421 | //make event | |
940a5ed1 | 422 | if (fAnalysisType == "ESDMCkineESD") |
423 | { | |
424 | flowEvent = new AliFlowEvent(myESD, mcEvent, AliFlowEvent::kESDkine, fCFManager1, fCFManager2 ); | |
425 | } | |
426 | else if (fAnalysisType == "ESDMCkineMC") | |
427 | { | |
428 | flowEvent = new AliFlowEvent(myESD, mcEvent, AliFlowEvent::kMCkine, fCFManager1, fCFManager2 ); | |
1c1d4332 | 429 | } |
a0241c3a | 430 | if (!flowEvent) return; |
85d2ee8d | 431 | // if monte carlo event get reaction plane from monte carlo (depends on generator) |
432 | if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent); | |
433 | //set reference multiplicity, TODO: maybe move it to the constructor? | |
434 | flowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE)); | |
1c1d4332 | 435 | } |
940a5ed1 | 436 | // Make the FlowEventSimple for AOD input |
437 | else if (fAnalysisType == "AOD") | |
438 | { | |
439 | if (!myAOD) | |
440 | { | |
77111ee6 | 441 | AliError("ERROR: AOD not available"); |
940a5ed1 | 442 | return; |
443 | } | |
ade93aa4 | 444 | AliInfo(Form("AOD has %d tracks", myAOD->GetNumberOfTracks())); |
940a5ed1 | 445 | flowEvent = new AliFlowEvent(myAOD); |
1c1d4332 | 446 | } |
447 | ||
6e214c87 | 448 | //inject candidates |
449 | if(fLoadCandidates) { | |
450 | TObjArray* Candidates = dynamic_cast<TObjArray*>(GetInputData(availableINslot++)); | |
41dc4195 | 451 | //if(Candidates->GetEntriesFast()) |
452 | //printf("I received %d candidates\n",Candidates->GetEntriesFast()); | |
422c61c7 | 453 | if (Candidates) |
454 | { | |
41dc4195 | 455 | for(int iCand=0; iCand!=Candidates->GetEntriesFast(); ++iCand ) { |
456 | AliFlowCandidateTrack *cand = dynamic_cast<AliFlowCandidateTrack*>(Candidates->At(iCand)); | |
422c61c7 | 457 | if (!cand) continue; |
41dc4195 | 458 | cand->SetForPOISelection(kTRUE); |
459 | cand->SetForRPSelection(kFALSE); | |
460 | //printf(" Ⱶ Checking at candidate %d with %d daughters\n",iCand,cand->GetNDaughters()); | |
461 | for(int iDau=0; iDau!=cand->GetNDaughters(); ++iDau) { | |
462 | //printf(" Ⱶ Daughter %d with fID %d", iDau, cand->GetIDDaughter(iDau) ); | |
463 | for(int iRPs=0; iRPs!=flowEvent->NumberOfTracks(); ++iRPs ) { | |
464 | AliFlowTrack *iRP = dynamic_cast<AliFlowTrack*>(flowEvent->GetTrack( iRPs )); | |
465 | if (!iRP) continue; | |
466 | if( !iRP->InRPSelection() ) | |
467 | continue; | |
468 | if( cand->GetIDDaughter(iDau) == iRP->GetID() ) { | |
469 | //printf(" was in RP set"); | |
470 | cand->SetDaughter( iDau, iRP ); | |
471 | //temporarily untagging all daugters | |
472 | iRP->SetForRPSelection(kFALSE); | |
473 | } | |
474 | } | |
475 | //printf("\n"); | |
476 | } | |
422c61c7 | 477 | flowEvent->AddTrack(cand); |
478 | } | |
6e214c87 | 479 | } |
480 | } | |
481 | ||
a0241c3a | 482 | if (!flowEvent) return; //shuts up coverity |
483 | ||
77111ee6 | 484 | //check final event cuts |
940a5ed1 | 485 | Int_t mult = flowEvent->NumberOfTracks(); |
ade93aa4 | 486 | AliInfo(Form("FlowEvent has %i tracks",mult)); |
487 | if (mult<fMinMult || mult>fMaxMult) | |
77111ee6 | 488 | { |
489 | AliWarning("FlowEvent cut on multiplicity"); return; | |
490 | } | |
940a5ed1 | 491 | |
f6f8c3fc | 492 | //define dead zone |
493 | flowEvent->DefineDeadZone(fExcludedEtaMin, fExcludedEtaMax, fExcludedPhiMin, fExcludedPhiMax ); | |
494 | ||
495 | ||
54089829 | 496 | ////////////////////////////////////////////////////////////////////////////// |
497 | ///////////////////////////AFTERBURNER | |
498 | if (fAfterburnerOn) | |
499 | { | |
500 | //if reaction plane not set from elsewhere randomize it before adding flow | |
501 | if (!flowEvent->IsSetMCReactionPlaneAngle()) | |
502 | flowEvent->SetMCReactionPlaneAngle(gRandom->Uniform(0.0,TMath::TwoPi())); | |
503 | ||
504 | flowEvent->AddFlow(fV1,fV2,fV3,fV4); //add flow | |
505 | flowEvent->CloneTracks(fNonFlowNumberOfTrackClones); //add nonflow by cloning tracks | |
506 | } | |
507 | ////////////////////////////////////////////////////////////////////////////// | |
508 | ||
ef4799a7 | 509 | //tag subEvents |
940a5ed1 | 510 | flowEvent->TagSubeventsInEta(fMinA,fMaxA,fMinB,fMaxB); |
511 | ||
46bec39c | 512 | //fListHistos->Print(); |
ef4799a7 | 513 | //fOutputFile->WriteObject(flowEvent,"myFlowEventSimple"); |
940a5ed1 | 514 | PostData(1,flowEvent); |
515 | if (fQA) | |
516 | { | |
65201059 | 517 | PostData(2,fQAInt); |
940a5ed1 | 518 | PostData(3,fQADiff); |
519 | } | |
520 | } | |
1c1d4332 | 521 | |
522 | //________________________________________________________________________ | |
940a5ed1 | 523 | void AliAnalysisTaskFlowEvent::Terminate(Option_t *) |
1c1d4332 | 524 | { |
525 | // Called once at the end of the query -- do not call in case of CAF | |
1c1d4332 | 526 | } |
489fdf79 | 527 |