new class for omega measurement via 3 pion combinationomega3pi/
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskomega3pi.C
CommitLineData
9f831b2d 1AliAnalysisTaskOmegaPi0PiPi* AddTaskomega3pi()
2{
3 // Creates an omega(782) --> pi0 pi+ pi- analysis task,
4 // configures it and adds it to the analysis manager.
5
6 // Get the pointer to the existing analysis manager via the static access method.
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8 if (!mgr) {
9 ::Error("AddTaskomega3pi", "No analysis manager to connect to.");
10 return NULL;
11 }
12
13 // Check the analysis type using the event handlers connected to the analysis manager.
14 if (!mgr->GetInputEventHandler()) {
15 ::Error("AddTaskomega3pi", "This task requires an input event handler");
16 return NULL;
17 }
18
19 // Add task
20 AliAnalysisTaskOmegaPi0PiPi *omegaTask = new AliAnalysisTaskOmegaPi0PiPi("OmegaPi0PiPi");
21 mgr->AddTask(omegaTask);
22
23 // Create containers for input/output
24 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
25 AliAnalysisDataContainer *coutput = mgr->CreateContainer("histos",TList::Class(),AliAnalysisManager::kOutputContainer,"histos.root");
26
27 // Connect input/output
28 mgr->ConnectInput(omegaTask, 0, cinput);
29 mgr->ConnectOutput(omegaTask, 1, coutput);
30
31 return omegaTask;
32}
33
34