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