]>
Commit | Line | Data |
---|---|---|
e3475d46 | 1 | AliResonanceKinkPID *AddTaskKinkResonance(Short_t lCollidingSystems=0 /*0 = pp, 1 = AA*/) |
2 | { | |
3 | // Creates, configures and attaches to the train a V0 check task. | |
4 | // Get the pointer to the existing analysis manager via the static access method. | |
5 | //============================================================================== | |
6 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
7 | if (!mgr) { | |
8 | ::Error("AddTaskKinkResonance", "No analysis manager to connect to."); | |
9 | return NULL; | |
10 | } | |
11 | ||
12 | // Check the analysis type using the event handlers connected to the analysis manager. | |
13 | //============================================================================== | |
14 | if (!mgr->GetInputEventHandler()) { | |
15 | ::Error("AddTaskKinkResonance", "This task requires an input event handler"); | |
16 | return NULL; | |
17 | } | |
18 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
19 | if (type != "ESD") { | |
20 | ::Error("AddTaskKinkResonance", "This task needs an ESD input handler"); | |
21 | return NULL; | |
22 | } | |
23 | if (!mgr->GetMCtruthEventHandler()) { | |
24 | ::Error("AddTaskKinkResonance", "This task needs an MC handler"); | |
25 | return NULL; | |
26 | } | |
27 | ||
28 | // Create and configure the task | |
29 | AliResonanceKinkPID *taskkinkresonance = new AliResonanceKinkPID("TaskResKinkPID"); | |
30 | mgr->AddTask(taskkinkresonance); | |
31 | ||
32 | // Create ONLY the output containers for the data produced by the task. | |
33 | // Get and connect other common input/output containers via the manager as below | |
34 | //============================================================================== | |
35 | TString outname = "PP"; | |
36 | if (lCollidingSystems) outname = "AA"; | |
37 | if (mgr->GetMCtruthEventHandler()) outname += "-MC-"; | |
38 | outname += "KinkResonanceList.root"; | |
39 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("KinkResPID", | |
40 | TList::Class(), | |
41 | AliAnalysisManager::kOutputContainer, | |
42 | outname ); | |
43 | ||
44 | mgr->ConnectInput(taskkinkresonance, 0, mgr->GetCommonInputContainer()); | |
45 | mgr->ConnectOutput(taskkinkresonance, 1, coutput1); | |
46 | return taskkinkresonance; | |
47 | } |