]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIHBTREADER_H | |
2 | #define ALIHBTREADER_H | |
3 | ||
4 | #include <TNamed.h> | |
5 | #include <TObjArray.h> | |
6 | ||
7 | //Reader Base class (reads particles and tracks and | |
8 | //puts it to the AliHBTRun objects | |
9 | //Piotr.Skowronski@cern.ch | |
10 | ||
11 | class AliHBTRun; | |
12 | class AliHBTEvent; | |
13 | class AliHBTParticleCut; | |
14 | class AliHBTParticle; | |
15 | class TString; | |
16 | ||
17 | class AliHBTReader: public TNamed | |
18 | { | |
19 | public: | |
20 | AliHBTReader(); | |
21 | AliHBTReader(TObjArray*); | |
22 | virtual ~AliHBTReader(); | |
23 | ||
24 | virtual Int_t Next(); | |
25 | virtual void Rewind() = 0; | |
26 | ||
27 | virtual Bool_t ReadsTracks() const = 0; | |
28 | virtual Bool_t ReadsParticles() const = 0; | |
29 | ||
30 | void AddParticleCut(AliHBTParticleCut* cut); | |
31 | ||
32 | virtual Int_t Read(AliHBTRun* particles, AliHBTRun *tracks); | |
33 | ||
34 | virtual AliHBTEvent* GetParticleEvent() {return fParticlesEvent;}//can not be const because position randomizer overloads it | |
35 | virtual AliHBTEvent* GetTrackEvent() {return fTracksEvent;}// | |
36 | ||
37 | virtual AliHBTEvent* GetParticleEvent(Int_t); | |
38 | virtual AliHBTEvent* GetTrackEvent(Int_t); | |
39 | ||
40 | virtual Int_t GetNumberOfPartEvents(); | |
41 | virtual Int_t GetNumberOfTrackEvents(); | |
42 | ||
43 | void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names | |
44 | void SetEventBuffering(Bool_t flag){fBufferEvents = flag;} | |
45 | ||
46 | virtual Int_t GetNumberOfDirs() const {return (fDirs)?fDirs->GetEntries():0;} | |
47 | protected: | |
48 | ||
49 | TObjArray* fCuts;//array with particle cuts | |
50 | TObjArray* fDirs;//arry with directories to read data from | |
51 | ||
52 | Int_t fCurrentEvent;//! number of current event in current directory | |
53 | Int_t fCurrentDir;//! number of current directory | |
54 | ||
55 | Int_t fNEventsRead;//!total | |
56 | ||
57 | AliHBTEvent* fTracksEvent; //! tracks read from current event | |
58 | AliHBTEvent* fParticlesEvent; //! particles read from current event | |
59 | ||
60 | AliHBTRun* fParticles; //!simulated particles | |
61 | AliHBTRun* fTracks; //!reconstructed tracks (particles) | |
62 | ||
63 | Bool_t fIsRead;//!flag indicating if the data are already read | |
64 | Bool_t fBufferEvents;//flag indicating if the data should be bufferred | |
65 | ||
66 | virtual Int_t ReadNext() = 0; //this methods reads next event and put result in fTracksEvent and/or fParticlesEvent | |
67 | Bool_t Pass(AliHBTParticle*); | |
68 | Bool_t Pass(Int_t pid); | |
69 | ||
70 | TString& GetDirName(Int_t); | |
71 | ||
72 | private: | |
73 | ||
74 | public: | |
75 | ClassDef(AliHBTReader,2)//version 2 - TNamed as parental class | |
76 | ||
77 | }; | |
78 | ||
79 | #endif |