#include "AliLog.h"
-ClassImp(AliAnalysisTaskME)
+ClassImp(AliAnalysisTaskME);
////////////////////////////////////////////////////////////////////////
fFreshBufferOnly(kFALSE),
fInputHandler(0x0),
fOutputAOD(0x0),
- fTreeA(0x0)
+ fTreeA(0x0),
+ fOfflineTriggerMask(0)
{
// Default constructor
}
fFreshBufferOnly(kFALSE),
fInputHandler(0x0),
fOutputAOD(0x0),
- fTreeA(0x0)
+ fTreeA(0x0),
+ fOfflineTriggerMask(0)
{
// Default constructor
DefineInput (0, TChain::Class());
fFreshBufferOnly(kFALSE),
fInputHandler(0x0),
fOutputAOD(0x0),
- fTreeA(0x0)
+ fTreeA(0x0),
+ fOfflineTriggerMask(0)
{
// Copy constructor
fDebug = obj.fDebug;
fEntry = obj.fEntry;
fInputHandler = obj.fInputHandler;
fOutputAOD = obj.fOutputAOD;
- fTreeA = obj.fTreeA;
+ fTreeA = obj.fTreeA;
+ fOfflineTriggerMask = obj.fOfflineTriggerMask;
}
fInputHandler = other.fInputHandler;
fOutputAOD = other.fOutputAOD;
fTreeA = other.fTreeA;
+ fOfflineTriggerMask = other.fOfflineTriggerMask;
return *this;
}
AliAODHandler* outputHandler = (AliAODHandler*)
((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
+//
+// 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();
+ }
+ if (!isSelected) {
+ if (fDebug > 1) AliInfo("Event rejected \n");
+ fInputHandler->EventSkipped();
+ return;
+ }
// Call the user analysis
+
if (fInputHandler->IsBufferReady()) {
if ((fFreshBufferOnly && fInputHandler->IsFreshBuffer()) || !fFreshBufferOnly)
{
/* $Id$ */
#include "AliAnalysisTask.h"
-class AliVEvent;
+#include "AliVEvent.h"
class AliAODEvent;
class AliInputEventHandler;
class TTree;
virtual void UserExec(Option_t* /*option*/) {;}
// Helpers for adding branches to the AOD
virtual void AddAODBranch(const char* cname, void* addobj, const char *fname="");
+ virtual void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB) {fOfflineTriggerMask = offlineTriggerMask;}
// Getters
virtual Int_t DebugLevel() {return fDebug; }
virtual AliVEvent* GetEvent(Int_t iev);
AliMultiEventInputHandler* fInputHandler; //! Input Handler
AliAODEvent* fOutputAOD; //! AOD out
TTree* fTreeA; // AOD output Tree
+ // Event Selection
+ UInt_t fOfflineTriggerMask; // Task processes collision candidates only
+
ClassDef(AliAnalysisTaskME, 1); // Analysis task for standard jet analysis
};
#include "AliAODEvent.h"
#include "AliESDEvent.h"
#include "AliVEventPool.h"
+#include "AliVCuts.h"
#include "AliLog.h"
#include <TObjArray.h>
#include <TTree.h>
fCurrentEvt(0),
fInit(0),
fEventPool(0),
- fEventBuffer(0)
+ fEventBuffer(0),
+ fEventSkipped(0)
{
// Default constructor
}
fCurrentEvt(0),
fInit(0),
fEventPool(0),
- fEventBuffer(0)
+ fEventBuffer(0),
+ fEventSkipped(0)
{
// constructor
}
fCurrentEvt(0),
fInit(0),
fEventPool(0),
- fEventBuffer(0)
+ fEventBuffer(0),
+ fEventSkipped(0)
{
// Constructor
fCurrentBin = fEventPool->BinNumber();
fNBuffered = 0;
}
+ //
+ // Event selection
+ //
+ if (fFormat == 0) {
+ fIsSelectedResult = 0;
+ if (fEventCuts && !IsUserCallSelectionMask())
+ fIsSelectedResult =
+ fEventCuts->GetSelectionMask((AliESDEvent*)fEventBuffer[fIndex]);
+ }
+
return kTRUE;
}
{
//
// Connect the next event in the buffer to the tree
- fIndex++;
-
+ if (!fEventSkipped) fIndex++;
fIndex %= fBufferSize;
+
AliInfo(Form("Connecting buffer entry %5d", fIndex));
fEventBuffer[fIndex]->Clear();
fCurrentEvt++;
virtual AliVEvent *GetEvent(Int_t iev) const;
AliVEvent *GetLatestEvent() const {return fEventBuffer[fIndex];}
Int_t GetFormat() { return fFormat ;}
+ void EventSkipped() {fEventSkipped = kTRUE;}
// From the interface
virtual Bool_t Init(Option_t* /*opt*/) {return kTRUE;}
virtual Bool_t Init(TTree* tree, Option_t* /*opt*/);
Bool_t fInit; // Current event
AliVEventPool* fEventPool; // Pointer to the pool
AliVEvent** fEventBuffer; //! The event buffer
+ Bool_t fEventSkipped; // User requires event to be skip
ClassDef(AliMultiEventInputHandler, 1);
};