if (fHighPthreshold == 0) AliInfo("detector PID signals are stored in each track");\r
if (!fPtshape) AliInfo("detector PID signals are not stored below the pt threshold");\r
}\r
- \r
+ // Filters must explicitely enable AOD filling in their UserExec (AG)\r
+ if (!AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()) AliFatal("Cannot run ESD filter without an output event handler");\r
+ AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);\r
+\r
ConvertESDtoAOD();\r
}\r
\r
AliAODInputHandler* aodH = dynamic_cast<AliAODInputHandler*>(fInputHandler);
//
-// Was event selected ?
- UInt_t isSelected = 0;
- if( fInputHandler && fInputHandler->GetEventSelection() && fOfflineTriggerMask) {
- isSelected = fInputHandler->IsEventSelected() & fOfflineTriggerMask;
+// Was event selected ? If no event selection mechanism, the event SHOULD be selected (AG)
+ UInt_t isSelected = AliVEvent::kAny;
+ if( fInputHandler && fInputHandler->GetEventSelection()) {
+ // Get the actual offline trigger mask for the event
+ isSelected = fInputHandler->IsEventSelected();
+ // If the task had a selection AND it with the event mask (i.e. event interesting for the task if at least one matching trigger)
+ if (fOfflineTriggerMask) isSelected &= fOfflineTriggerMask;
}
-
- if (handler) handler->SetFillAOD(isSelected);
+// Functionality below moved in the filter tasks (AG)
+// if (handler) handler->SetFillAOD(isSelected);
if( fInputHandler ) {
fEntry = fInputHandler->GetReadEntry();
mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
if (!mcH) {
- if (!fOfflineTriggerMask || isSelected)
+ if (isSelected)
UserExec(option);
} else {
- if ((!fOfflineTriggerMask || isSelected) && (mcH->InitOk()))
+ if (isSelected && (mcH->InitOk()))
UserExec(option);
}
virtual const char* GetOutputFileName();
virtual Bool_t Init(Option_t* option);
virtual Bool_t Init(TTree* /*tree*/, Option_t* /*option*/) {return kTRUE;}
- virtual Bool_t BeginEvent(Long64_t /*entry*/) {return kTRUE;}
+ virtual Bool_t BeginEvent(Long64_t /*entry*/) {fFillAOD=kFALSE; return kTRUE;}
virtual Bool_t Notify() { return AliVEventHandler::Notify(); };
virtual Bool_t Notify(const char * /* path */) {return kTRUE;}
virtual Bool_t FinishEvent();
// Handled tree
virtual TTree *GetTree() const { return NULL; }
virtual Option_t *GetDataType() const { return NULL; }
+ virtual void SetFillAOD(Bool_t) {}
// Output
virtual void SetOutputFileName(const char* fname) = 0;
virtual const char* GetOutputFileName() = 0;