This example display only points in web browser.
#ifdef JETS_SECOND_RUN
void write(
Int_t nev=100) {
TFile f(
"JetEvent.root",
"recreate");
TTree *T =
new TTree(
"T",
"Event example with Jets");
T->Branch("event","JetEvent",&event,8000,2);
for (
Int_t ev=0;ev<nev;ev++) {
event->Build();
T->Fill();
}
T->Write();
}
void read() {
T->SetBranchAddress("event", &event);
T->GetEntry(ev);
if (ev) continue;
cout << " Event: "<< ev
<< " Jets: " << event->GetNjet()
<< " Tracks: " << event->GetNtrack()
<< " Hits A: " << event->GetNhitA()
<< " Hits B: " << event->GetNhitB() << endl;
}
}
void pileup(
Int_t nev=200) {
for (loop=0;loop<LOOPMAX;loop++) events[loop] = 0;
if (ev%10 == 0) printf("building pileup: %lld\n",ev);
for (loop=0;loop<LOOPMAX;loop++) {
T->SetBranchAddress("event", &events[loop]);
T->GetEntry(rev);
}
}
}
write(nev);
read();
pileup(npileup);
}
#else
gROOT->ProcessLine(
".L " + tutdir +
"/tree/JetEvent.cxx+");
gROOT->ProcessLine(
"#define JETS_SECOND_RUN yes");
gROOT->ProcessLine(
"#include \"" __FILE__
"\"");
gROOT->ProcessLine(
"jets(100,200,true)");
}
#endif
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.
Definition in file jets.C.