Fill ntuple only on request; more mass histos (Francesco, Renu)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AddTaskDplus.C
index d457fefbd16b82e56b11df8a4d45cd76c8247d0e..fe237feae4196701affc5c329efe1c9415fddbd9 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTaskSEDplus *AddTaskDplus()
+AliAnalysisTaskSEDplus *AddTaskDplus(Bool_t storeNtuple=kFALSE)
 {
   //                                                                                                                                    
   // Test macro for the AliAnalysisTaskSE for heavy-flavour candidates                                                                  
@@ -17,20 +17,34 @@ AliAnalysisTaskSEDplus *AddTaskDplus()
 
 
   // Aanalysis task                                                                                                                     
-  AliAnalysisTaskSEDplus *dplusTask = new AliAnalysisTaskSEDplus("DplusAnalysis");
-  dplusTask->SetDebugLevel(2);
+  AliAnalysisTaskSEDplus *dplusTask = new AliAnalysisTaskSEDplus("DplusAnalysis",storeNtuple);
+  dplusTask->SetDebugLevel(0);
   mgr->AddTask(dplusTask);
 
   //                                                                                                                                    
   // Create containers for input/output                                                                                                 
-  AliAnalysisDataContainer *cinput = mgr->CreateContainer("cinput",TChain::Class(),
+  AliAnalysisDataContainer *cinputDplus = mgr->CreateContainer("cinputDplus",TChain::Class(),
                                                           AliAnalysisManager::kInputContainer);
-  AliAnalysisDataContainer *coutput = mgr->CreateContainer("coutput",TList::Class(),
+  AliAnalysisDataContainer *coutputDplus = mgr->CreateContainer("coutputDplus",TList::Class(),
                                                            AliAnalysisManager::kOutputContainer,
                                                            "InvMassDplus.root");
+  if(storeNtuple){
+    AliAnalysisDataContainer *coutputDplus2 = mgr->CreateContainer("coutputDplus2",TNtuple::Class(),
+                                                           AliAnalysisManager::kOutputContainer,
+                                                                "InvMassDplus_nt1.root");
+    AliAnalysisDataContainer *coutputDplus3 = mgr->CreateContainer("coutputDplus3",TNtuple::Class(),
+                                                           AliAnalysisManager::kOutputContainer,
+                                                                "InvMassDplus_nt2.root");
+    coutputDplus2->SetSpecialOutput();
+    coutputDplus3->SetSpecialOutput();
+  }
   mgr->ConnectInput(dplusTask,0,mgr->GetCommonInputContainer());
 
-  mgr->ConnectOutput(dplusTask,1,coutput);
-
+  mgr->ConnectOutput(dplusTask,1,coutputDplus);
+  
+  if(storeNtuple){
+    mgr->ConnectOutput(dplusTask,2,coutputDplus2);
+    mgr->ConnectOutput(dplusTask,3,coutputDplus3);
+  }
   return dplusTask;
 }