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 file, usually with extension .root, that stores data and code in the form of serialized objects in ...
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
A TTree represents a columnar dataset.