#include // sigh... #include #include #include #include class MySelector : public TSelector { public: MySelector() {} virtual ~MySelector() {} virtual void Begin( TTree* tree ) { if ( tree == 0 ) { return; } fTree = tree; fTree->SetBranchAddress( "foo", &f_foo ); } virtual Bool_t Notify() { b_foo = fTree->GetBranch( "foo" ); return kTRUE; } virtual Bool_t ProcessCut( Int_t entry ) { fTree->GetEntry( entry ); return kTRUE; } virtual void ProcessFill( Int_t entry ) { cerr << "entry " << entry << ", foo " << f_foo << endl; } private: TTree* fTree; Int_t f_foo; TBranch* b_foo; }; // Local variables: // compile-command: "g++ -Wall `root-config --cflags` -c MySelector.cxx" // End: