30void write(
Int_t nev=100) {
32 TFile f(
"JetEvent.root",
"recreate");
33 TTree *
T =
new TTree(
"T",
"Event example with Jets");
35 T->Branch(
"event",
"JetEvent",&event,8000,2);
37 for (
Int_t ev=0;ev<nev;ev++) {
51 T->SetBranchAddress(
"event", &event);
57 cout <<
" Event: "<< ev
58 <<
" Jets: " <<
event->GetNjet()
59 <<
" Tracks: " <<
event->GetNtrack()
60 <<
" Hits A: " <<
event->GetNhitA()
61 <<
" Hits B: " <<
event->GetNhitB() << endl;
65void pileup(
Int_t nev=200) {
72 const Int_t LOOPMAX=10;
75 for (loop=0;loop<LOOPMAX;loop++) events[loop] = 0;
77 if (ev%10 == 0) printf(
"building pileup: %lld\n",ev);
78 for (loop=0;loop<LOOPMAX;loop++) {
80 T->SetBranchAddress(
"event", &events[loop]);
100 gROOT->ProcessLine(
".L " + tutdir +
"/tree/JetEvent.cxx+");
101 gROOT->ProcessLine(
"#define JETS_SECOND_RUN yes");
102 gROOT->ProcessLine(
"#include \"" __FILE__
"\"");
103 gROOT->ProcessLine(
"jets(100,200,true)");
R__EXTERN TRandom * gRandom
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
A TTree represents a columnar dataset.