]>
Commit | Line | Data |
---|---|---|
1b446896 | 1 | #ifndef ALIHBTREADER_H |
2 | #define ALIHBTREADER_H | |
3 | ||
2de2e2c6 | 4 | #include <TNamed.h> |
bed069a4 | 5 | #include <TObjArray.h> |
1b446896 | 6 | |
7 | //Reader Base class (reads particles and tracks and | |
0fdcc83d | 8 | //puts it to the AliHBTRun objects |
1b446896 | 9 | //Piotr.Skowronski@cern.ch |
10 | ||
11 | class AliHBTRun; | |
12 | class AliHBTEvent; | |
13 | class AliHBTParticleCut; | |
1b446896 | 14 | class AliHBTParticle; |
0fdcc83d | 15 | class TString; |
88cb7938 | 16 | |
2de2e2c6 | 17 | class AliHBTReader: public TNamed |
1b446896 | 18 | { |
19 | public: | |
20 | AliHBTReader(); | |
0fdcc83d | 21 | AliHBTReader(TObjArray*); |
1b446896 | 22 | virtual ~AliHBTReader(); |
1b446896 | 23 | |
bed069a4 | 24 | virtual Int_t Next(); |
25 | virtual void Rewind() = 0; | |
1b446896 | 26 | |
bed069a4 | 27 | virtual Bool_t ReadsTracks() const = 0; |
28 | virtual Bool_t ReadsParticles() const = 0; | |
4e7d5d5f | 29 | |
bed069a4 | 30 | void AddParticleCut(AliHBTParticleCut* cut); |
31 | ||
32 | virtual Int_t Read(AliHBTRun* particles, AliHBTRun *tracks); | |
33 | ||
efaf00f8 | 34 | virtual AliHBTEvent* GetParticleEvent() {return fParticlesEvent;}//can not be const because position randomizer overloads it |
35 | virtual AliHBTEvent* GetTrackEvent() {return fTracksEvent;}// | |
bed069a4 | 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;} | |
fe1a3526 | 45 | void SetBlend(Bool_t flag = kTRUE){fBlend=flag;} |
bed069a4 | 46 | virtual Int_t GetNumberOfDirs() const {return (fDirs)?fDirs->GetEntries():0;} |
4f36d7b8 | 47 | void ReadEventsFromTo(Int_t first,Int_t last){fFirst = first; fLast = last;} |
1b446896 | 48 | protected: |
49 | ||
bed069a4 | 50 | TObjArray* fCuts;//array with particle cuts |
51 | TObjArray* fDirs;//arry with directories to read data from | |
52 | ||
53 | Int_t fCurrentEvent;//! number of current event in current directory | |
54 | Int_t fCurrentDir;//! number of current directory | |
55 | ||
56 | Int_t fNEventsRead;//!total | |
57 | ||
58 | AliHBTEvent* fTracksEvent; //! tracks read from current event | |
59 | AliHBTEvent* fParticlesEvent; //! particles read from current event | |
60 | ||
61 | AliHBTRun* fParticles; //!simulated particles | |
62 | AliHBTRun* fTracks; //!reconstructed tracks (particles) | |
63 | ||
64 | Bool_t fIsRead;//!flag indicating if the data are already read | |
65 | Bool_t fBufferEvents;//flag indicating if the data should be bufferred | |
66 | ||
fe1a3526 | 67 | Bool_t fBlend;// flag indicating if randomly change positions of the particles after reading |
4f36d7b8 | 68 | |
69 | Int_t fFirst;//first event to return (all are before are skipped) | |
70 | Int_t fLast;//last | |
71 | ||
bed069a4 | 72 | virtual Int_t ReadNext() = 0; //this methods reads next event and put result in fTracksEvent and/or fParticlesEvent |
1b446896 | 73 | Bool_t Pass(AliHBTParticle*); |
74 | Bool_t Pass(Int_t pid); | |
fe1a3526 | 75 | void Blend(); |
76 | ||
0fdcc83d | 77 | TString& GetDirName(Int_t); |
1b446896 | 78 | |
79 | private: | |
80 | ||
81 | public: | |
fe1a3526 | 82 | ClassDef(AliHBTReader,3)//version 2 - TNamed as parental class |
83 | //version 3 - Blending added | |
1b446896 | 84 | }; |
85 | ||
86 | #endif |