Modified AddTask macroes to add output to one single file
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Nov 2009 21:25:26 +0000 (21:25 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Nov 2009 21:25:26 +0000 (21:25 +0000)
PWG2/RESONANCES/macros/train/AddAnalysisTaskRsn.C
PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEff.C

index 957ed02..d3cbb05 100644 (file)
@@ -55,11 +55,17 @@ Bool_t AddAnalysisTaskRsn
   if (sourceESD) mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
   else mgr->ConnectInput(task, 0, mgr->GetCommonOutputContainer());
 
-  // define and connect output containers
-  AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, "info.root");
+  // create paths for the output in the common file
+  Char_t infoPath[500], phiPath[500], kstarPath[500];
+  sprintf(infoPath , "%s:PWG2RSNINFO" , AliAnalysisManager::GetCommonFileName());
+  sprintf(phiPath  , "%s:PWG2RSNPHI"  , AliAnalysisManager::GetCommonFileName());
+  sprintf(kstarPath, "%s:PWG2RSNKSTAR", AliAnalysisManager::GetCommonFileName());
+
+  // create containers for output
+  AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, infoPath);
   AliAnalysisDataContainer *outputRsn[2];
-  outputRsn[0] = mgr->CreateContainer("PHI"  , TList::Class(), AliAnalysisManager::kOutputContainer, "phi.root");
-  outputRsn[1] = mgr->CreateContainer("KSTAR", TList::Class(), AliAnalysisManager::kOutputContainer, "kstar.root");
+  outputRsn[0] = mgr->CreateContainer("PHI"  , TList::Class(), AliAnalysisManager::kOutputContainer, phiPath);
+  outputRsn[1] = mgr->CreateContainer("KSTAR", TList::Class(), AliAnalysisManager::kOutputContainer, kstarPath);
 
   mgr->ConnectOutput(task, 1, outputInfo);
   mgr->ConnectOutput(task, 2, outputRsn[0]);
index 41feaef..6ea50f8 100644 (file)
@@ -194,10 +194,15 @@ Bool_t AddAnalysisTaskRsnEff
     mgr->AddTask(task[i]);
     mgr->ConnectInput(task[i], 0, mgr->GetCommonInputContainer());
 
+    // create paths for the output in the common file
+    Char_t infoPath[500], effPath[500];
+    sprintf(infoPath , "%s:PWG2RSNINFO" , AliAnalysisManager::GetCommonFileName());
+    sprintf(effPath  , "%s:PWG2RSNEFF%s", AliAnalysisManager::GetCommonFileName(), suf[i].Data());
+
     // initialize and connect container for the output
     AliAnalysisDataContainer *info = 0x0, *out = 0x0;
-    info = mgr->CreateContainer(Form("EffInfo_%s", suf[i].Data()), TList::Class(), AliAnalysisManager::kOutputContainer, "info.root");
-    out  = mgr->CreateContainer(Form("EFF_%s", suf[i].Data()), TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s_%s.root", outFile, suf[i].Data()));
+    info = mgr->CreateContainer(Form("EffInfo_%s", suf[i].Data()), TList::Class(), AliAnalysisManager::kOutputContainer, infoPath);
+    out  = mgr->CreateContainer(Form("EFF_%s", suf[i].Data()), TList::Class(), AliAnalysisManager::kOutputContainer, effPath);
 
     mgr->ConnectOutput(task[i], 1, info);
     mgr->ConnectOutput(task[i], 2, out);