Initialization of the MC event fMC moved in UserExec as required now by the framework
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Jul 2013 09:39:21 +0000 (09:39 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Jul 2013 09:39:21 +0000 (09:39 +0000)
PWGPP/HMPID/AliHMPIDTaskQA.cxx

index 148effd..da1d098 100644 (file)
@@ -222,9 +222,7 @@ void AliHMPIDTaskQA::ConnectInputData(Option_t *option)
     if (!mcH) {
       AliDebug(2,Form("ERROR: Could not get MCEventHandler"));
       fUseMC = kFALSE;
-    } else
-      fMC = mcH->MCEvent();
-      if (!fMC) AliDebug(2,Form("ERROR: Could not get MCEvent"));
+    }
   }
 }
 
@@ -240,6 +238,8 @@ void AliHMPIDTaskQA::UserExec(Option_t *)
   AliStack* pStack = 0;
   Int_t label = -1;
   if (fUseMC){
+    AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+    fMC = mcH->MCEvent();
     pStack = fMC->Stack();
   }