AliPhysics  vAN-20151012 (2287573)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AddTaskBkgLikeSignD0.C
Go to the documentation of this file.
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(0);
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  TString outputfile = AliAnalysisManager::GetCommonFileName();
29  outputfile += ":PWG3_D2H_CmpLikeSignD0";
30  AliAnalysisDataContainer *coutput1LSD0 = mgr->CreateContainer("coutput1LikeSignD0",TList::Class(),
31  AliAnalysisManager::kOutputContainer,
32  outputfile.Data());
33  AliAnalysisDataContainer *coutput2LSD0 = mgr->CreateContainer("coutput2LikeSignD0",TH1F::Class(),
34  AliAnalysisManager::kOutputContainer,
35  outputfile.Data());
36 
37  mgr->ConnectInput(lsD0Task,0,mgr->GetCommonInputContainer());
38  mgr->ConnectOutput(lsD0Task,1,coutput1LSD0);
39  mgr->ConnectOutput(lsD0Task,2,coutput2LSD0);
40 
41  return lsD0Task;
42 }
AliAnalysisTaskSEBkgLikeSignD0 * AddTaskBkgLikeSignD0()