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)
72 AliEventPoolLoop& AliEventPoolLoop::operator=(const AliEventPoolLoop& other)
74 // Assignment operator
75 AliVEventPool::operator=(other);
76 fMaxIterations = other.fMaxIterations;
77 fNIteration = other.fNIteration;
82 void AliEventPoolLoop::Init()
90 TChain* AliEventPoolLoop::GetNextChain()
93 if (fNIteration >= fMaxIterations) {
100 new (fChainClone) TChain(fChain->GetName());
102 fChainClone = new TChain(fChain->GetName());
104 TObjArray* files = fChain->GetListOfFiles();
105 Int_t n = files->GetEntriesFast();
106 for (Int_t i = 0; i < n; i++) {
107 TFile* file = (TFile*) (files->At(i));
108 fChainClone->AddFile(file->GetTitle());
109 printf("Adding %s %s %s\n", fChainClone->GetName(), file->GetName(), file->GetTitle());
113 fChainClone = (TChain*) (fChain->Clone());
118 void AliEventPoolLoop::GetCurrentBin(Float_t* /*bin*/)
123 Int_t AliEventPoolLoop::GetDimension()