Transition to NewIO
[u/mrichter/AliRoot.git] / EVGEN / AliGenReaderTreeK.h
CommitLineData
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 11class TFile;
8020fb14 12class AliHeader;
88cb7938 13class AliRunLoader;
14class TString;
15class TObjArray;
8020fb14 16
17class 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);
8020fb14 33 protected:
34 Int_t fNcurrent; // points to the next entry
35 Int_t fNparticle; // Next particle in list
36 Int_t fNp; // number of particles
88cb7938 37 AliRunLoader *fInRunLoader; //!Run Loader of the input event
8020fb14 38 TFile *fBaseFile; //! pointer to base file
39 AliStack *fStack; //! Particle stack
88cb7938 40 Bool_t fOnlyPrimaries; // Flag indicating wether only primaries are read
41 TObjArray *fDirs; //arry with directories to read data from
42 Int_t fCurrentDir; //Number of current directory
43 static const TString fgkEventFolderName;//!name of folder where event to read is mounted
44
45 TString& GetDirName(Int_t entry);
46 TParticle* GetParticle(Int_t i);
47
8020fb14 48 ClassDef(AliGenReaderTreeK,1) // Read particles from TreeK
49};
88cb7938 50
51inline
52TParticle* AliGenReaderTreeK::GetParticle(Int_t i)
53 {
54 if (fStack && i<fNp) return fStack->Particle(i);
55 return 0x0;
56 }
57
8020fb14 58#endif
59
60
61
62
63
64