]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliAnalysisTaskSE.cxx
Coverity: Concerned function ScanSingleNameArgument was actually not used anywhere...
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisTaskSE.cxx
index aef9b87b9580be350b718ddbccd6d1e63b7d5176..7f29edc1e4dde26fa73508981999feab1546db30 100644 (file)
@@ -360,6 +360,25 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
     if (handler && aodH) {
        fMCEvent = aodH->MCEvent();
        Bool_t merging = aodH->GetMergeEvents();
+      
+  // Do not analyze merged events if last embedded file has less events than normal event, 
+  // skip analysis after last embeded event 
+  if(merging){
+    if(aodH->GetReadEntry() + aodH->GetMergeOffset() >= aodH->GetTreeToMerge()->GetEntriesFast()){
+      //printf("Skip Entry %lld, Offset %d, Tree Entries %d\n",aodH->GetReadEntry(),aodH->GetMergeOffset(), aodH->GetTreeToMerge()->GetEntries());
+          
+      // Do I need to add the lines before the return?
+      // Added protection in case the derived task is not an AOD producer.
+      AliAnalysisDataSlot *out0 = GetOutputSlot(0);
+      if (out0 && out0->IsConnected()) PostData(0, fTreeA);    
+          
+      DisconnectMultiHandler();
+          
+      return;
+    }
+    //else   printf("MERGE Entry %lld, Offset %d, Tree Entries %d\n",aodH->GetReadEntry(),aodH->GetMergeOffset(), aodH->GetTreeToMerge()->GetEntries());
+  }
+      
        AliAODEvent* aod = dynamic_cast<AliAODEvent*>(InputEvent());
 
        if (aod && !(handler->IsStandard()) && !(handler->AODIsReplicated())) {