{
   // check to see if the class ABC is in the dictionary
	// if it is not in the dictionary compile it with the script
	// compiler.
	if (!TClassTable::GetDict("ABC")) {
		gSystem->CompileMacro("ABCClass.C");
	}

	// Open the ASCII file for reading
	ifstream asciiFile("ABC.txt");
	
	// create a TFile object, using RECREATE to overwrite if it exists 	
	TFile *hfile = new TFile("ABCwithClass.root","RECREATE","Exercise 1");

	// create a TTree object with the name T, title : A ROOT tree, 
	// and the default buffer size of 64 MB
	TTree *tree = new TTree("T","A ROOT tree");
	
	// create an ABC object. This must be on the heap to
	// be added to the tree correctly.
	ABC *v = new ABC;
	
	// add a branch called abcBranch, it contains ABCSTURCTURE , and the
	// leaves are: a,b,c.
	// add another branch for the lenght of this vectorv
	TBranch *abcBranch = tree->Branch("abcBranch","ABC",&v);
	
	// read the values from the ASCII file and fill the tree
	while (asciiFile >> v->a >> v->b >> v->c) {
		v->p = (sqrt((v->a * v->a)+(v->b * v->b)+(v->c * v->c)));
		tree->Fill();
	}
	
	hfile->Write();
	

	// Draw the tree
	TCanvas *myCanvas = new TCanvas ("myCanvas","My Canvas", 0,0,600,400);
	myCanvas->Divide(2,2);
	myCanvas->cd(1);
	tree->Draw("a");
	myCanvas->cd(2);
	tree->Draw("b");
	myCanvas->cd(3);
	tree->Draw("c");
	myCanvas->cd(4);
	tree->Draw("p");
	
	
	// to display a vs. p on the command line type this line at the root prompt:
	// Oak->Draw("a:p");
	
}

		
	
