]>
Commit | Line | Data |
---|---|---|
a5556ea5 | 1 | #ifndef ALIREADER_H |
2 | #define ALIREADER_H | |
3 | //_________________________________________________________________________ | |
4 | /////////////////////////////////////////////////////////////////////////// | |
5 | // | |
6 | // class AliReader | |
7 | // | |
8 | // Reader Base class | |
9 | // Reads particles and tracks and | |
10 | // puts it to the AliAOD objects and eventuall buffers in AliAODRuns | |
11 | // | |
12 | // Piotr.Skowronski@cern.ch | |
13 | // | |
14 | /////////////////////////////////////////////////////////////////////////// | |
15 | ||
16 | #include <TNamed.h> | |
17 | #include <TObjArray.h> | |
18 | ||
19 | class AliAODRun; | |
20 | class AliAOD; | |
21 | class AliAODParticleCut; | |
22 | class AliAODParticle; | |
23 | class TString; | |
24 | class TH1I; | |
25 | ||
26 | class AliReader: public TNamed | |
27 | { | |
28 | public: | |
29 | AliReader(); | |
30 | AliReader(TObjArray*); | |
31 | AliReader(const AliReader& in); | |
32 | virtual ~AliReader(); | |
33 | ||
34 | AliReader& operator=(const AliReader& in); | |
35 | ||
36 | virtual Int_t Next(); | |
37 | virtual void Rewind() = 0; // | |
38 | ||
39 | virtual Bool_t ReadsSim() const = 0; //specifies if reader is able to read simulated particles | |
40 | virtual Bool_t ReadsRec() const = 0;//specifies if reader is able to read reconstructed tracks | |
41 | ||
42 | void AddParticleCut(AliAODParticleCut* cut); | |
43 | ||
44 | virtual Int_t Read(AliAODRun* particles, AliAODRun *tracks); | |
45 | ||
46 | virtual AliAOD* GetEventRec() const {return fEventRec;}// | |
47 | virtual AliAOD* GetEventSim() const {return fEventSim;}//can not be const because position randomizer overloads it | |
48 | ||
49 | virtual AliAOD* GetEventRec(Int_t n); | |
50 | virtual AliAOD* GetEventSim(Int_t n); | |
51 | ||
52 | virtual Int_t GetNumberOfRecEvents(); | |
53 | virtual Int_t GetNumberOfSimEvents(); | |
54 | ||
55 | void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names | |
56 | void SetEventBuffering(Bool_t flag){fBufferEvents = flag;}//switches on/off buffering - read data are kept in local buffer | |
57 | void SetBlend(Bool_t flag = kTRUE){fBlend=flag;} //set blending - randomizing particle order | |
58 | virtual Int_t GetNumberOfDirs() const {return (fDirs)?fDirs->GetEntries():0;} | |
59 | void ReadEventsFromTo(Int_t first,Int_t last){fFirst = first; fLast = last;} | |
60 | virtual TH1I* GetTrackCounter() const {return fTrackCounter;} | |
61 | virtual void WriteTrackCounter() const; | |
62 | ||
63 | protected: | |
64 | ||
65 | TObjArray* fCuts;//array with particle cuts | |
66 | TObjArray* fDirs;//arry with directories to read data from | |
67 | ||
68 | Int_t fCurrentEvent;//! number of current event in current directory | |
69 | Int_t fCurrentDir;//! number of current directory | |
70 | ||
71 | Int_t fNEventsRead;//!total | |
72 | ||
73 | AliAOD* fEventRec; //! tracks read from current event | |
74 | AliAOD* fEventSim; //! particles read from current event | |
75 | ||
76 | AliAODRun* fRunSim; //!simulated particles | |
77 | AliAODRun* fRunRec; //!reconstructed tracks | |
78 | ||
79 | Bool_t fIsRead;//!flag indicating if the data are already read | |
80 | Bool_t fBufferEvents;//flag indicating if the data should be bufferred | |
81 | ||
82 | Bool_t fBlend;// flag indicating if randomly change positions of the particles after reading | |
83 | ||
84 | Int_t fFirst;//first event to return (all are before are skipped) | |
85 | Int_t fLast;//last | |
86 | ||
87 | TH1I* fTrackCounter; //histogram with number of tracks read | |
88 | ||
89 | virtual Int_t ReadNext() = 0; //this methods reads next event and put result in fTracksEvent and/or fParticlesEvent | |
90 | Bool_t Pass(AliAODParticle* p); | |
91 | Bool_t Pass(Int_t pid); | |
92 | void Blend(); | |
93 | ||
94 | TString& GetDirName(Int_t entry); | |
95 | ||
96 | private: | |
97 | ||
98 | ClassDef(AliReader,1)// | |
99 | }; | |
100 | ||
101 | #endif |