Fix for event mixing when running in local mode. Mix event inputhandler was calling...
authormvala <mvala@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Sep 2011 07:32:28 +0000 (07:32 +0000)
committermvala <mvala@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Sep 2011 07:32:28 +0000 (07:32 +0000)
ANALYSIS/EventMixing/AliMixInputEventHandler.cxx
ANALYSIS/EventMixing/AliMixInputHandlerInfo.cxx

index 761ce4e..0552fa6 100644 (file)
@@ -128,6 +128,8 @@ Bool_t AliMixInputEventHandler::Notify(const char *path)
    // Notify(const char*path) is called for all mix input handlers
    //
    AliDebug(AliLog::kDebug + 5, Form("<- %s", path));
+   
+   Bool_t firstRun=(fMixIntupHandlerInfoTmp->GetChain()->GetEntries()<=0);
    // adds current file
    fMixIntupHandlerInfoTmp->AddTreeToChain(path);
    Int_t lastIndex = fMixIntupHandlerInfoTmp->GetChain()->GetListOfFiles()->GetEntries();
@@ -136,7 +138,7 @@ Bool_t AliMixInputEventHandler::Notify(const char *path)
    for (Int_t i = 0; i < fInputHandlers.GetEntries(); i++) {
       AliDebug(AliLog::kDebug + 5, Form("fInputHandlers[%d]", i));
       mixIHI = new AliMixInputHandlerInfo(fMixIntupHandlerInfoTmp->GetName(), fMixIntupHandlerInfoTmp->GetTitle());
-      mixIHI->PrepareEntry(che, -1, (AliInputEventHandler*)InputEventHandler(i), fAnalysisType);
+      if (firstRun) mixIHI->PrepareEntry(che, -1, (AliInputEventHandler*)InputEventHandler(i), fAnalysisType);
       AliDebug(AliLog::kDebug + 5, Form("chain[%d]->GetEntries() = %lld", i, mixIHI->GetChain()->GetEntries()));
       fMixTrees.Add(mixIHI);
    }
index 32d0346..b99aebe 100644 (file)
@@ -131,6 +131,7 @@ void AliMixInputHandlerInfo::PrepareEntry(TChainElement *te, Long64_t entry, Ali
          fChain = new TChain(te->GetName());
          fChain->AddFile(te->GetTitle());
          fChain->GetEntry(0);
+        eh->Init(opt);
          eh->Init(fChain->GetTree(), opt);
       }
       fNeedNotify = kTRUE;
@@ -148,6 +149,7 @@ void AliMixInputHandlerInfo::PrepareEntry(TChainElement *te, Long64_t entry, Ali
          fChain = new TChain(te->GetName());
          fChain->AddFile(te->GetTitle());
          fChain->GetEntry(0);
+        eh->Init(opt);
          eh->Init(fChain->GetTree(), opt);
          eh->Notify(te->GetTitle());
          fChain->GetEntry(entry);