19 #ifdef JETS_SECOND_RUN 30 void 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++) {
48 TFile f(
"JetEvent.root");
57 cout <<
" Event: "<< ev
58 <<
" Jets: " <<
event->GetNjet()
59 <<
" Tracks: " <<
event->GetNtrack()
60 <<
" Hits A: " <<
event->GetNhitA()
61 <<
" Hits B: " <<
event->GetNhitB() << endl;
65 void pileup(
Int_t nev=200) {
68 TFile f(
"JetEvent.root");
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++) {
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)");
virtual void Print(Option_t *option="") const
Print a summary of the tree contents.
virtual Int_t Fill()
Fill all branches.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
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_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
R__EXTERN TRandom * gRandom
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
virtual Long64_t GetEntries() const
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
A TTree object has a header with a name and a title.