Updates on AOD merging.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 May 2011 10:20:07 +0000 (10:20 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 May 2011 10:20:07 +0000 (10:20 +0000)
Gustavo Conesa

STEER/AliAODInputHandler.cxx

index 5e01f86..4416bab 100644 (file)
@@ -127,8 +127,11 @@ Bool_t AliAODInputHandler::BeginEvent(Long64_t entry)
     // Begin event
     TClonesArray* mcParticles = (TClonesArray*) (fEvent->FindListObject("mcparticles"));
     if (mcParticles) fMCEvent->SetParticleArray(mcParticles);
-    if (fTreeToMerge) fTreeToMerge->GetEntry(entry + fMergeOffset);
-    
+
+    // When merging, get current event number from GetReadEntry(), 
+    // entry gives the events in the current file
+    if (fTreeToMerge) fTreeToMerge->GetEntry(GetReadEntry() + fMergeOffset);
+  
     fIsSelectedResult = fEvent->GetHeader()->GetOfflineTrigger();
 
     if (fMixingHandler) fMixingHandler->BeginEvent(entry);