]>
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.), | |
1a80f9f6 | 124 | fV5(0.), |
7d27a354 | 125 | fFlowEvent(NULL), |
aab6527a | 126 | fMyTRandom3(NULL) |
1c1d4332 | 127 | { |
128 | // Constructor | |
129 | cout<<"AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent()"<<endl; | |
130 | } | |
131 | ||
489fdf79 | 132 | //________________________________________________________________________ |
6e214c87 | 133 | AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, TString RPtype, Bool_t on, UInt_t iseed, Bool_t bCandidates) : |
940a5ed1 | 134 | AliAnalysisTaskSE(name), |
135 | // fOutputFile(NULL), | |
12b2b8bc | 136 | fAnalysisType("AUTOMATIC"), |
44e060e0 | 137 | fRPType(RPtype), |
489fdf79 | 138 | fCFManager1(NULL), |
139 | fCFManager2(NULL), | |
daf66719 | 140 | fCutsEvent(NULL), |
141 | fCutsRP(NULL), | |
142 | fCutsPOI(NULL), | |
489fdf79 | 143 | fQAInt(NULL), |
144 | fQADiff(NULL), | |
fdff44c8 | 145 | fMinMult(0), |
146 | fMaxMult(10000000), | |
7a01f4a7 | 147 | fMinA(-1.0), |
148 | fMaxA(-0.01), | |
149 | fMinB(0.01), | |
150 | fMaxB(1.0), | |
489fdf79 | 151 | fQA(on), |
6e214c87 | 152 | fLoadCandidates(bCandidates), |
d459546b | 153 | fNbinsMult(10000), |
154 | fNbinsPt(100), | |
155 | fNbinsPhi(100), | |
156 | fNbinsEta(200), | |
157 | fNbinsQ(500), | |
158 | fMultMin(0.), | |
159 | fMultMax(10000.), | |
160 | fPtMin(0.), | |
161 | fPtMax(10.), | |
162 | fPhiMin(0.), | |
163 | fPhiMax(TMath::TwoPi()), | |
164 | fEtaMin(-5.), | |
165 | fEtaMax(5.), | |
166 | fQMin(0.), | |
167 | fQMax(3.), | |
f6f8c3fc | 168 | fExcludedEtaMin(0.), |
169 | fExcludedEtaMax(0.), | |
170 | fExcludedPhiMin(0.), | |
171 | fExcludedPhiMax(0.), | |
54089829 | 172 | fAfterburnerOn(kFALSE), |
173 | fNonFlowNumberOfTrackClones(0), | |
174 | fV1(0.), | |
175 | fV2(0.), | |
176 | fV3(0.), | |
177 | fV4(0.), | |
1a80f9f6 | 178 | fV5(0.), |
7d27a354 | 179 | fFlowEvent(NULL), |
aab6527a | 180 | fMyTRandom3(NULL) |
489fdf79 | 181 | { |
182 | // Constructor | |
183 | cout<<"AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, Bool_t on, UInt_t iseed)"<<endl; | |
940a5ed1 | 184 | fMyTRandom3 = new TRandom3(iseed); |
489fdf79 | 185 | gRandom->SetSeed(fMyTRandom3->Integer(65539)); |
65201059 | 186 | |
6e214c87 | 187 | int availableINslot=1; |
44e060e0 | 188 | //FMD input slot |
189 | if (strcmp(RPtype,"FMD")==0) { | |
6e214c87 | 190 | DefineInput(availableINslot++, TList::Class()); |
44e060e0 | 191 | } |
6e214c87 | 192 | //Candidates input slot |
193 | if( fLoadCandidates ) | |
194 | DefineInput(availableINslot, TObjArray::Class()); | |
65201059 | 195 | |
196 | // Define output slots here | |
489fdf79 | 197 | // Define here the flow event output |
940a5ed1 | 198 | DefineOutput(1, AliFlowEventSimple::Class()); |
199 | if(on) | |
200 | { | |
65201059 | 201 | DefineOutput(2, TList::Class()); |
940a5ed1 | 202 | DefineOutput(3, TList::Class()); |
203 | } | |
6e214c87 | 204 | |
489fdf79 | 205 | // and for testing open an output file |
206 | // fOutputFile = new TFile("FlowEvents.root","RECREATE"); | |
207 | ||
208 | } | |
209 | ||
1c1d4332 | 210 | //________________________________________________________________________ |
211 | AliAnalysisTaskFlowEvent::~AliAnalysisTaskFlowEvent() | |
212 | { | |
213 | // | |
214 | // Destructor | |
215 | // | |
32b846cd | 216 | delete fMyTRandom3; |
f299ea19 | 217 | delete fFlowEvent; |
940a5ed1 | 218 | // objects in the output list are deleted |
1c1d4332 | 219 | // by the TSelector dtor (I hope) |
220 | ||
221 | } | |
222 | ||
32b846cd | 223 | //________________________________________________________________________ |
224 | void AliAnalysisTaskFlowEvent::NotifyRun() | |
225 | { | |
226 | //at the beginning of each new run | |
227 | AliESDEvent* fESD = dynamic_cast<AliESDEvent*> (InputEvent()); | |
2a745a5f | 228 | if (!fESD) return; |
3abf7ecc | 229 | |
230 | Int_t run = fESD->GetRunNumber(); | |
231 | AliInfo(Form("Stariting run #%i",run)); | |
32b846cd | 232 | } |
233 | ||
1c1d4332 | 234 | //________________________________________________________________________ |
940a5ed1 | 235 | void AliAnalysisTaskFlowEvent::UserCreateOutputObjects() |
1c1d4332 | 236 | { |
237 | // Called at every worker node to initialize | |
238 | cout<<"AliAnalysisTaskFlowEvent::CreateOutputObjects()"<<endl; | |
239 | ||
12b2b8bc | 240 | if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "ESDMCkineESD" || fAnalysisType == "ESDMCkineMC" || fAnalysisType == "MC" || fAnalysisType == "AUTOMATIC")) |
940a5ed1 | 241 | { |
12b2b8bc | 242 | AliError("WRONG ANALYSIS TYPE! only ESD, ESDMCkineESD, ESDMCkineMC, AOD, MC and AUTOMATIC are allowed."); |
1c1d4332 | 243 | exit(1); |
244 | } | |
d459546b | 245 | |
246 | //set the common constants | |
247 | AliFlowCommonConstants* cc = AliFlowCommonConstants::GetMaster(); | |
248 | cc->SetNbinsMult(fNbinsMult); | |
249 | cc->SetNbinsPt(fNbinsPt); | |
250 | cc->SetNbinsPhi(fNbinsPhi); | |
251 | cc->SetNbinsEta(fNbinsEta); | |
252 | cc->SetNbinsQ(fNbinsQ); | |
253 | cc->SetMultMin(fMultMin); | |
254 | cc->SetMultMax(fMultMax); | |
255 | cc->SetPtMin(fPtMin); | |
256 | cc->SetPtMax(fPtMax); | |
257 | cc->SetPhiMin(fPhiMin); | |
258 | cc->SetPhiMax(fPhiMax); | |
259 | cc->SetEtaMin(fEtaMin); | |
260 | cc->SetEtaMax(fEtaMax); | |
261 | cc->SetQMin(fQMin); | |
262 | cc->SetQMax(fQMax); | |
263 | ||
7d27a354 | 264 | fFlowEvent = new AliFlowEvent(3000); |
265 | ||
1c1d4332 | 266 | } |
267 | ||
268 | //________________________________________________________________________ | |
940a5ed1 | 269 | void AliAnalysisTaskFlowEvent::UserExec(Option_t *) |
1c1d4332 | 270 | { |
271 | // Main loop | |
272 | // Called for each event | |
7d27a354 | 273 | //delete fFlowEvent; |
940a5ed1 | 274 | AliMCEvent* mcEvent = MCEvent(); // from TaskSE |
275 | AliESDEvent* myESD = dynamic_cast<AliESDEvent*>(InputEvent()); // from TaskSE | |
276 | AliAODEvent* myAOD = dynamic_cast<AliAODEvent*>(InputEvent()); // from TaskSE | |
ef4799a7 | 277 | AliMultiplicity* myTracklets = NULL; |
333ce021 | 278 | AliESDPmdTrack* pmdtracks = NULL;//pmd |
ef4799a7 | 279 | |
6e214c87 | 280 | int availableINslot=1; |
3ca4688a | 281 | |
2a745a5f | 282 | if (!(fCutsRP&&fCutsPOI&&fCutsEvent)) |
283 | { | |
284 | AliError("cuts not set"); | |
285 | return; | |
286 | } | |
287 | ||
7d27a354 | 288 | //DEFAULT - automatically takes care of everything |
12b2b8bc | 289 | if (fAnalysisType == "AUTOMATIC") |
daf66719 | 290 | { |
7d9ab4fb | 291 | //check event cuts |
2a745a5f | 292 | if (!fCutsEvent->IsSelected(InputEvent())) return; |
7d9ab4fb | 293 | |
03d364db | 294 | //first attach all possible information to the cuts |
441ea1cf | 295 | fCutsRP->SetEvent( InputEvent(), MCEvent() ); //attach event |
296 | fCutsPOI->SetEvent( InputEvent(), MCEvent() ); | |
32b846cd | 297 | |
03d364db | 298 | //then make the event |
7d27a354 | 299 | fFlowEvent->Fill( fCutsRP, fCutsPOI ); |
300 | //fFlowEvent = new AliFlowEvent( fCutsRP, fCutsPOI ); | |
301 | ||
daf66719 | 302 | if (myESD) |
7d27a354 | 303 | fFlowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity(InputEvent())); |
304 | if (mcEvent && mcEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(mcEvent); | |
daf66719 | 305 | } |
940a5ed1 | 306 | |
307 | // Make the FlowEvent for MC input | |
a0241c3a | 308 | else if (fAnalysisType == "MC") |
940a5ed1 | 309 | { |
1c1d4332 | 310 | // Process MC truth, therefore we receive the AliAnalysisManager and ask it for the AliMCEventHandler |
311 | // This handler can return the current MC event | |
940a5ed1 | 312 | if (!(fCFManager1&&fCFManager2)) |
313 | { | |
77111ee6 | 314 | AliError("ERROR: No pointer to correction framework cuts! "); |
940a5ed1 | 315 | return; |
316 | } | |
317 | if (!mcEvent) | |
318 | { | |
77111ee6 | 319 | AliError("ERROR: Could not retrieve MC event"); |
940a5ed1 | 320 | return; |
321 | } | |
1c1d4332 | 322 | |
6d7734d2 | 323 | fCFManager1->SetMCEventInfo(mcEvent); |
324 | fCFManager2->SetMCEventInfo(mcEvent); | |
940a5ed1 | 325 | |
77111ee6 | 326 | AliInfo(Form("Number of MC particles: %d", mcEvent->GetNumberOfTracks())); |
327 | ||
328 | //check multiplicity | |
329 | if (!fCFManager1->CheckEventCuts(AliCFManager::kEvtGenCuts,mcEvent)) | |
330 | { | |
331 | AliWarning("Event does not pass multiplicity cuts"); return; | |
332 | } | |
333 | //make event | |
7d27a354 | 334 | fFlowEvent = new AliFlowEvent(mcEvent,fCFManager1,fCFManager2); |
1c1d4332 | 335 | } |
ef4799a7 | 336 | |
940a5ed1 | 337 | // Make the FlowEvent for ESD input |
338 | else if (fAnalysisType == "ESD") | |
339 | { | |
340 | if (!(fCFManager1&&fCFManager2)) | |
341 | { | |
77111ee6 | 342 | AliError("ERROR: No pointer to correction framework cuts!"); |
940a5ed1 | 343 | return; |
344 | } | |
345 | if (!myESD) | |
346 | { | |
77111ee6 | 347 | AliError("ERROR: ESD not available"); |
940a5ed1 | 348 | return; |
349 | } | |
77111ee6 | 350 | |
b0569f96 | 351 | //check the offline trigger (check if the event has the correct trigger) |
ade93aa4 | 352 | AliInfo(Form("ESD has %d tracks", fInputEvent->GetNumberOfTracks())); |
77111ee6 | 353 | |
354 | //check multiplicity | |
355 | if (!fCFManager1->CheckEventCuts(AliCFManager::kEvtRecCuts,myESD)) | |
356 | { | |
357 | AliWarning("Event does not pass multiplicity cuts"); return; | |
358 | } | |
359 | ||
360 | //make event | |
ef4799a7 | 361 | if (fRPType == "Global") { |
7d27a354 | 362 | fFlowEvent = new AliFlowEvent(myESD,fCFManager1,fCFManager2); |
ef4799a7 | 363 | } |
a0241c3a | 364 | else if (fRPType == "TPCOnly") { |
7d27a354 | 365 | fFlowEvent = new AliFlowEvent(myESD,fCFManager2,kFALSE); |
cd755f77 | 366 | } |
a0241c3a | 367 | else if (fRPType == "TPCHybrid") { |
7d27a354 | 368 | fFlowEvent = new AliFlowEvent(myESD,fCFManager2,kTRUE); |
cd755f77 | 369 | } |
ef4799a7 | 370 | else if (fRPType == "Tracklet"){ |
7d27a354 | 371 | fFlowEvent = new AliFlowEvent(myESD,myTracklets,fCFManager2); |
ef4799a7 | 372 | } |
44e060e0 | 373 | else if (fRPType == "FMD"){ |
dd60b476 | 374 | TList* FMDdata = dynamic_cast<TList*>(GetInputData(availableINslot++)); |
375 | if(!FMDdata) { | |
376 | cout<<" No FMDdata "<<endl; | |
377 | return; | |
378 | } | |
379 | TH2F* histFMD = dynamic_cast<TH2F*>(FMDdata->FindObject("dNdetadphiHistogramTrVtx")); | |
380 | if (!histFMD) { | |
381 | cout<< "No histFMD"<<endl; | |
382 | return; | |
383 | } | |
7d27a354 | 384 | fFlowEvent = new AliFlowEvent(myESD,histFMD,fCFManager2); |
44e060e0 | 385 | } |
333ce021 | 386 | else if (fRPType == "PMD"){ |
7d27a354 | 387 | fFlowEvent = new AliFlowEvent(myESD,pmdtracks,fCFManager2); |
333ce021 | 388 | } |
5104aa35 | 389 | else return; |
44e060e0 | 390 | |
ef4799a7 | 391 | // if monte carlo event get reaction plane from monte carlo (depends on generator) |
7d27a354 | 392 | if (mcEvent && mcEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(mcEvent); |
5104aa35 | 393 | //set reference multiplicity, TODO: maybe move it to the constructor? |
7d27a354 | 394 | fFlowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE)); |
1c1d4332 | 395 | } |
ef4799a7 | 396 | |
940a5ed1 | 397 | // Make the FlowEvent for ESD input combined with MC info |
398 | else if (fAnalysisType == "ESDMCkineESD" || fAnalysisType == "ESDMCkineMC" ) | |
399 | { | |
400 | if (!(fCFManager1&&fCFManager2)) | |
401 | { | |
77111ee6 | 402 | AliError("ERROR: No pointer to correction framework cuts! "); |
940a5ed1 | 403 | return; |
404 | } | |
405 | if (!myESD) | |
406 | { | |
77111ee6 | 407 | AliError("ERROR: ESD not available"); |
940a5ed1 | 408 | return; |
409 | } | |
77111ee6 | 410 | AliInfo(Form("There are %d tracks in this event", fInputEvent->GetNumberOfTracks())); |
940a5ed1 | 411 | |
412 | if (!mcEvent) | |
413 | { | |
77111ee6 | 414 | AliError("ERROR: Could not retrieve MC event"); |
940a5ed1 | 415 | return; |
416 | } | |
1c1d4332 | 417 | |
6d7734d2 | 418 | fCFManager1->SetMCEventInfo(mcEvent); |
419 | fCFManager2->SetMCEventInfo(mcEvent); | |
1c1d4332 | 420 | |
77111ee6 | 421 | //check multiplicity |
422 | if (!fCFManager1->CheckEventCuts(AliCFManager::kEvtRecCuts,myESD)) | |
423 | { | |
424 | AliWarning("Event does not pass multiplicity cuts"); return; | |
425 | } | |
426 | ||
427 | //make event | |
940a5ed1 | 428 | if (fAnalysisType == "ESDMCkineESD") |
429 | { | |
7d27a354 | 430 | fFlowEvent = new AliFlowEvent(myESD, mcEvent, AliFlowEvent::kESDkine, fCFManager1, fCFManager2 ); |
940a5ed1 | 431 | } |
432 | else if (fAnalysisType == "ESDMCkineMC") | |
433 | { | |
7d27a354 | 434 | fFlowEvent = new AliFlowEvent(myESD, mcEvent, AliFlowEvent::kMCkine, fCFManager1, fCFManager2 ); |
1c1d4332 | 435 | } |
7d27a354 | 436 | if (!fFlowEvent) return; |
85d2ee8d | 437 | // if monte carlo event get reaction plane from monte carlo (depends on generator) |
7d27a354 | 438 | if (mcEvent && mcEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(mcEvent); |
85d2ee8d | 439 | //set reference multiplicity, TODO: maybe move it to the constructor? |
7d27a354 | 440 | fFlowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE)); |
1c1d4332 | 441 | } |
940a5ed1 | 442 | // Make the FlowEventSimple for AOD input |
443 | else if (fAnalysisType == "AOD") | |
444 | { | |
445 | if (!myAOD) | |
446 | { | |
77111ee6 | 447 | AliError("ERROR: AOD not available"); |
940a5ed1 | 448 | return; |
449 | } | |
ade93aa4 | 450 | AliInfo(Form("AOD has %d tracks", myAOD->GetNumberOfTracks())); |
7d27a354 | 451 | fFlowEvent = new AliFlowEvent(myAOD); |
1c1d4332 | 452 | } |
453 | ||
6e214c87 | 454 | //inject candidates |
455 | if(fLoadCandidates) { | |
456 | TObjArray* Candidates = dynamic_cast<TObjArray*>(GetInputData(availableINslot++)); | |
41dc4195 | 457 | //if(Candidates->GetEntriesFast()) |
458 | //printf("I received %d candidates\n",Candidates->GetEntriesFast()); | |
422c61c7 | 459 | if (Candidates) |
460 | { | |
41dc4195 | 461 | for(int iCand=0; iCand!=Candidates->GetEntriesFast(); ++iCand ) { |
462 | AliFlowCandidateTrack *cand = dynamic_cast<AliFlowCandidateTrack*>(Candidates->At(iCand)); | |
422c61c7 | 463 | if (!cand) continue; |
41dc4195 | 464 | cand->SetForPOISelection(kTRUE); |
465 | cand->SetForRPSelection(kFALSE); | |
466 | //printf(" Ⱶ Checking at candidate %d with %d daughters\n",iCand,cand->GetNDaughters()); | |
467 | for(int iDau=0; iDau!=cand->GetNDaughters(); ++iDau) { | |
468 | //printf(" Ⱶ Daughter %d with fID %d", iDau, cand->GetIDDaughter(iDau) ); | |
7d27a354 | 469 | for(int iRPs=0; iRPs!=fFlowEvent->NumberOfTracks(); ++iRPs ) { |
470 | AliFlowTrack *iRP = dynamic_cast<AliFlowTrack*>(fFlowEvent->GetTrack( iRPs )); | |
41dc4195 | 471 | if (!iRP) continue; |
472 | if( !iRP->InRPSelection() ) | |
473 | continue; | |
474 | if( cand->GetIDDaughter(iDau) == iRP->GetID() ) { | |
475 | //printf(" was in RP set"); | |
476 | cand->SetDaughter( iDau, iRP ); | |
477 | //temporarily untagging all daugters | |
478 | iRP->SetForRPSelection(kFALSE); | |
479 | } | |
480 | } | |
481 | //printf("\n"); | |
482 | } | |
7d27a354 | 483 | fFlowEvent->AddTrack(cand); |
422c61c7 | 484 | } |
6e214c87 | 485 | } |
486 | } | |
487 | ||
7d27a354 | 488 | if (!fFlowEvent) return; //shuts up coverity |
a0241c3a | 489 | |
77111ee6 | 490 | //check final event cuts |
7d27a354 | 491 | Int_t mult = fFlowEvent->NumberOfTracks(); |
ade93aa4 | 492 | AliInfo(Form("FlowEvent has %i tracks",mult)); |
493 | if (mult<fMinMult || mult>fMaxMult) | |
77111ee6 | 494 | { |
495 | AliWarning("FlowEvent cut on multiplicity"); return; | |
496 | } | |
940a5ed1 | 497 | |
f6f8c3fc | 498 | //define dead zone |
7d27a354 | 499 | fFlowEvent->DefineDeadZone(fExcludedEtaMin, fExcludedEtaMax, fExcludedPhiMin, fExcludedPhiMax ); |
f6f8c3fc | 500 | |
501 | ||
54089829 | 502 | ////////////////////////////////////////////////////////////////////////////// |
503 | ///////////////////////////AFTERBURNER | |
504 | if (fAfterburnerOn) | |
505 | { | |
506 | //if reaction plane not set from elsewhere randomize it before adding flow | |
7d27a354 | 507 | if (!fFlowEvent->IsSetMCReactionPlaneAngle()) |
508 | fFlowEvent->SetMCReactionPlaneAngle(gRandom->Uniform(0.0,TMath::TwoPi())); | |
54089829 | 509 | |
7d27a354 | 510 | fFlowEvent->AddFlow(fV1,fV2,fV3,fV4,fV5); //add flow |
511 | fFlowEvent->CloneTracks(fNonFlowNumberOfTrackClones); //add nonflow by cloning tracks | |
54089829 | 512 | } |
513 | ////////////////////////////////////////////////////////////////////////////// | |
514 | ||
ef4799a7 | 515 | //tag subEvents |
7d27a354 | 516 | fFlowEvent->TagSubeventsInEta(fMinA,fMaxA,fMinB,fMaxB); |
940a5ed1 | 517 | |
46bec39c | 518 | //fListHistos->Print(); |
7d27a354 | 519 | //fOutputFile->WriteObject(fFlowEvent,"myFlowEventSimple"); |
520 | PostData(1,fFlowEvent); | |
940a5ed1 | 521 | if (fQA) |
522 | { | |
65201059 | 523 | PostData(2,fQAInt); |
940a5ed1 | 524 | PostData(3,fQADiff); |
525 | } | |
526 | } | |
1c1d4332 | 527 | |
528 | //________________________________________________________________________ | |
940a5ed1 | 529 | void AliAnalysisTaskFlowEvent::Terminate(Option_t *) |
1c1d4332 | 530 | { |
531 | // Called once at the end of the query -- do not call in case of CAF | |
1c1d4332 | 532 | } |
489fdf79 | 533 |