fill tree bombs in a simple case

From: David Urner (urner@uinpluxa.npl.uiuc.edu)
Date: Thu Nov 06 1997 - 23:51:06 MET


Hi,
	I'm trying to write a macro with a very basic tree.
I first load a simple class called Mytest, which contains just 4 variables
with .L help.cpp. It has the following form:

#include "help.h"

Mytest::Mytest()
{
  
}
Mytest::~Mytest()
{
  
}

void Mytest::Streamer(TBuffer &R__b)
{
   // Stream an object of class Geometry.

}


where help.h has the form:

 class Mytest
    {
    public:
      Mytest();
      virtual ~Mytest();

      void Streamer(TBuffer& R__b);
      Int_t Run_number;
      Int_t Record_number;
      Int_t Fill_number;
      Int_t Nrhits;
    };


I'm booking the tree then the following way:

{
  TFile *hfile = new TFile("Test.root","RECREATE","Junk");
  TTree *treetrace = new TTree("treetrace","example",1024);
  Int_t split=0;
  Int_t bsize = 64000;
  Mytest *mytest = new Mytest;
  treetrace->Branch("mytest","Mytest",&mytest,bsize,split);
  treetrace->Fill();
}

At the comand treetrace->Fill() I get a segmentation violation.
What could the reason be?
I'm running this on a hp system 10.

		cheers
			David



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:22 MET