]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added user-callable check if we have an MC input handler
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Oct 2013 07:06:52 +0000 (07:06 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Oct 2013 07:06:52 +0000 (07:06 +0000)
PWGLF/FORWARD/trains/TrainSetup.C

index cec7c270f22a10b847b9d538c6d1a1724a208a2f..cdbf3e7e75cc615fa98641f91f3c2074fd680007 100644 (file)
@@ -636,7 +636,18 @@ protected:
     TString args;
     return AddSETask(macro, args);
   }
-
+  /** 
+   * Check if we have an MC handler attached 
+   * 
+   * @return True if MC handler is found in a valid manager.  False if
+   * manager is not defined, or has no MC handler.
+   */
+  virtual Bool_t HasMCHandler() const 
+  {
+    AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
+    if (!mgr) return false;
+    return mgr->GetMCtruthEventHandler() != 0;
+  }
   /** 
    * Set the name of the train - should be name of the class.  Must be
    * overloaded.