//////////////////////////////////////////////////////////
//   This class has been automatically generated 
//     (Mon Oct 18 15:52:04 1999 by ROOT version 2.22/09)
//   from TTree Oak/A ROOT tree
//   found on file: Ex3.root
//////////////////////////////////////////////////////////


#ifndef Ex3_h
#define Ex3_h

#if !defined(__CINT__) || defined(__MAKECINT__)
#include <TTree.h>
#include <TFile.h>
#endif

class Ex3 {
   public :
   TTree          *fTree; //pointer to the analyzed TTree
//Declaration of leaves types
   Float_t         a;
   Float_t         b;
   Float_t         c;
   Float_t         p;

//List of branches
   TBranch        *b_abcBranch;
   TBranch        *b_pBranch;

   Ex3(TTree *tree=0);
   ~Ex3() {;}
   Int_t GetEntry(Int_t entry);
   void  Init(TTree *tree);
   void  Loop();
   void  Show(Int_t entry = -1);
};

#endif

#ifdef Ex3_cxx
Ex3::Ex3(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("Ex3.root");
      if (!f) {
         f = new TFile("Ex3.root");
      }
      tree = (TTree*)gDirectory->Get("Oak");

   }
   Init(tree);
}

Int_t Ex3::GetEntry(Int_t entry)
{
// Read specified entry from the Tree into data members
   if (fTree) return fTree->GetEntry(entry);
   else       return 0;
}

void Ex3::Init(TTree *tree)
{
//   GetBranch pointers
   if (tree == 0) return;
   fTree = tree;
   b_a = fTree->GetBranch("abcBranch");
   b_p = fTree->GetBranch("pBranch");

//   Set branch addresses
   b_a->SetAddress(&a);
   b_p->SetAddress(&p);
}

void Ex3::Show(Int_t entry)
{
// Print contents of entry.
// If entry is not specified, print current entry
   if (!fTree) return;
   fTree->Show(entry);
}
#endif // #ifdef Ex3_cxx

