]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HMPID/AddTaskHMPID.C
AddTaskFlow.C: setting of exclusion range, change in default value cuts
[u/mrichter/AliRoot.git] / HMPID / AddTaskHMPID.C
1 AliHMPIDAnalysisTask *AddTaskHMPID(Bool_t useMC=kTRUE)\r
2 {\r
3 // Creates a HMPID task, configures it and adds it to the analysis manager.\r
4 \r
5    // Get the pointer to the existing analysis manager via the static access method.\r
6    //==============================================================================\r
7    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
8    if (!mgr) {\r
9       ::Error("AddTaskHMPID", "No analysis manager to connect to.");\r
10       return NULL;\r
11    }\r
12 \r
13    // Check the analysis type using the event handlers connected to the analysis manager.\r
14    //==============================================================================\r
15    if (!mgr->GetInputEventHandler()) {\r
16       ::Error("AddTaskHMPID", "This task requires an input event handler");\r
17       return NULL;\r
18    }\r
19 \r
20    // Create the task and configure it.\r
21    //===========================================================================\r
22 \r
23    AliHMPIDAnalysisTask *hmpTask = new AliHMPIDAnalysisTask("HMPIDAnalysisTask");\r
24    hmpTask->SetDebugLevel(0);\r
25    hmpTask->SelectCollisionCandidates();\r
26    hmpTask->SetUseMC(useMC);\r
27    mgr->AddTask(hmpTask);\r
28 \r
29    AliAnalysisDataContainer *cout_hmpid= mgr->CreateContainer("HmpidOutput", TList::Class(),AliAnalysisManager::kOutputContainer,\r
30                                            "HmpidOutput.root");\r
31 \r
32    // Create ONLY the output containers for the data produced by the task.\r
33    // Get and connect other common input/output containers via the manager as below\r
34    //==============================================================================\r
35    mgr->ConnectInput  (hmpTask, 0, mgr->GetCommonInputContainer());\r
36    mgr->ConnectOutput (hmpTask, 0, mgr->GetCommonOutputContainer());\r
37    mgr->ConnectOutput (hmpTask, 1, cout_hmpid);\r
38 \r
39    return hmpTask;\r
40 }\r