55cec4b071e3ff36915a0ab4f818bea194f2d196
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AddTaskDs.C
1 AliAnalysisTaskSEDs *AddTaskDs(Bool_t readMC=kTRUE)
2 {
3   //                                                                           
4   // Test macro for the AliAnalysisTaskSE for Ds candidates 
5
6
7   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8   if (!mgr) {
9     ::Error("AddTaskDs", "No analysis manager to connect to.");
10     return NULL;
11   }
12
13
14   // Aanalysis task                                                                                                                     
15   AliAnalysisTaskSEDs *dsTask = new AliAnalysisTaskSEDs("DsAnalysis");
16   dsTask->SetReadMC(readMC);
17   dsTask->SetDebugLevel(0);
18   mgr->AddTask(dsTask);
19
20   //                                                                                                                                    
21   // Create containers for input/output                                                                                                 
22   AliAnalysisDataContainer *cinputDs = mgr->CreateContainer("cinputDs",TChain::Class(),
23                                                             AliAnalysisManager::kInputContainer);
24
25   TString outputfile = AliAnalysisManager::GetCommonFileName();
26   outputfile += ":PWG3_D2H_InvMassDs";
27   AliAnalysisDataContainer *coutputDs = mgr->CreateContainer("coutputDs",TList::Class(),
28                                                              AliAnalysisManager::kOutputContainer,
29                                                              outputfile.Data());
30
31   mgr->ConnectInput(dsTask,0,mgr->GetCommonInputContainer());
32
33   mgr->ConnectOutput(dsTask,1,coutputDs);
34   
35   return dsTask;
36 }