1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
19 // Realisation of an AliVEventPool which allows the user to
20 // run the analysis in a loop, i.e. passing several times over
21 // the same event chain.
22 // Author Andreas Morsch
23 // andreas.morsch@cern.ch
26 #include "AliEventPoolLoop.h"
29 #include <TObjArray.h>
31 ClassImp(AliEventPoolLoop)
34 ////////////////////////////////////////////////////////////////////////
36 AliEventPoolLoop::AliEventPoolLoop():
42 // Default constructor
45 AliEventPoolLoop::AliEventPoolLoop(Int_t nit):
51 // Default constructor
54 AliEventPoolLoop::AliEventPoolLoop(const char* name, const char* title):
55 AliVEventPool(name, title),
64 AliEventPoolLoop::AliEventPoolLoop(const AliEventPoolLoop& obj):
66 fMaxIterations(obj.fMaxIterations),
67 fNIteration(obj.fNIteration),
73 AliEventPoolLoop& AliEventPoolLoop::operator=(const AliEventPoolLoop& other)
75 // Assignment operator
76 AliVEventPool::operator=(other);
77 fMaxIterations = other.fMaxIterations;
78 fNIteration = other.fNIteration;
83 void AliEventPoolLoop::Init()
91 TChain* AliEventPoolLoop::GetNextChain()
94 if (fNIteration >= fMaxIterations) {
100 fChainClone->Reset();
101 new (fChainClone) TChain(fChain->GetName());
103 fChainClone = new TChain(fChain->GetName());
105 TObjArray* files = fChain->GetListOfFiles();
106 Int_t n = files->GetEntriesFast();
107 for (Int_t i = 0; i < n; i++) {
108 TFile* file = (TFile*) (files->At(i));
109 fChainClone->AddFile(file->GetTitle());
110 printf("Adding %s %s %s\n", fChainClone->GetName(), file->GetName(), file->GetTitle());
114 fChainClone = (TChain*) (fChain->Clone());
119 void AliEventPoolLoop::GetCurrentBin(Float_t* /*bin*/)
124 Int_t AliEventPoolLoop::GetDimension()