From 340c93eaadd7d419070809d9ba988de9e507bd72 Mon Sep 17 00:00:00 2001 From: cholm Date: Wed, 9 Oct 2013 07:06:52 +0000 Subject: [PATCH] Added user-callable check if we have an MC input handler --- PWGLF/FORWARD/trains/TrainSetup.C | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/PWGLF/FORWARD/trains/TrainSetup.C b/PWGLF/FORWARD/trains/TrainSetup.C index cec7c270f22..cdbf3e7e75c 100644 --- a/PWGLF/FORWARD/trains/TrainSetup.C +++ b/PWGLF/FORWARD/trains/TrainSetup.C @@ -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. -- 2.43.0