]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
changes by Diego
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jan 2010 16:13:34 +0000 (16:13 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jan 2010 16:13:34 +0000 (16:13 +0000)
PWG1/macros/AddTaskMTRchamberEfficiency.C

index a577df8f2c76ac4379154b01cf78e7cac5e1454e..f402eb48c8fa389534ef9303910984712d79d639 100644 (file)
@@ -11,10 +11,17 @@ AliAnalysisTaskTrigChEff *AddTaskMTRchamberEfficiency(Bool_t useGhosts = kFALSE)
   //==============================================================================
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
-    ::Error("AddTask", "No analysis manager to connect to.");
+    ::Error("AddTaskMTRchamberEfficiency", "No analysis manager to connect to.");
     return NULL;
   }   
 
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AliAnalysisTaskTrigChEff", "This task requires an input event handler");
+    return NULL;
+  }
+
   // Create the task
   AliAnalysisTaskTrigChEff* taskTrigChEff = new AliAnalysisTaskTrigChEff("TriggerChamberEfficiency");
   taskTrigChEff->SetUseGhostTracks(useGhosts);
@@ -28,7 +35,7 @@ AliAnalysisTaskTrigChEff *AddTaskMTRchamberEfficiency(Bool_t useGhosts = kFALSE)
   // Attach input
   mgr->ConnectInput(taskTrigChEff,0,mgr->GetCommonInputContainer());
   // Attach output
-  mgr->ConnectOutput(taskTrigChEff,0,cOutputTrigChEff);
+  mgr->ConnectOutput(taskTrigChEff,1,cOutputTrigChEff);
   
   return taskTrigChEff;
 }