From 325a20c45e344b1d35058af075393a3afc9d32d4 Mon Sep 17 00:00:00 2001 From: morsch Date: Mon, 7 Jul 2008 13:52:37 +0000 Subject: [PATCH] Give back a clone of the original chain. --- ANALYSIS/AliEventPoolLoop.cxx | 31 +++++++++++++++++++++++++++---- ANALYSIS/AliEventPoolLoop.h | 2 ++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ANALYSIS/AliEventPoolLoop.cxx b/ANALYSIS/AliEventPoolLoop.cxx index f16128b59fc..dd3dc78eb01 100644 --- a/ANALYSIS/AliEventPoolLoop.cxx +++ b/ANALYSIS/AliEventPoolLoop.cxx @@ -24,6 +24,9 @@ #include "AliEventPoolLoop.h" +#include +#include +#include ClassImp(AliEventPoolLoop) @@ -33,7 +36,8 @@ ClassImp(AliEventPoolLoop) AliEventPoolLoop::AliEventPoolLoop(): AliVEventPool(), fMaxIterations(0), - fNIteration(0) + fNIteration(0), + fChainClone(0) { // Default constructor } @@ -41,7 +45,8 @@ AliEventPoolLoop::AliEventPoolLoop(): AliEventPoolLoop::AliEventPoolLoop(Int_t nit): AliVEventPool(), fMaxIterations(nit), - fNIteration(0) + fNIteration(0), + fChainClone(0) { // Default constructor } @@ -49,7 +54,8 @@ AliEventPoolLoop::AliEventPoolLoop(Int_t nit): AliEventPoolLoop::AliEventPoolLoop(const char* name, const char* title): AliVEventPool(name, title), fMaxIterations(0), - fNIteration(0) + fNIteration(0), + fChainClone(0) { // Constructor } @@ -88,7 +94,24 @@ TChain* AliEventPoolLoop::GetNextChain() return (0); } else { fNIteration++; - return fChain; + /* + if (fChainClone) { + fChainClone->Reset(); + new (fChainClone) TChain(fChain->GetName()); + } else { + fChainClone = new TChain(fChain->GetName()); + } + TObjArray* files = fChain->GetListOfFiles(); + Int_t n = files->GetEntriesFast(); + for (Int_t i = 0; i < n; i++) { + TFile* file = (TFile*) (files->At(i)); + fChainClone->AddFile(file->GetTitle()); + printf("Adding %s %s %s\n", fChainClone->GetName(), file->GetName(), file->GetTitle()); + + } + */ + fChainClone = (TChain*) (fChain->Clone()); + return fChainClone; } } diff --git a/ANALYSIS/AliEventPoolLoop.h b/ANALYSIS/AliEventPoolLoop.h index 6d21d4d75a5..87ce186c3f1 100644 --- a/ANALYSIS/AliEventPoolLoop.h +++ b/ANALYSIS/AliEventPoolLoop.h @@ -18,6 +18,7 @@ class AliLHCTagCuts; class AliDetectorTagCuts; class AliEventTagCuts; class AliTagAnalysis; +class TChain; class AliEventPoolLoop : public AliVEventPool { @@ -38,6 +39,7 @@ class AliEventPoolLoop : public AliVEventPool protected: Int_t fMaxIterations; Int_t fNIteration; + TChain* fChainClone; // Clone of the original ClassDef(AliEventPoolLoop, 0); }; -- 2.39.3