From: slindal Date: Tue, 3 May 2011 09:36:55 +0000 (+0000) Subject: Updating AOD filter X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=f0f3d4a141a46cdad6914f336bb0586bb7a229b0;p=u%2Fmrichter%2FAliRoot.git Updating AOD filter --- diff --git a/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx b/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx index 8f9ffbd1735..ef79eef1e8e 100644 --- a/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx +++ b/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx @@ -47,6 +47,7 @@ #include "AliTriggerAnalysis.h" #include "AliCentrality.h" #include "AliMultiplicity.h" +#include "AliAODHandler.h" class AliESDTrackCuts; class AliCFContainer; @@ -417,11 +418,6 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/) } } - //Must set fForceAOD to true for the AOD to get filled. Should only be done when running independent chain / train. - if(fKFForceAOD) { - if (!AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()) AliFatal("Cannot run ESD filter without an output event handler"); - AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE); - } // if(fV0Reader == NULL){ // coverty does not permit this test // Write warning here cuts and so on are default if this ever happens @@ -787,6 +783,30 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/) } } + + //Must set fForceAOD to true for the AOD to get filled. (Unless called by other task) + if(fKFForceAOD) { + if (!AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()) { + AliFatal("Cannot run ESD filter without an output event handler"); + + } else { + if(fAODGamma && fAODGamma->GetEntriesFast() > 0) { + AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE); + AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillExtension(kTRUE); + } + } + + } + + ///Make sure delta aod is filled if standard aod is filled (for synchronization when reading aod with standard aod) + if(fKFCreateAOD) { + AliAODHandler * aodhandler = dynamic_cast(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()); + if (aodhandler && aodhandler->GetFillAOD()) { + AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillExtension(kTRUE); + } + } + + //Clear the data in the v0Reader fV0Reader->UpdateEventByEventData(); if(fRecalculateV0ForGamma==kTRUE){