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();
}
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() && (InputEvent()->GetRunNumber() != fCurrentRunNumber)) {
TClonesArray& dimuons = *fgAODDimuons;
TClonesArray& tracksnew = *fgAODTracks;
- Int_t nMuonTrack[10];
- for(Int_t imuon = 0; imuon < 10; imuon++) nMuonTrack[imuon] = 0;
+ Int_t nMuonTrack[100];
+ for(Int_t imuon = 0; imuon < 100; imuon++) nMuonTrack[imuon] = 0;
Int_t nMuons=0;
for(Int_t ii=0; ii < fgAODTracks->GetEntries(); ii++){
AliAODTrack *track = (AliAODTrack*) fgAODTracks->At(ii);
}
// 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");
return (UserNotify());
}
+const AliEventTag *AliAnalysisTaskSE::EventTag() const
+{
+// Returns tag for the current event, if any. The return value should always be checked by the user.
+ if (!fInputHandler) {
+ Error("EventTag", "Input handler not yet available. Call this in UserExec");
+ return NULL;
+ }
+ return fInputHandler->GetEventTag();
+}
+void AliAnalysisTaskSE::LoadBranches() const
+{
+// Load all branches declared in fBranchNames data member of the parent class.
+// Should be called in UserExec.
+ if (!fInputHandler) {
+ Error("LoadBranches", "Input handler not available yet. Call this in UserExec");
+ return;
+ }
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (mgr->GetAutoBranchLoading()) return;
+ TString taskbranches;
+ GetBranches(fInputHandler->GetDataType(), taskbranches);
+ if (taskbranches.IsNull()) return;
+ TObjArray *arr = taskbranches.Tokenize(",");
+ TIter next(arr);
+ TObject *obj;
+ while ((obj=next())) mgr->LoadBranch(obj->GetName());
+}