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 // Realisation of AliGenReader to be used with AliGenExtFile
9 // It reads events from a kinematics TreeK.
10 // Author: andreas.morsch@cern.ch
12 #include "AliGenReader.h"
21 class AliGenReaderTreeK : public AliGenReader
25 AliGenReaderTreeK(const AliGenReaderTreeK &reader);
26 virtual ~AliGenReaderTreeK();
30 virtual Int_t NextEvent();
31 virtual TParticle* NextParticle();
32 virtual void RewindEvent();
33 virtual void SetOnlyPrimaries(Bool_t flag){fOnlyPrimaries = flag;}
34 AliGenReaderTreeK & operator=(const AliGenReaderTreeK & rhs);
35 void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names
36 void AddDir(const char* dirname);
37 AliRunLoader * GetRunLoader() const {return fInRunLoader;}
40 Int_t fNcurrent; // points to the next entry
41 Int_t fNparticle; // Next particle in list
42 Int_t fNp; // number of particles
43 AliRunLoader *fInRunLoader; //!Run Loader of the input event
44 TFile *fBaseFile; //! pointer to base file
45 AliStack *fStack; //! Particle stack
46 Bool_t fOnlyPrimaries; // Flag indicating wether only primaries are read
47 TObjArray *fDirs; //arry with directories to read data from
48 Int_t fCurrentDir; //Number of current directory
49 static const TString fgkEventFolderName;//!name of folder where event to read is mounted
51 TString& GetDirName(Int_t entry);
52 TParticle* GetParticle(Int_t i);
54 void Copy(TObject&) const;
55 ClassDef(AliGenReaderTreeK,1) // Read particles from TreeK
59 TParticle* AliGenReaderTreeK::GetParticle(Int_t i)
61 if (fStack && i<fNp) return fStack->Particle(i);