]> git.uio.no Git - u/mrichter/AliRoot.git/blame - JETAN/AliJetParticlesReader.h
RAWDATA closer to reality
[u/mrichter/AliRoot.git] / JETAN / AliJetParticlesReader.h
CommitLineData
d7c6ab14 1#ifndef ALIJETPARTICLESREADER_H
2#define ALIJETPARTICLESREADER_H
3
4/* $Id$ */
5
6//_________________________________________________________________________
7///////////////////////////////////////////////////////////////////////////
5d60c8f9 8// //
9// class AliJetReader //
10// File reader for ESD //
11// //
12// This reader reads tracks from Event Summary Data //
13// taken from Piotr.Skowronski@cern.ch //
14// more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html //
15// //
16// loizides@ikf.uni-frankfurt.de //
d7c6ab14 17///////////////////////////////////////////////////////////////////////////
18
19#include <TNamed.h>
20#include <TObjArray.h>
21class TClonesArray;
22class TString;
5f0d5628 23class TTree;
d7c6ab14 24class AliJetEventParticles;
25
26class AliJetParticlesReader: public TNamed
27{
28 public:
29 AliJetParticlesReader();
30 AliJetParticlesReader(TObjArray* dirs);
31 virtual ~AliJetParticlesReader();
32
33 void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names
34 void ReadEventsFromTo(Int_t first,Int_t last){fFirst = first; fLast = last;}
35
36 virtual Int_t Next(); //call this if you want the next event
37 virtual void Rewind() = 0;
38
04a02430 39 void SetPtCut(Float_t ptmin=0, Float_t ptmax=100)
d7c6ab14 40 {fPtMin=ptmin;fPtMax=ptmax;}
41 void SetPhiCut(Float_t phi=2*TMath::Pi()){SetPhiCut(0,phi);}
42 void SetPhiCut(Float_t phimin, Float_t phimax)
43 {fPhiMin=phimin;fPhiMax=phimax;}
44 void SetEtaCut(Float_t e=1){SetEtaCut(-e,e);}
45 void SetEtaCut(Float_t emin, Float_t emax)
46 {fEtaMin=emin;fEtaMax=emax;}
5f0d5628 47 void SetTree(TTree *t){fTree=t;fNewTree=kTRUE;}
d7c6ab14 48
49 const AliJetEventParticles* GetEventParticles() const {return fEventParticles;}
50 AliJetEventParticles* GetEventParticles(Bool_t o)
51 {fOwner=o; return fEventParticles;} //return particles and set ownership
52
b2760c9e 53 Int_t GetNumberOfDirs() const {return (fDirs)?fDirs->GetEntries():0;}
54 Int_t GetCurEventNumber() const {return fCurrentEvent;}
55 Int_t GetCurDirNumber() const {return fCurrentDir;}
56 Int_t GetTotEventsRead() const {return fNEventsRead;}
57 Int_t GetFirstEvent() const {return fFirst;}
58 Int_t GetLastEvent() const {return fLast;}
d7c6ab14 59
60 protected:
61
62 virtual Int_t ReadNext() = 0; //this methods reads next event and
5d60c8f9 63 //put result in fParticles
64
d7c6ab14 65 TString& GetDirName(Int_t entry);
66
67 AliJetEventParticles* fEventParticles; //array with read particles
68 Bool_t fOwner; //ownership of particles
69 TObjArray* fDirs; //array with directories to read data from
70 Int_t fCurrentEvent; //number of current event in current file
71 Int_t fCurrentDir; //number of current directory in array
72 Int_t fNEventsRead; //total number of processed events
73 Int_t fFirst; //first event to return (all before are skipped)
74 Int_t fLast; //last event to return (relative to total number)
75
76 Float_t fPtMin; //min pt cut
77 Float_t fPtMax; //max pt cut
78 Float_t fEtaMin; //min eta cut
79 Float_t fEtaMax; //max eta cut
80 Float_t fPhiMin; //min phi cut
81 Float_t fPhiMax; //max phi cut
82
5f0d5628 83 Bool_t fNewTree; // signals new tree
84 TTree *fTree; //! if non-zero store AliJetEventParticles
85
86 ClassDef(AliJetParticlesReader,2) // Basic AliJetParticles Reader class
d7c6ab14 87};
88
89#endif