Pass execution mode to event handler.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Jun 2007 13:27:18 +0000 (13:27 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Jun 2007 13:27:18 +0000 (13:27 +0000)
Check if user output filename is "default". If yes use the aod file name
obtained from the event handler.

ANALYSIS/AliAnalysisManager.cxx

index e02ade8..72c6758 100644 (file)
@@ -212,7 +212,12 @@ void AliAnalysisManager::SlaveBegin(TTree *tree)
       cout << "->AliAnalysisManager::SlaveBegin()" << endl;
    }
    // Call InitIO of EventHandler
-   fEventHandler->InitIO();
+   if (fMode == kProofAnalysis) {
+       fEventHandler->InitIO("proof");
+   } else {
+       fEventHandler->InitIO("local");
+   }
+
    //
    TIter next(fTasks);
    AliAnalysisTask *task;
@@ -376,6 +381,8 @@ void AliAnalysisManager::UnpackOutput(TList *source)
       }   
       // Check if the output need to be written to a file.
       const char *filename = output->GetFileName();
+      if (!(strcmp(filename, "default"))) filename = fEventHandler->GetOutputFileName();
+
       if (!filename || !strlen(filename)) continue;
       TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
       if (file) file->cd();