Usage of a Tree using the JetEvent class.
The JetEvent class has several collections (TClonesArray) and other collections (TRefArray) referencing objects in the TClonesArrays. The JetEvent class is in $ROOTSYS/tutorials/tree/JetEvent.h,cxx to execute the script, do
#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();
}
}
void read() {
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++) {
Int_t rev = gRandom->Uniform(LOOPMAX);
}
}
}
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
- Author
- Rene Brun
Definition in file jets.C.