]> git.uio.no Git - u/mrichter/AliRoot.git/commit - STEER/AliAODHandler.cxx
Added possibility to stream selected AOD events to a different AOD file. To do this...
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Nov 2009 16:25:48 +0000 (16:25 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Nov 2009 16:25:48 +0000 (16:25 +0000)
commit582cfeb58a46c1373aeb387e1f4ed1a3f8a8978b
tree2f93cdabf1fbc5dd099c69a7ecb74ab7dc436797
parent3907f08004d617416efc5c70320e470398d9fba6
Added possibility to stream selected AOD events to a different AOD file. To do this inside a task:
1. Make sure an AOD handler is connected to the current analysis manager before creating the task.

2. Add in the task constructor or in LocalInit():

  AliAODHandler *aodH = (AliAODHandler*)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
  if (!aodH) Fatal("UserCreateOutputObjects", "No AOD handler. Aborting.");
  aodH->AddFilteredAOD("AliAOD.Muons.root", "MuonEvents"); // for example

The pointer to the extension should not be backed-up upon adding the AOD extension, but this can be done in CreateOutputObjects()

3. Check the selection criteria in UserExec(). If fulfilled, select the event:
    AliAODExtension *extMuons = aodH->GetFilteredAOD("AliAOD.Muons.root");
    extMuons->SelectEvent();

That is all.
STEER/AliAODHandler.cxx
STEER/AliAODHandler.h