Added ESD reader for HLT tracks.
[u/mrichter/AliRoot.git] / JETAN / AliJetParticlesReaderESD.h
CommitLineData
d7c6ab14 1#ifndef ALIJETPARTICLESREADERESD_H
2#define ALIJETPARTICLESREADERESD_H
3
4//___________________________________________________________________________
5/////////////////////////////////////////////////////////////////////////////
6// //
5d60c8f9 7// File reader for ESD //
d7c6ab14 8// //
9// This reader reads tracks from Event Summary Data //
5d60c8f9 10// taken from Piotr.Skowronski@cern.ch //
d7c6ab14 11// more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html //
12// //
5d60c8f9 13// loizides@ikf.uni-frankfurt.de //
d7c6ab14 14/////////////////////////////////////////////////////////////////////////////
15
16#include <TString.h>
17#include <AliESDtrack.h>
18#include "AliJetParticlesReader.h"
19
20class TFile;
5d60c8f9 21class TTree;
d7c6ab14 22class AliESD;
23
24class 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;}
5d60c8f9 31 void SetCompareFlagTPC() {fPassFlag=AliESDtrack::kTPCrefit;}
d7c6ab14 32
33 virtual ~AliJetParticlesReaderESD();
34
5d60c8f9 35 //Int_t Next(); //in base class
d7c6ab14 36 void Rewind();
37
5d60c8f9 38 const AliESD* GetCurrentESD() const {return fESD;}
39
d7c6ab14 40 protected:
5d60c8f9 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
d7c6ab14 44 Bool_t IsAcceptedParticle(Float_t px, Float_t py, Float_t pz) const;
45
46 TString fESDFileName; // name of the file with tracks
5d60c8f9 47 AliESD *fESD; //! pointer to current esd object
d7c6ab14 48 TFile* fFile; //! pointer to current ESD file
5d60c8f9 49 TTree* fTree; //! pointer to current tree with ESD objects
d7c6ab14 50 TIter* fKeyIterator; //! key iterator through file
51 ULong_t fPassFlag; //flag to compare esd flag with
52
53 ClassDef(AliJetParticlesReaderESD,1) //
54};
55
56inline 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