Adding task for like-sign bkg for D0->Kpi (Carmelo)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AddTaskBkgLikeSignD0.C
1 AliAnalysisTaskSEBkgLikeSignD0 *AddTaskBkgLikeSignD0() 
2 {
3   //
4   // Test macro for the AliAnalysisTaskSEBkgLikeSignD0 
5   // starting from AliAOD.root file with HF + Like Sign candidates.
6   // C.Di Giglio, carmelo.digiglio@ba.infn.it
7   //
8
9
10   // Get the pointer to the existing analysis manager via the static access method.
11   //==============================================================================
12   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
13   if (!mgr) {
14     ::Error("AddTaskBkgLikeSignD0", "No analysis manager to connect to.");
15     return NULL;
16   }   
17
18   // Like-sign background analysis task    
19   AliAnalysisTaskSEBkgLikeSignD0 *lsD0Task = new AliAnalysisTaskSEBkgLikeSignD0("CmpLikeSignD0Analysis");
20   lsD0Task->SetDebugLevel(2);
21
22   mgr->AddTask(lsD0Task);
23
24   //
25   // Create containers for input/output
26   AliAnalysisDataContainer *cinputLSD0 = mgr->CreateContainer("cinputLikeSignD0",TChain::Class(), 
27                                                           AliAnalysisManager::kInputContainer);
28   AliAnalysisDataContainer *coutputLSD0 = mgr->CreateContainer("coutputLikeSignD0",TList::Class(),
29                                                            AliAnalysisManager::kOutputContainer,
30                                                            "CmpLikeSignD0.root");
31
32   mgr->ConnectInput(lsD0Task,0,mgr->GetCommonInputContainer());
33   mgr->ConnectOutput(lsD0Task,1,coutputLSD0);
34
35   return lsD0Task;
36 }