fTreeA(0x0),
fCurrentRunNumber(-1),
fHistosQA(0x0),
- fSelectCollisions(0)
+ fOfflineTriggerMask(0)
{
// Default constructor
}
fTreeA(0x0),
fCurrentRunNumber(-1),
fHistosQA(0x0),
- fSelectCollisions(0)
+ fOfflineTriggerMask(0)
{
// Default constructor
DefineInput (0, TChain::Class());
fTreeA(0x0),
fCurrentRunNumber(-1),
fHistosQA(0x0),
- fSelectCollisions(0)
+ fOfflineTriggerMask(0)
{
// Copy constructor
fDebug = obj.fDebug;
fTreeA = other.fTreeA;
fCurrentRunNumber = other.fCurrentRunNumber;
fHistosQA = other.fHistosQA;
- fSelectCollisions = other.fSelectCollisions;
+ fOfflineTriggerMask = other.fOfflineTriggerMask;
return *this;
}
// Default AOD
if (fDebug > 1) printf("AnalysisTaskSE::CreateOutPutData() \n");
- AliAODHandler* handler = (AliAODHandler*)
+ AliAODHandler* handler = dynamic_cast<AliAODHandler*>
((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
Bool_t merging = kFALSE;
// cache the pointerd in the AODEvent
fOutputAOD->GetStdContent();
}
- } else {
- AliWarning("No AOD Event Handler connected.") ;
}
UserCreateOutputObjects();
}
{
//
// Exec analysis of one event
- fDebug = 10;
- printf("Task is active %5d\n", IsActive());
+ if ( fDebug >= 10)
+ printf("Task is active %5d\n", IsActive());
if (fDebug > 1) AliInfo("AliAnalysisTaskSE::Exec() \n");
//
- AliAODHandler* handler = (AliAODHandler*)
+ AliAODHandler* handler = dynamic_cast<AliAODHandler*>
((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
+
AliAODInputHandler* aodH = dynamic_cast<AliAODInputHandler*>(fInputHandler);
//
-// Was event selected ?
- Bool_t isSelected = kTRUE;
- if( fInputHandler && fInputHandler->GetEventSelection() && fSelectCollisions) {
- isSelected = fInputHandler->IsEventSelected();
+// 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 and AND it with the
+ // requested mask. If no mask requested select by default the event.
+ if (fOfflineTriggerMask)
+ isSelected = fOfflineTriggerMask & fInputHandler->IsEventSelected();
}
+// Functionality below moved in the filter tasks (AG)
+// if (handler) handler->SetFillAOD(isSelected);
- if (handler) handler->SetFillAOD(isSelected);
-
- if( fInputHandler ) fEntry = fInputHandler->GetReadEntry();
-
+ if( fInputHandler ) {
+ fEntry = fInputHandler->GetReadEntry();
+ fESDfriend = ((AliESDInputHandler*)fInputHandler)->GetESDfriend();
+ }
+
// Notify the change of run number
- if (InputEvent()->GetRunNumber() != fCurrentRunNumber) {
+ if (InputEvent() && (InputEvent()->GetRunNumber() != fCurrentRunNumber)) {
fCurrentRunNumber = InputEvent()->GetRunNumber();
NotifyRun();
}
}
// Call the user analysis
- if (!fSelectCollisions || isSelected)
- UserExec(option);
+ AliMCEventHandler* mcH = 0;
+ mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
+
+ if (!mcH) {
+ if (isSelected)
+ UserExec(option);
+ } else {
+ if (isSelected && (mcH->InitOk()))
+ UserExec(option);
+ }
// Added protection in case the derived task is not an AOD producer.
AliAnalysisDataSlot *out0 = GetOutputSlot(0);
void AliAnalysisTaskSE::AddAODBranch(const char* cname, void* addobj, const char *fname)
{
// Add a new branch to the aod tree
- AliAODHandler* handler = (AliAODHandler*)
+ AliAODHandler* handler = dynamic_cast<AliAODHandler*>
((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
if (handler) {
handler->AddBranch(cname, addobj, fname);
{
// Check if the output AOD handler is configured for standard or delta AOD.
// Users should first check that AODEvent() returns non-null.
- AliAODHandler* handler = (AliAODHandler*)
+ AliAODHandler* handler = dynamic_cast<AliAODHandler*>
((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
if (!handler) {
Error("IsStandardAOD", "No AOD handler. Please use AODEvent() to check this first");