]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenReaderTreeK.h
Code causing warning messages corrected.
[u/mrichter/AliRoot.git] / EVGEN / AliGenReaderTreeK.h
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"
9 #include "AliStack.h"
10
11 class TFile;
12 class AliHeader;
13 class AliRunLoader;
14 class TString;
15 class TObjArray;
16
17 class AliGenReaderTreeK : public AliGenReader
18 {
19  public:
20     AliGenReaderTreeK();
21     AliGenReaderTreeK(const AliGenReaderTreeK &reader);
22     virtual ~AliGenReaderTreeK();
23     // Initialise 
24     virtual void Init();
25     // Read
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);
33  private:
34     void Copy(AliGenReaderTreeK&) const;
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
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
46     
47     TString&   GetDirName(Int_t entry);
48     TParticle* GetParticle(Int_t i);
49     
50     ClassDef(AliGenReaderTreeK,1) // Read particles from TreeK
51 };
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
60 #endif
61
62
63
64
65
66