62 #include "../test/Event.h" 68 TFile f(
"tree4.root",
"RECREATE");
71 TTree t4(
"t4",
"A Tree with Events");
74 Event *
event =
new Event();
77 t4.Branch(
"event_split", &event,16000,99);
78 t4.Branch(
"event_not_split", &event,16000,0);
84 for (
Int_t ev = 0; ev <100; ev++) {
89 sprintf(etype,
"type%d",ev%5);
90 event->SetType(etype);
91 event->SetHeader(ev, 200, 960312, random);
92 event->SetNseg(
Int_t(10*ntrack+20*sigmas));
94 event->SetFlag(
UInt_t(random+0.5));
95 event->SetTemperature(random+20.);
102 for(
UChar_t i0 = 0; i0 < 4; i0++) {
103 for(
UChar_t i1 = 0; i1 < 4; i1++) {
109 for (
Int_t t = 0; t < ntrack; t++) event->AddTrack(random);
137 Event *
event =
new Event();
152 if (event->GetNtrack() > 587)
continue;
159 if (nselected == 1) t4->
Show();
165 if (
gROOT->IsBatch())
return;
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
virtual void SetAddress(void *add)
Set address of this branch.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual void StartViewer()
Start the TTreeViewer on this tree.
virtual void Show(Long64_t entry=-1, Int_t lenmax=20)
Print values of all active leaves for entry.
virtual Double_t Rndm()
Machine independent random number generator.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Using a TBrowser one can browse all ROOT objects.
#define R__LOAD_LIBRARY(LIBRARY)
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
void Reset(Detail::TBranchProxy *x)
R__EXTERN TRandom * gRandom
virtual Long64_t GetEntries() const
A TTree object has a header with a name and a title.
A TTree is a list of TBranches.