//////////////////////////////////////////////////////////
//   This class has been automatically generated 
//     (Fri Aug 13 16:07:06 1999 by ROOT version 2.22/09)
//   from TTree T/An example of a ROOT tree
//   found on file: EventOneBranch.root
//////////////////////////////////////////////////////////


#ifndef MyClass_h
#define MyClass_h

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

class MyClass {
   	public :
   	TChain          *fChain; 	
		
		//Declaration of leaves types
   	Event           *event;

		//List of branches
   	TBranch        *b_event;

   	MyClass(TChain *chain=0);
   	~MyClass() {;}
   	Int_t GetEntry(Int_t entry);
   	void  Init(TChain *chain);
   	void  Loop();
   	void  Show(Int_t entry = -1);
};

#endif

#ifdef MyClass_cxx
MyClass::MyClass(TChain *chain)
{
	// if parameter chain is not specified (or zero), connect the files
	// used to generate this class and read the Tree.
   if (chain == 0) {
		// create a new chain
   	chain = new TChain("T");
		
		// check if the file is already open
      TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("$HOME/ROOT102/FILES/EventOB.root");
      if (!f) {
        	f = new TFile("$HOME/ROOT102/FILES/EventOB.root");
      }
		// add the file to the chain
	  	chain->Add("$HOME/ROOT102/FILES/EventOB.root");			  	  
	  	chain->Add("$HOME/ROOT102/FILES/EventOB50.root");
		chain->Add("$HOME/ROOT102/FILES/EventOB40.root");
   }
  
   Init(chain);
}

Int_t MyClass::GetEntry(Int_t entry)
{
	// read specified entry from the Tree into data members
   if (fChain) return fChain->GetEntry(entry);
   else       return 0;
}


void MyClass::Init(TChain *chain)
{
	if (chain == 0) return;
	fChain = chain;
	fChain->LoadTree(0);
	
	// getBranch pointers
	b_event = fChain->GetBranch("event");

	// set branch addresses
	b_event->SetAddress(&event);
}


void MyClass::Show(Int_t entry)
{
	// print contents of entry.
	// if entry is not specified, print current entry
   if (!fChain) return;
   fChain->Show(entry);
}
#endif // #ifdef MyClass_cxx

