Added ESD reader for HLT tracks.
[u/mrichter/AliRoot.git] / JETAN / AliJetParticlesReaderESD.h
1 #ifndef ALIJETPARTICLESREADERESD_H
2 #define ALIJETPARTICLESREADERESD_H
3
4 //___________________________________________________________________________
5 /////////////////////////////////////////////////////////////////////////////
6 //                                                                         //
7 // File reader for ESD                                                     //
8 //                                                                         //
9 // This reader reads tracks from Event Summary Data                        //
10 // taken from Piotr.Skowronski@cern.ch                                     //
11 // more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html    //
12 //                                                                         //
13 // loizides@ikf.uni-frankfurt.de                                           //
14 /////////////////////////////////////////////////////////////////////////////
15
16 #include <TString.h>
17 #include <AliESDtrack.h>
18 #include "AliJetParticlesReader.h"
19
20 class TFile;
21 class TTree;
22 class AliESD;
23
24 class AliJetParticlesReaderESD: public AliJetParticlesReader
25 {
26   public:
27   AliJetParticlesReaderESD(const Char_t* esdfilename = "AliESDs.root") ;
28   AliJetParticlesReaderESD(TObjArray* dirs,const Char_t* esdfilename = "AliESDs.root");
29
30   void SetCompareFlag(ULong_t f){fPassFlag=f;}
31   void SetCompareFlagTPC() {fPassFlag=AliESDtrack::kTPCrefit;}
32
33   virtual ~AliJetParticlesReaderESD();
34
35   //Int_t Next(); //in base class
36   void Rewind();
37
38   const AliESD* GetCurrentESD() const {return fESD;}
39
40   protected:
41   virtual Int_t ReadESD(AliESD* esd); //read esd file/objects
42   Int_t    ReadNext();                //read the next event
43   TFile*   OpenFile(Int_t evno);      //opens file to be read for given event
44   Bool_t   IsAcceptedParticle(Float_t px, Float_t py, Float_t pz) const;
45     
46   TString fESDFileName; // name of the file with tracks
47   AliESD *fESD;         //! pointer to current esd object
48   TFile*  fFile;        //! pointer to current ESD file
49   TTree*  fTree;        //! pointer to current tree with ESD objects
50   TIter*  fKeyIterator; //! key iterator through file
51   ULong_t fPassFlag;    //flag to compare esd flag with 
52
53   ClassDef(AliJetParticlesReaderESD,1) //
54 };
55
56 inline Bool_t AliJetParticlesReaderESD::IsAcceptedParticle(Float_t pt, Float_t phi, Float_t eta) const
57 {
58   if((pt<fPtMin)||(pt>fPtMax)) return kFALSE;
59   if((eta<fEtaMin)||(eta>fEtaMax)) return kFALSE;
60   if((phi<fPhiMin)||(phi>fPhiMax)) return kFALSE;
61
62   return kTRUE;
63 }
64 #endif