3 //_________________________________________________________________________
4 ///////////////////////////////////////////////////////////////////////////
9 // Reads particles and tracks and
10 // puts it to the AliAOD objects and eventuall buffers in AliAODRuns
12 // Piotr.Skowronski@cern.ch
14 ///////////////////////////////////////////////////////////////////////////
17 #include <TObjArray.h>
21 class AliAODParticleCut;
26 class AliReader: public TNamed
30 AliReader(TObjArray*);
31 AliReader(const AliReader& in);
34 AliReader& operator=(const AliReader& in);
37 virtual void Rewind() = 0; //
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
42 void AddParticleCut(AliAODParticleCut* cut);
44 virtual Int_t Read(AliAODRun* particles, AliAODRun *tracks);
46 virtual AliAOD* GetEventRec() const {return fEventRec;}//
47 virtual AliAOD* GetEventSim() const {return fEventSim;}//can not be const because position randomizer overloads it
49 virtual AliAOD* GetEventRec(Int_t n);
50 virtual AliAOD* GetEventSim(Int_t n);
52 virtual Int_t GetNumberOfRecEvents();
53 virtual Int_t GetNumberOfSimEvents();
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;
65 TObjArray* fCuts;//array with particle cuts
66 TObjArray* fDirs;//arry with directories to read data from
68 Int_t fCurrentEvent;//! number of current event in current directory
69 Int_t fCurrentDir;//! number of current directory
71 Int_t fNEventsRead;//!total
73 AliAOD* fEventRec; //! tracks read from current event
74 AliAOD* fEventSim; //! particles read from current event
76 AliAODRun* fRunSim; //!simulated particles
77 AliAODRun* fRunRec; //!reconstructed tracks
79 Bool_t fIsRead;//!flag indicating if the data are already read
80 Bool_t fBufferEvents;//flag indicating if the data should be bufferred
82 Bool_t fBlend;// flag indicating if randomly change positions of the particles after reading
84 Int_t fFirst;//first event to return (all are before are skipped)
87 TH1I* fTrackCounter; //histogram with number of tracks read
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);
94 TString& GetDirName(Int_t entry);
98 ClassDef(AliReader,1)//