60 #include "../test/Event.h" 66 TFile f(
"tree4.root",
"RECREATE");
69 TTree t4(
"t4",
"A Tree with Events");
72 Event *
event =
new Event();
75 t4.Branch(
"event_split", &event,16000,99);
76 t4.Branch(
"event_not_split", &event,16000,0);
82 for (
Int_t ev = 0; ev <100; ev++) {
87 sprintf(etype,
"type%d",ev%5);
88 event->SetType(etype);
89 event->SetHeader(ev, 200, 960312, random);
90 event->SetNseg(
Int_t(10*ntrack+20*sigmas));
92 event->SetFlag(
UInt_t(random+0.5));
93 event->SetTemperature(random+20.);
100 for(
UChar_t i0 = 0; i0 < 4; i0++) {
101 for(
UChar_t i1 = 0; i1 < 4; i1++) {
107 for (
Int_t t = 0; t < ntrack; t++) event->AddTrack(random);
141 Event *
event =
new Event();
156 if (event->GetNtrack() > 587)
continue;
163 if (nselected == 1) t4->
Show();
169 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 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 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.
R__EXTERN TSystem * gSystem
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 Long64_t GetEntries() const
A TTree object has a header with a name and a title.
A TTree is a list of TBranches.