#ifndef SimpleTreeRead_H #define SimpleTreeRead_H class TTree; class TBranch; class SimpleTreeRead { public: // tree variables int eventId; int lineNum; float zValue; float* coords; const int lineMax; int* iValue; float* xValue; float* yValue; float* aValue; float* bValue; // tree branches TBranch* b_head; TBranch* b_zValue; TBranch* b_coords; TBranch* b_iValue; TBranch* b_xValue; TBranch* b_yValue; TBranch* b_aValue; TBranch* b_bValue; SimpleTreeRead(); virtual ~SimpleTreeRead(); // 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 overwrite virtual void analyze(); private: // tree pointer TTree* currentTree; SimpleTreeRead( const SimpleTreeRead& st ); SimpleTreeRead& operator=( const SimpleTreeRead& st ); }; #endif