]>
Commit | Line | Data |
---|---|---|
a8d74d4a | 1 | AliAnalysisTaskCaloConv * AddTaskCaloConv(){ |
2 | //Macro to add class CaloConv (conversion+calorimeters pi0 analysis) to train | |
3 | //Argument is the path to the PHOS recalibration parameters (file with OCDB entry) | |
4 | //Default path to the file with unit recalibration == no recalibnration | |
5 | //If file does not exist, no recalibration histograms will be filled | |
6 | ||
7 | // Get the pointer to the existing analysis manager via the static access method. | |
8 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
9 | if (!mgr) { | |
10 | ::Error("AddTaskCaloConv", "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 | if (!mgr->GetInputEventHandler()) { | |
16 | ::Error("AddTaskCaloConv", "This task requires an input event handler"); | |
17 | return NULL; | |
18 | } | |
19 | ||
20 | // Add task | |
21 | AliAnalysisTaskCaloConv *task = new AliAnalysisTaskCaloConv("CaloConv"); | |
22 | mgr->AddTask(task); | |
23 | ||
24 | // Create containers for input/output | |
25 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
26 | mgr->ConnectInput(task, 0, cinput); | |
27 | ||
28 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
29 | AliAnalysisDataContainer *coutput = mgr->CreateContainer("CaloConv", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:PWG4_CaloConv",outputfile.Data())); | |
30 | mgr->ConnectOutput(task, 1, coutput); | |
31 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("CFCaloConv", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:PWG4_CFCaloConv",outputfile.Data())); | |
32 | mgr->ConnectOutput(task, 2, coutput2); | |
33 | ||
34 | return task ; | |
35 | ||
36 | } |