1 #ifndef ALIJETPARTICLESREADER_H
2 #define ALIJETPARTICLESREADER_H
6 //_________________________________________________________________________
7 ///////////////////////////////////////////////////////////////////////////
11 // loizides@ikf.uni-frankfurt.de
12 ///////////////////////////////////////////////////////////////////////////
15 #include <TObjArray.h>
18 class AliJetEventParticles;
20 class AliJetParticlesReader: public TNamed
23 AliJetParticlesReader();
24 AliJetParticlesReader(TObjArray* dirs);
25 virtual ~AliJetParticlesReader();
27 void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names
28 void ReadEventsFromTo(Int_t first,Int_t last){fFirst = first; fLast = last;}
30 virtual Int_t Next(); //call this if you want the next event
31 virtual void Rewind() = 0;
33 void SetPtCut(Float_t ptmin=0, Float_t ptmax=1000)
34 {fPtMin=ptmin;fPtMax=ptmax;}
35 void SetPhiCut(Float_t phi=2*TMath::Pi()){SetPhiCut(0,phi);}
36 void SetPhiCut(Float_t phimin, Float_t phimax)
37 {fPhiMin=phimin;fPhiMax=phimax;}
38 void SetEtaCut(Float_t e=1){SetEtaCut(-e,e);}
39 void SetEtaCut(Float_t emin, Float_t emax)
40 {fEtaMin=emin;fEtaMax=emax;}
42 const AliJetEventParticles* GetEventParticles() const {return fEventParticles;}
43 AliJetEventParticles* GetEventParticles(Bool_t o)
44 {fOwner=o; return fEventParticles;} //return particles and set ownership
46 Int_t GetNumberOfDirs() const {return (fDirs)?fDirs->GetEntries():0;}
47 Int_t GetCurEventNumber() const {return fCurrentEvent;}
48 Int_t GetCurDirNumber() const {return fCurrentDir;}
49 Int_t GetTotEventsRead() const {return fNEventsRead;}
50 Int_t GetFirstEvent() const {return fFirst;}
51 Int_t GetLastEvent() const {return fLast;}
55 virtual Int_t ReadNext() = 0; //this methods reads next event and
56 //put result in fParticles
57 TString& GetDirName(Int_t entry);
59 AliJetEventParticles* fEventParticles; //array with read particles
60 Bool_t fOwner; //ownership of particles
61 TObjArray* fDirs; //array with directories to read data from
62 Int_t fCurrentEvent; //number of current event in current file
63 Int_t fCurrentDir; //number of current directory in array
64 Int_t fNEventsRead; //total number of processed events
65 Int_t fFirst; //first event to return (all before are skipped)
66 Int_t fLast; //last event to return (relative to total number)
68 Float_t fPtMin; //min pt cut
69 Float_t fPtMax; //max pt cut
70 Float_t fEtaMin; //min eta cut
71 Float_t fEtaMax; //max eta cut
72 Float_t fPhiMin; //min phi cut
73 Float_t fPhiMax; //max phi cut
75 ClassDef(AliJetParticlesReader,1) // Basic AliJetParticles Reader class