]>
Commit | Line | Data |
---|---|---|
3882540a | 1 | AliHMPIDTaskQA *AddTaskHmpidQA(Bool_t useMC=kTRUE) |
2 | { | |
3 | // Creates a HMPID task, configures it and adds it to the analysis manager. | |
4 | ||
5 | // Get the pointer to the existing analysis manager via the static access method. | |
6 | //============================================================================== | |
7 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
8 | if (!mgr) { | |
9 | ::Error("AddTaskHmpidQA", "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 | //============================================================================== | |
15 | if (!mgr->GetInputEventHandler()) { | |
16 | ::Error("AddTaskHmpidQA", "This task requires an input event handler"); | |
17 | return NULL; | |
18 | } | |
19 | ||
20 | // Create the task and configure it. | |
21 | //=========================================================================== | |
22 | ||
23 | AliHMPIDTaskQA *hmpTask = new AliHMPIDTaskQA("HMPIDTaskQA"); | |
24 | hmpTask->SetDebugLevel(0); | |
25 | hmpTask->SelectCollisionCandidates(); | |
26 | hmpTask->SetUseMC(useMC); | |
27 | mgr->AddTask(hmpTask); | |
28 | ||
29 | AliAnalysisDataContainer *cout_hmpid= mgr->CreateContainer("HmpidQA", TList::Class(),AliAnalysisManager::kOutputContainer, | |
30 | Form("%s:HmpidQA",AliAnalysisManager::GetCommonFileName())); | |
31 | AliAnalysisDataContainer *cout_tree = mgr->CreateContainer("HmpidTree", TTree::Class(),AliAnalysisManager::kOutputContainer, | |
32 | Form("%s:HmpidQA",AliAnalysisManager::GetCommonFileName())); | |
33 | ||
34 | // Create ONLY the output containers for the data produced by the task. | |
35 | // Get and connect other common input/output containers via the manager as below | |
36 | //============================================================================== | |
37 | mgr->ConnectInput (hmpTask, 0, mgr->GetCommonInputContainer()); | |
38 | mgr->ConnectOutput (hmpTask, 0, mgr->GetCommonOutputContainer()); | |
39 | mgr->ConnectOutput (hmpTask, 1, cout_hmpid); | |
40 | mgr->ConnectOutput (hmpTask, 2, cout_tree); | |
41 | ||
42 | return hmpTask; | |
43 | } |