]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenReader.h
Made more robust
[u/mrichter/AliRoot.git] / EVGEN / AliGenReader.h
1 #ifndef ALIGENREADER_H
2 #define ALIGENREADER_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 // Interface for reading events from files.
9 // Realisations of this interface have to be used with AliGenExFile.
10 // Author: andreas.morsch@cern.ch
11
12 #include "TObject.h"
13
14 class TParticle;
15
16 class AliGenReader : public TObject
17 {
18  public:
19     AliGenReader():fFileName(NULL),fCode(kPDG){;}
20     AliGenReader(const AliGenReader &reader)
21         :TObject(reader), fFileName(NULL), fCode(kPDG){reader.Copy(*this);}
22     virtual ~AliGenReader(){;}
23     virtual void SetFileName(const Text_t *filname) {fFileName=filname;}
24     virtual void Init()                                                    = 0;
25     virtual Int_t NextEvent()                                              = 0;
26     virtual TParticle* NextParticle()                                      = 0;
27     virtual void RewindEvent()                                             = 0;
28     typedef enum {kPDG, kGEANT3} Code_t;
29     void SetParticleCode(Code_t code) {fCode = code;}
30     AliGenReader & operator=(const AliGenReader & rhs);
31
32  protected:
33     const Text_t *fFileName;      // Name of file to read from
34     Code_t        fCode;          // Particle code type
35  private:
36     void Copy(TObject&) const;
37     
38     ClassDef(AliGenReader,1) //Generate particles from external file
39 };
40 #endif
41
42
43
44
45
46