Checking the number of tasks also in CheckTasks
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Apr 2011 15:09:51 +0000 (15:09 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Apr 2011 15:09:51 +0000 (15:09 +0000)
ANALYSIS/AliAnalysisManager.cxx

index 71e5049..7e372cc 100644 (file)
@@ -1438,6 +1438,11 @@ void AliAnalysisManager::CheckBranches(Bool_t load)
 Bool_t AliAnalysisManager::CheckTasks() const
 {
 // Check consistency of tasks.
+   Int_t ntasks = fTasks->GetEntries();
+   if (!ntasks) {
+      Error("CheckTasks", "No tasks connected to the manager. This may be due to forgetting to compile the task or to load their library.");
+      return kFALSE;
+   }
    // Get the pointer to AliAnalysisTaskSE::Class()
    TClass *badptr = (TClass*)gROOT->ProcessLine("AliAnalysisTaskSE::Class()");
    // Loop all tasks to check if their corresponding library was loaded