Fill ntuple only on request; more mass histos (Francesco, Renu)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AddTaskDplus.C
CommitLineData
1f4e9722 1AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kFALSE)
d486095a 2{
3 //
4 // Test macro for the AliAnalysisTaskSE for heavy-flavour candidates
5 // association with MC truth (using MC info in AOD)
6
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("AddTaskDplus", "No analysis manager to connect to.");
15 return NULL;
16 }
17
18
19 // Aanalysis task
1f4e9722 20 AliAnalysisTaskSEDplus *dplusTask = new AliAnalysisTaskSEDplus("DplusAnalysis",storeNtuple);
3b1598da 21 dplusTask->SetDebugLevel(0);
d486095a 22 mgr->AddTask(dplusTask);
23
24 //
25 // Create containers for input/output
41ff2555 26 AliAnalysisDataContainer *cinputDplus = mgr->CreateContainer("cinputDplus",TChain::Class(),
d486095a 27 AliAnalysisManager::kInputContainer);
41ff2555 28 AliAnalysisDataContainer *coutputDplus = mgr->CreateContainer("coutputDplus",TList::Class(),
d486095a 29 AliAnalysisManager::kOutputContainer,
30 "InvMassDplus.root");
1f4e9722 31 if(storeNtuple){
32 AliAnalysisDataContainer *coutputDplus2 = mgr->CreateContainer("coutputDplus2",TNtuple::Class(),
10bdd1ae 33 AliAnalysisManager::kOutputContainer,
2a5c77c6 34 "InvMassDplus_nt1.root");
1f4e9722 35 AliAnalysisDataContainer *coutputDplus3 = mgr->CreateContainer("coutputDplus3",TNtuple::Class(),
10bdd1ae 36 AliAnalysisManager::kOutputContainer,
2a5c77c6 37 "InvMassDplus_nt2.root");
1f4e9722 38 coutputDplus2->SetSpecialOutput();
39 coutputDplus3->SetSpecialOutput();
40 }
d486095a 41 mgr->ConnectInput(dplusTask,0,mgr->GetCommonInputContainer());
42
41ff2555 43 mgr->ConnectOutput(dplusTask,1,coutputDplus);
1f4e9722 44
45 if(storeNtuple){
46 mgr->ConnectOutput(dplusTask,2,coutputDplus2);
47 mgr->ConnectOutput(dplusTask,3,coutputDplus3);
48 }
d486095a 49 return dplusTask;
50}