1 #ifndef ALIGENREADERTreeK_H
2 #define ALIGENREADERTREEK_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 #include "AliGenReader.h"
17 class AliGenReaderTreeK : public AliGenReader
21 AliGenReaderTreeK(const AliGenReaderTreeK &reader);
22 virtual ~AliGenReaderTreeK();
26 virtual Int_t NextEvent();
27 virtual TParticle* NextParticle();
28 virtual void RewindEvent();
29 virtual void SetOnlyPrimaries(Bool_t flag){fOnlyPrimaries = flag;}
30 AliGenReaderTreeK & operator=(const AliGenReaderTreeK & rhs);
31 void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names
32 void AddDir(const char* dirname);
34 void Copy(AliGenReaderTreeK&) const;
36 Int_t fNcurrent; // points to the next entry
37 Int_t fNparticle; // Next particle in list
38 Int_t fNp; // number of particles
39 AliRunLoader *fInRunLoader; //!Run Loader of the input event
40 TFile *fBaseFile; //! pointer to base file
41 AliStack *fStack; //! Particle stack
42 Bool_t fOnlyPrimaries; // Flag indicating wether only primaries are read
43 TObjArray *fDirs; //arry with directories to read data from
44 Int_t fCurrentDir; //Number of current directory
45 static const TString fgkEventFolderName;//!name of folder where event to read is mounted
47 TString& GetDirName(Int_t entry);
48 TParticle* GetParticle(Int_t i);
50 ClassDef(AliGenReaderTreeK,1) // Read particles from TreeK
54 TParticle* AliGenReaderTreeK::GetParticle(Int_t i)
56 if (fStack && i<fNp) return fStack->Particle(i);