]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muon/AddTaskMuonAODCreation.C
libPWGEMCAL, libPWGflowtasks and libPWGmuon converted to native cmake
[u/mrichter/AliRoot.git] / PWG / muon / AddTaskMuonAODCreation.C
1 AliAnalysisTaskMuonAODCreation *AddTaskMuonAODCreation()
2 {
3 // Creates a filter task to copy muon tracks from the Standard AOD to the Muon AOD
4 // R. Arnaldi - 6/10/09
5
6    // Get the pointer to the existing analysis manager via the static access method.
7    //==============================================================================
8    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9    if (!mgr) {
10       ::Error("AddTaskMuonAODCreation", "No analysis manager to connect to.");
11       return NULL;
12    }   
13    
14    // Get input handler
15    TString type = mgr->GetInputEventHandler()->GetDataType();
16
17    // Define output
18    AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist0",TList::Class(),AliAnalysisManager::kOutputContainer,"MuonPlots.root");
19
20    // Create the task, add it to the manager and configure it.
21    //===========================================================================   
22    AliAnalysisTaskMuonAODCreation *muonAODtask = new AliAnalysisTaskMuonAODCreation("Muon AOD creation");
23    mgr->AddTask(muonAODtask);
24    
25    // Create ONLY the output containers for the data produced by the task.
26    // Get and connect other common input/output containers via the manager as below
27    //==============================================================================
28    mgr->ConnectInput  (muonAODtask,  0, mgr->GetCommonInputContainer());
29    mgr->ConnectOutput (muonAODtask,  0, mgr->GetCommonOutputContainer());
30    mgr->ConnectOutput (muonAODtask,  1, coutput1);
31    return muonAODtask;
32 }