Update and addition of LS analysis (Renu, Giacomo, Francesco)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AddTaskDplus.C
CommitLineData
1f4e9722 1AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kFALSE)
d486095a 2{
3 //
4afc48a2 4 // Test macro for the AliAnalysisTaskSE for D+ candidates
d486095a 5
4afc48a2 6 //Invariant mass histogram and
7 // association with MC truth (using MC info in AOD)
8 // R. Bala, bala@to.infn.it
d486095a 9 // Get the pointer to the existing analysis manager via the static access method.
10 //==============================================================================
11 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
12 if (!mgr) {
13 ::Error("AddTaskDplus", "No analysis manager to connect to.");
14 return NULL;
15 }
16
17
18 // Aanalysis task
1f4e9722 19 AliAnalysisTaskSEDplus *dplusTask = new AliAnalysisTaskSEDplus("DplusAnalysis",storeNtuple);
4afc48a2 20 dplusTask->SetReadMC(kTRUE);
21 dplusTask->SetDoLikeSign(kTRUE);
3b1598da 22 dplusTask->SetDebugLevel(0);
d486095a 23 mgr->AddTask(dplusTask);
24
25 //
26 // Create containers for input/output
41ff2555 27 AliAnalysisDataContainer *cinputDplus = mgr->CreateContainer("cinputDplus",TChain::Class(),
d486095a 28 AliAnalysisManager::kInputContainer);
41ff2555 29 AliAnalysisDataContainer *coutputDplus = mgr->CreateContainer("coutputDplus",TList::Class(),
d486095a 30 AliAnalysisManager::kOutputContainer,
31 "InvMassDplus.root");
1f4e9722 32 if(storeNtuple){
33 AliAnalysisDataContainer *coutputDplus2 = mgr->CreateContainer("coutputDplus2",TNtuple::Class(),
10bdd1ae 34 AliAnalysisManager::kOutputContainer,
2a5c77c6 35 "InvMassDplus_nt1.root");
4afc48a2 36
1f4e9722 37 coutputDplus2->SetSpecialOutput();
1f4e9722 38 }
d486095a 39 mgr->ConnectInput(dplusTask,0,mgr->GetCommonInputContainer());
40
41ff2555 41 mgr->ConnectOutput(dplusTask,1,coutputDplus);
1f4e9722 42
43 if(storeNtuple){
44 mgr->ConnectOutput(dplusTask,2,coutputDplus2);
1f4e9722 45 }
d486095a 46 return dplusTask;
47}