#include "TFile.h"
#include "../test/Event.h"
void tree4w()
{
TFile f(
"tree4.root",
"RECREATE");
TTree t4(
"t4",
"A Tree with Events");
Event *event = new Event();
t4.Branch("event_split", &event,16000,99);
t4.Branch("event_not_split", &event,16000,0);
char etype[20];
for (
Int_t ev = 0; ev <100; ev++) {
gRandom->Rannor(sigmat,sigmas);
sprintf(etype,"type%d",ev%5);
event->SetType(etype);
event->SetHeader(ev, 200, 960312, random);
event->SetNseg(
Int_t(10*ntrack+20*sigmas));
event->SetNvertex(
Int_t(1+20*gRandom->Rndm()));
event->SetFlag(
UInt_t(random+0.5));
event->SetTemperature(random+20.);
event->SetMeasure(m,
Int_t(gRandom->Gaus(m,m+1)));
}
for(
UChar_t i0 = 0; i0 < 4; i0++) {
for(
UChar_t i1 = 0; i1 < 4; i1++) {
event->SetMatrix(i0,i1,gRandom->Gaus(i0*i1,1));
}
}
for (
Int_t t = 0; t < ntrack; t++) event->AddTrack(random);
t4.Fill();
}
}
void tree4r()
{
Event *event = new Event();
if (event->GetNtrack() > 587)continue;
nselected++;
if (nselected == 1) t4->
Show();
event->Clear();
}
if (
gROOT->IsBatch())
return;
}
void tree4() {
tree4w();
tree4r();
}