]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
AOD filling follows the new offline trigger schema. The method AliAODHandler::BeginEv...
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Jul 2010 14:37:29 +0000 (14:37 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Jul 2010 14:37:29 +0000 (14:37 +0000)
All filters must add to their UserExec mehod lines like:
  // Filters must explicitely enable AOD filling in their UserExec (AG)
  if (!AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()) AliFatal("Cannot run ESD filter without an output event handler");
  AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);

Note:
Changed the logic of AliAnalysisTaskSE::fOfflineTrigger for backward compatibility: if the task does not set it (stays 0) it means all events are selected. If the mask is non 0 it is AND-ed with the current event mask (as implemented with Jan-Fiete).
Again, if no event selection cuts object (like AliPhysicsSelection) is used at the level of the input handler, all events are now selected.

ANALYSIS/AliAnalysisTaskESDfilter.cxx
ANALYSIS/AliAnalysisTaskSE.cxx
STEER/AliAODHandler.h
STEER/AliVEventHandler.h

index d9534869c07cc6ee33c01e23b2d1699d7fab586c..45a1d01f6b9acb73cad1c76c3ec77bf41bd75395 100644 (file)
@@ -106,7 +106,10 @@ void AliAnalysisTaskESDfilter::UserExec(Option_t */*option*/)
       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
index 1b2314e94512a9996d055cd3da91254857f97f71..c8ca54a9cdcfd96e7d549c09863807c78c7b9827 100644 (file)
@@ -309,13 +309,16 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
 
     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();
@@ -494,10 +497,10 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
     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);
     }
     
index 80d2f842c1e20adc9810b3138f2cc376bf1a717c..bebd7dacbb0d4ba19ea58b51ab24477124aeda41 100644 (file)
@@ -33,7 +33,7 @@ class AliAODHandler : public AliVEventHandler {
     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();
index 1e4cab6309f67a9f1f104957017f959d9bdafbc1..24a44f1b7476a821c1f2dbea65af77fec793527e 100644 (file)
@@ -23,6 +23,7 @@ class AliVEventHandler : public TNamed {
     // 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;