]>
Commit | Line | Data |
---|---|---|
8020fb14 | 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 */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | #include "AliGenReader.h" | |
88cb7938 | 9 | #include "AliStack.h" |
10 | ||
8020fb14 | 11 | class TFile; |
8020fb14 | 12 | class AliHeader; |
88cb7938 | 13 | class AliRunLoader; |
14 | class TString; | |
15 | class TObjArray; | |
8020fb14 | 16 | |
17 | class AliGenReaderTreeK : public AliGenReader | |
18 | { | |
19 | public: | |
20 | AliGenReaderTreeK(); | |
add7d558 | 21 | AliGenReaderTreeK(const AliGenReaderTreeK &reader); |
ae872676 | 22 | virtual ~AliGenReaderTreeK(); |
8020fb14 | 23 | // Initialise |
24 | virtual void Init(); | |
25 | // Read | |
26 | virtual Int_t NextEvent(); | |
27 | virtual TParticle* NextParticle(); | |
d1d1da57 | 28 | virtual void RewindEvent(); |
88cb7938 | 29 | virtual void SetOnlyPrimaries(Bool_t flag){fOnlyPrimaries = flag;} |
de905919 | 30 | AliGenReaderTreeK & operator=(const AliGenReaderTreeK & rhs); |
88cb7938 | 31 | void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names |
32 | void AddDir(const char* dirname); | |
198bb1c7 | 33 | private: |
34 | void Copy(AliGenReaderTreeK&) const; | |
8020fb14 | 35 | protected: |
36 | Int_t fNcurrent; // points to the next entry | |
37 | Int_t fNparticle; // Next particle in list | |
38 | Int_t fNp; // number of particles | |
88cb7938 | 39 | AliRunLoader *fInRunLoader; //!Run Loader of the input event |
8020fb14 | 40 | TFile *fBaseFile; //! pointer to base file |
41 | AliStack *fStack; //! Particle stack | |
88cb7938 | 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 | |
46 | ||
47 | TString& GetDirName(Int_t entry); | |
48 | TParticle* GetParticle(Int_t i); | |
49 | ||
8020fb14 | 50 | ClassDef(AliGenReaderTreeK,1) // Read particles from TreeK |
51 | }; | |
88cb7938 | 52 | |
53 | inline | |
54 | TParticle* AliGenReaderTreeK::GetParticle(Int_t i) | |
55 | { | |
56 | if (fStack && i<fNp) return fStack->Particle(i); | |
57 | return 0x0; | |
58 | } | |
59 | ||
8020fb14 | 60 | #endif |
61 | ||
62 | ||
63 | ||
64 | ||
65 | ||
66 |