58 #include "../test/Event.h"
64 TFile f(
"tree4.root",
"RECREATE");
67 TTree t4(
"t4",
"A Tree with Events");
70 Event *
event =
new Event();
73 t4.
Branch(
"event_split", &event,16000,99);
74 t4.
Branch(
"event_not_split", &event,16000,0);
80 for (
Int_t ev = 0; ev <100; ev++) {
85 sprintf(etype,
"type%d",ev%5);
86 event->SetType(etype);
87 event->SetHeader(ev, 200, 960312, random);
88 event->SetNseg(
Int_t(10*ntrack+20*sigmas));
90 event->SetFlag(
UInt_t(random+0.5));
91 event->SetTemperature(random+20.);
98 for(
UChar_t i0 = 0; i0 < 4; i0++) {
99 for(
UChar_t i1 = 0; i1 < 4; i1++) {
105 for (
Int_t t = 0;
t < ntrack;
t++) event->AddTrack(random);
139 Event *
event =
new Event();
154 if (event->GetNtrack() > 587)
continue;
161 if (nselected == 1) t4->
Show();
167 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 Rndm(Int_t i=0)
Machine independent random number generator.
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...
virtual Int_t Fill()
Fill all branches.
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 int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual void StartViewer()
Start the TTreeViewer on this tree.
virtual void Print(Option_t *option="") const
Print a summary of the tree contents.
virtual void Show(Long64_t entry=-1, Int_t lenmax=20)
Print values of all active leaves for entry.
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.
R__EXTERN TSystem * gSystem
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
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
static DictFuncPtr_t GetDict(const char *cname)
Given the class name returns the Dictionary() function of a class (uses hash of name).
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
virtual Long64_t GetEntries() const
A TTree object has a header with a name and a title.
A TTree is a list of TBranches.