#ifndef TreeRead_H #define TreeRead_H #include class TTree; class TBranch; class TreeRead { public: TTree *fChain; // pointer to the analyzed TTree or TChain Int_t fCurrent; // current Tree number in a TChain // Declaration of leaf types Int_t evNumber; Int_t runNumber; Int_t numberOfTrack; vector *pt; vector *ptError; vector *p; vector *px; vector *py; vector *pz; vector *eta; vector *etaError; vector *phi; vector *phiError; vector *dxy_PV; vector *dxy_0; vector *dxyError; vector *dz; vector *d0; vector *d0Error; vector *normalizedChi2; vector *dEdx1; vector *chi2; vector *ndof; vector *charge; vector *numberOfvalidHits; vector *numberOfLostHits; vector *beamSpot_x; vector *referencePoint_x; vector *innerPosition_x; vector *outerPosition_x; vector *beamSpot_y; vector *referencePoint_y; vector *innerPosition_y; vector *outerPosition_y; vector *beamSpot_z; vector *referencePoint_z; vector *innerPosition_z; vector *outerPosition_z; vector *K_comp_dEdx_; vector *highPurity_track; // List of branches TBranch *b_evNumber; TBranch *b_runNumber; TBranch *b_numberOfTrack; TBranch *b_pt; TBranch *b_ptError; TBranch *b_p; TBranch *b_px; TBranch *b_py; TBranch *b_pz; TBranch *b_eta; TBranch *b_etaError; TBranch *b_phi; TBranch *b_phiError; TBranch *b_dxy_PV; TBranch *b_dxy_0; TBranch *b_dxyError; TBranch *b_dz; TBranch *b_d0; TBranch *b_d0Error; TBranch *b_normalizedChi2; TBranch *b_dEdx1; TBranch *b_chi2; TBranch *b_ndof; TBranch *b_charge; TBranch *b_numberOfvalidHits; TBranch *b_numberOfLostHits; TBranch *b_beamSpot_x; TBranch *b_referencePoint_x; TBranch *b_innerPosition_x; TBranch *b_outerPosition_x; TBranch *b_beamSpot_y; TBranch *b_referencePoint_y; TBranch *b_innerPosition_y; TBranch *b_outerPosition_y; TBranch *b_beamSpot_z; TBranch *b_referencePoint_z; TBranch *b_innerPosition_z; TBranch *b_outerPosition_z; TBranch *b_K_comp_dEdx_; TBranch *b_highPurity_track; TreeRead(); virtual ~TreeRead(); // store tree pointer and associate variables to branches void init( TTree* tree ); // store branch pointers void getBranches(); // reset all variables void reset(); // read events and analyze them void loop( int evtmax = 9999999, int ifirst = 0 ); // user analysis - to be overwritten virtual void analyze( int entry ) { return ; } ; virtual void begin_analysis() { return ; } ; virtual void end_analysis() { return; } ; // structure ... virtual Int_t GetEntry(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); virtual void Show( Long64_t entry = -1 ); virtual Bool_t Notify(); private: // tree pointer // TTree* currentTree; TreeRead( const TreeRead& st ); TreeRead& operator=( const TreeRead& st ); }; #endif