////////////////////////////////////////////////////////// // This class has been automatically generated // (Thu Mar 29 09:26:37 2001 by ROOT version3.00/06) // from TTree ntuple/Demo ntuple // found on file: hsimple.root ////////////////////////////////////////////////////////// #ifndef ntupleSelector_h #define ntupleSelector_h #include #include #include #include class ntupleSelector : public TSelector { public : TTree *fChain; //pointer to the analyzed TTree or TChain //Declaration of leaves types Float_t px; Float_t py; Float_t pz; Float_t random; Float_t i; //List of branches TBranch *b_px; TBranch *b_py; TBranch *b_pz; TBranch *b_random; TBranch *b_i; ntupleSelector(TTree *tree=0) {;} ~ntupleSelector() {;} void Begin(TTree *tree); void Init(TTree *tree); Bool_t Notify(); Bool_t ProcessCut(Int_t entry); void ProcessFill(Int_t entry); void Terminate(); }; #endif #ifdef ntupleSelector_cxx void ntupleSelector::Init(TTree *tree) { // Set branch addresses if (tree == 0) return; fChain = tree; fChain->SetBranchAddress("px",&px); fChain->SetBranchAddress("py",&py); fChain->SetBranchAddress("pz",&pz); fChain->SetBranchAddress("random",&random); fChain->SetBranchAddress("i",&i); } Bool_t ntupleSelector::Notify() { // called when loading a new file // get branch pointers b_px = fChain->GetBranch("px"); b_py = fChain->GetBranch("py"); b_pz = fChain->GetBranch("pz"); b_random = fChain->GetBranch("random"); b_i = fChain->GetBranch("i"); return kTRUE; } #endif // #ifdef ntupleSelector_cxx