#include "AliAnalysisTaskME.h"
#include "AliAnalysisManager.h"
#include "AliAODEvent.h"
+#include "AliVEvent.h"
#include "AliAODHandler.h"
-#include "AliMultiAODInputHandler.h"
+#include "AliMultiEventInputHandler.h"
#include "AliLog.h"
//
// Multi AOD
//
- fInputHandler = dynamic_cast<AliMultiAODInputHandler*>
+ fInputHandler = dynamic_cast<AliMultiEventInputHandler*>
((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
- if (fInputHandler == 0)
- AliFatal("Event Handler has to be MultiAODHandler !");
+ if (fInputHandler == 0) {
+ AliFatal("Event Handler has to be MultiEventInputHandler !");
+ } else {
+ // Check that we have an event pool
+ if (!fInputHandler->GetEventPool()) {
+ fInputHandler->SetEventPool(AliAnalysisManager::GetAnalysisManager()->GetEventPool());
+ if (!fInputHandler->GetEventPool())
+ AliFatal("MultiEventInputHandler has no EventPool connected !");
+ }
+ }
}
void AliAnalysisTaskME::CreateOutputObjects()
fEntry = fInputHandler->GetReadEntry();
if ( !((Entry()-1)%100) && fDebug > 0)
AliInfo(Form("%s ----> Processing event # %lld", CurrentFileName(), Entry()));
-
+
+ AliAODHandler* outputHandler = (AliAODHandler*)
+ ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
// Call the user analysis
if (fInputHandler->IsBufferReady()) {
if ((fFreshBufferOnly && fInputHandler->IsFreshBuffer()) || !fFreshBufferOnly)
{
+ if (outputHandler) outputHandler->SetFillAOD(kTRUE);
UserExec(option);
PostData(0, fTreeA);
+ } else {
+ if (outputHandler) outputHandler->SetFillAOD(kFALSE);
}
} else {
AliInfo(Form("Waiting for buffer to be ready !\n"));
}
}
-AliAODEvent* AliAnalysisTaskME::GetEvent(Int_t iev)
+AliVEvent* AliAnalysisTaskME::GetEvent(Int_t iev)
{
// Get an event from the input handler
return (fInputHandler->GetEvent(iev));