]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Fix for a recently introduced bug
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 15:20:40 +0000 (15:20 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 15:20:40 +0000 (15:20 +0000)
ANALYSIS/AliAnalysisManager.cxx
ANALYSIS/AliAnalysisTask.cxx

index 531e3b52311e0b9f6f26205a0ab7d0c676962baf..02566ad4a0e393576316bcfb596f6c5fe93a66b3 100644 (file)
@@ -360,7 +360,18 @@ void AliAnalysisManager::UnpackOutput(TList *source)
          callEnv.SetParam((Long_t) file);
          callEnv.Execute(output->GetData());
       }
          callEnv.SetParam((Long_t) file);
          callEnv.Execute(output->GetData());
       }
-      output->GetData()->Write();      
+      output->GetData()->Write();
+      // Check if there are client tasks that run in single-shot mode.
+      if (!output->HasConsumers()) continue;
+      output->SetEventByEvent(kFALSE);
+      TObjArray *list = output->GetConsumers();
+      Int_t ncons = list->GetEntriesFast();
+      for (Int_t i=0; i<ncons; i++) {
+         AliAnalysisTask *task = (AliAnalysisTask*)list->At(i);
+         task->CheckNotify(kTRUE);
+         // If task is active, execute it
+         if (task->IsActive()) task->ExecuteTask();         
+      }
    }
    if (fDebug > 1) {
       cout << "<-AliAnalysisManager::UnpackOutput()" << endl;
    }
    if (fDebug > 1) {
       cout << "<-AliAnalysisManager::UnpackOutput()" << endl;
@@ -585,7 +596,7 @@ void AliAnalysisManager::StartAnalysis(const char *type, TTree *tree)
    SetEventLoop(kFALSE);
    // Disable by default all branches and set event loop mode
    if (tree) {
    SetEventLoop(kFALSE);
    // Disable by default all branches and set event loop mode
    if (tree) {
-      tree->SetBranchStatus("*",0);
+//      tree->SetBranchStatus("*",0);
       SetEventLoop(kTRUE);
    }   
    AliAnalysisDataContainer *cont = 0;
       SetEventLoop(kTRUE);
    }   
    AliAnalysisDataContainer *cont = 0;
@@ -606,8 +617,8 @@ void AliAnalysisManager::StartAnalysis(const char *type, TTree *tree)
          cont = 0;
       }
       // All tasks feeding from the top containers must have the same event loop type
          cont = 0;
       }
       // All tasks feeding from the top containers must have the same event loop type
-      if (cont) task->SetExecPerEvent(IsEventLoop());
-      else task->SetExecPerEvent(task->IsExecPerEvent());         
+//      if (cont) task->SetExecPerEvent(IsEventLoop());
+//      else task->SetExecPerEvent(task->IsExecPerEvent());         
       task->LocalInit();
    }
    
       task->LocalInit();
    }
    
index 5ce8219ca88098a276daea551eeaec58ac136584..6a588faa530ba3f7714ca1b1c4ae83ad7af0114a 100644 (file)
@@ -233,12 +233,13 @@ void AliAnalysisTask::CheckNotify(Bool_t init)
 // accordingly. This method is called automatically for all tasks connected
 // to a container where the data was published.
    if (init) fInitialized = kFALSE;
 // accordingly. This method is called automatically for all tasks connected
 // to a container where the data was published.
    if (init) fInitialized = kFALSE;
-   Bool_t execperevent = IsExecPerEvent();
+//   Bool_t execperevent = IsExecPerEvent();
    AliAnalysisDataContainer *cinput;
    for (Int_t islot=0; islot<fNinputs; islot++) {
       cinput = GetInputSlot(islot)->GetContainer();
       if (!cinput) return;
    AliAnalysisDataContainer *cinput;
    for (Int_t islot=0; islot<fNinputs; islot++) {
       cinput = GetInputSlot(islot)->GetContainer();
       if (!cinput) return;
-      if (!cinput->GetData() || execperevent!=cinput->IsEventByEvent()) {
+      if (!cinput->GetData()) {
+//      if (!cinput->GetData() || execperevent!=cinput->IsEventByEvent()) {
          SetActive(kFALSE);
          return;
       }   
          SetActive(kFALSE);
          return;
       }