Generation of muon filtered AOD files from standard AOD files (Roberta)
[u/mrichter/AliRoot.git] / PWG3 / muon / AddTaskMuonAODCreation.C
CommitLineData
df8d91fa 1AliAnalysisTaskMuonAODCreation *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}