]>
Commit | Line | Data |
---|---|---|
bf6a8159 | 1 | //_________________________________________________________// |
2 | AliAnalysisTaskAODFilterBitQA *AddTaskAODFilterBitQA(TString taskname = "AODFilterBitQA") { | |
3 | // Creates an AODFilterBitQA analysis task and adds it to the analysis manager. | |
4 | // Get the pointer to the existing analysis manager via the static access method. | |
5 | ||
6 | //=========================================================================== | |
7 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
8 | if (!mgr) { | |
9 | ::Error("AddTaskBalancePsiCentralityTrain", "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("AddTaskAODFilterBitQA", "This task requires an input event handler"); | |
17 | return NULL; | |
18 | } | |
19 | TString analysisType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
20 | ||
21 | if (analysisType!="AOD"){ | |
22 | ::Error("AddTaskAODFilterBitQA", "analysis type NOT AOD --> makes no sense!"); | |
23 | return NULL; | |
24 | } | |
25 | ||
26 | // Create the task, add it to manager and configure it. | |
27 | //=========================================================================== | |
28 | AliAnalysisTaskAODFilterBitQA *taskAODFilterBitQA = new AliAnalysisTaskAODFilterBitQA(Form("%s",taskname.Data())); | |
29 | ||
30 | taskAODFilterBitQA->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral); | |
31 | ||
32 | mgr->AddTask(taskAODFilterBitQA); | |
33 | ||
34 | ||
35 | // Create ONLY the output containers for the data produced by the task. | |
36 | // Get and connect other common input/output containers via the manager as below | |
37 | //============================================================================== | |
38 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
39 | outputFileName += ":PWGCFEbyE.outputFilterBitQA"; | |
40 | AliAnalysisDataContainer *coutAODFilterBitQA = mgr->CreateContainer(Form("list_%s",taskname.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data()); | |
41 | ||
42 | mgr->ConnectInput(taskAODFilterBitQA, 0, mgr->GetCommonInputContainer()); | |
43 | mgr->ConnectOutput(taskAODFilterBitQA, 1, coutAODFilterBitQA); | |
44 | ||
45 | return taskAODFilterBitQA; | |
46 | } |