////////////////////////////////////////////////////////// // This class has been automatically generated on // Thu Feb 15 13:27:36 2007 by ROOT version 5.13/06 // from TTree ntuple/data from ascii file // found on file: Memory Directory ////////////////////////////////////////////////////////// #ifndef basic_try_h #define basic_try_h #include #include #include class basic_try { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain const Int_t kshape = 2; const Int_t kx = 6; const Int_t ky = 6; const Int_t kl = 6; const Int_t kb = 6; const Int_t kpot = 6; // Declaration of leave types Float_t shape[kshape]; Float_t x[kx]; Float_t y[ky]; Float_t l[kl]; Float_t b[kb]; Float_t pot[kpot]; // List of branches TBranch *b_shape; //! TBranch *b_x; //! TBranch *b_y; //! TBranch *b_l; //! TBranch *b_b; //! TBranch *b_pot; //! basic_try(TTree *tree=0); ~basic_try(); Int_t Cut(Int_t entry); Int_t GetEntry(Int_t entry); Int_t LoadTree(Int_t entry); void Init(TTree *tree); void Loop(); Bool_t Notify(); void Show(Int_t entry = -1); }; #endif #ifdef basic_try_cxx basic_try::basic_try(TTree *tree) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. if (tree == 0) { TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("basic.root"); if (!f) { f = new TFile("basic.root"); } tree = (TTree*)gDirectory->Get("ntuple"); } Init(tree); } basic_try::~basic_try() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t basic_try::GetEntry(Int_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Int_t basic_try::LoadTree(Int_t entry) { // Set the environment to read one entry if (!fChain) return -5; Int_t centry = fChain->LoadTree(entry); if (centry < 0) return centry; if (!fChain->InheritsFrom(TChain::Class())) return centry; TChain *chain = (TChain*)fChain; if (chain->GetTreeNumber() != fCurrent) { fCurrent = chain->GetTreeNumber(); Notify(); } return centry; } void basic_try::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses and branch // pointers of the tree will be set. // It is normaly not necessary to make changes to the generated // code, but the routine can be extended by the user if needed. // Init() will be called many times when running on PROOF // (once per file to be processed). // Set branch addresses and branch pointers if (tree==0) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("shape", &shape); fChain->SetBranchAddress("x", &x); fChain->SetBranchAddress("y", &y); fChain->SetBranchAddress("l", &l); fChain->SetBranchAddress("b", &b); fChain->SetBranchAddress("pot", &pot); Notify(); } Bool_t basic_try::Notify() { // The Notify() function is called when a new file is opened. This // can be either for a new TTree in a TChain or when when a new TTree // is started when using PROOF. It is normaly not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. The return value is currently not used. b_shape = fChain->GetBranch("shape"); b_x = fChain->GetBranch("x"); b_y = fChain->GetBranch("y"); b_l = fChain->GetBranch("l"); b_b = fChain->GetBranch("b"); b_pot = fChain->GetBranch("pot"); return kTRUE; } void basic_try::Show(Int_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t basic_try::Cut(Int_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef basic_try_cxx