]>
Commit | Line | Data |
---|---|---|
ce7adfe9 | 1 | AliEPSelectionTask *AddTaskEventplane() |
2 | { | |
3 | // Macro to connect an event plane selection task to an existing analysis manager. | |
4 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
5 | if (!mgr) { | |
6 | ::Error("AddTaskEventplane", "No analysis manager to connect to."); | |
7 | return NULL; | |
8 | } | |
9 | // Check the analysis type using the event handlers connected to the analysis manager. | |
10 | //============================================================================== | |
11 | if (!mgr->GetInputEventHandler()) { | |
12 | ::Error("AddTaskEventplane", "This task requires an input event handler"); | |
13 | return NULL; | |
14 | } | |
15 | TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
16 | if (inputDataType != "ESD") { | |
17 | ::Error("AddTaskEventplane", "This task works only on ESD analysis"); | |
18 | return NULL; | |
19 | } | |
20 | ||
21 | AliEPSelectionTask *eventplaneTask = new AliEPSelectionTask("EventplaneSelection"); | |
22 | eventplaneTask->SelectCollisionCandidates(AliVEvent::kMB); | |
23 | eventplaneTask->SetESDtrackCuts("TPC"); | |
24 | // eventplaneTask->SetUseMCRP(); | |
25 | // eventplaneTask->SetPhiDistribution("Phidist.root","EPStat"); | |
26 | eventplaneTask->SetUsePtWeight(); | |
27 | // eventplaneTask->SetUsePhiWeight(); | |
28 | // eventplaneTask->SetSaveTrackContribution(); | |
29 | mgr->AddTask(eventplaneTask); | |
30 | ||
31 | AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
32 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("EPStat", | |
33 | TList::Class(), AliAnalysisManager::kOutputContainer, | |
34 | "EventStat_temp.root"); | |
35 | ||
36 | mgr->ConnectInput(eventplaneTask, 0, mgr->GetCommonInputContainer()); | |
37 | mgr->ConnectOutput(eventplaneTask,1,coutput1); | |
38 | ||
39 | return eventplaneTask; | |
40 | } |