////////////////////////////////////////////////////////// // This class has been automatically generated on // Sun Apr 17 19:15:01 2005 by ROOT version 4.03/02 // from TTree Albero eventi/Commento all'albero // found on file: junk.root ////////////////////////////////////////////////////////// #ifndef Foo_h #define Foo_h #include #include #include class Foo { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Declaration of leave types simple_event *event_branch; UInt_t fUniqueID; UInt_t fBits; UInt_t event_num; Int_t hits_num; UInt_t hits[90]; //[hits_num] // List of branches TBranch *b_event_branch_fUniqueID; //! TBranch *b_event_branch_fBits; //! TBranch *b_event_branch_event_num; //! TBranch *b_event_branch_hits_num; //! TBranch *b_hits; //! Foo(TTree *tree=0); virtual ~Foo(); virtual Int_t Cut(Long64_t entry); virtual Int_t GetEntry(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); virtual void Init(TTree *tree); virtual void Loop(); virtual Bool_t Notify(); virtual void Show(Long64_t entry = -1); }; #endif #ifdef Foo_cxx Foo::Foo(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("junk.root"); if (!f) { f = new TFile("junk.root"); } tree = (TTree*)gDirectory->Get("Albero eventi"); } Init(tree); } Foo::~Foo() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t Foo::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t Foo::LoadTree(Long64_t entry) { // Set the environment to read one entry if (!fChain) return -5; Long64_t centry = fChain->LoadTree(entry); if (centry < 0) return centry; if (fChain->IsA() != TChain::Class()) return centry; TChain *chain = (TChain*)fChain; if (chain->GetTreeNumber() != fCurrent) { fCurrent = chain->GetTreeNumber(); Notify(); } return centry; } void Foo::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses 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 with PROOF. // Set object pointer event_branch = 0; // Set branch addresses if (tree == 0) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("fUniqueID",&fUniqueID); fChain->SetBranchAddress("fBits",&fBits); fChain->SetBranchAddress("event_num",&event_num); fChain->SetBranchAddress("hits_num",&hits_num); fChain->SetBranchAddress("hits",hits); Notify(); } Bool_t Foo::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. Typically here the branch pointers // will be retrieved. It is normaly not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. // Get branch pointers b_event_branch_fUniqueID = fChain->GetBranch("fUniqueID"); b_event_branch_fBits = fChain->GetBranch("fBits"); b_event_branch_event_num = fChain->GetBranch("event_num"); b_event_branch_hits_num = fChain->GetBranch("hits_num"); b_hits = fChain->GetBranch("hits"); return kTRUE; } void Foo::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t Foo::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef Foo_cxx