19 #ifdef JETS_SECOND_RUN
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++) {
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) {
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++) {
102 gROOT->ProcessLine(
".L " + tutdir +
"/tree/JetEvent.cxx+");
103 gROOT->ProcessLine(
"#define JETS_SECOND_RUN yes");
104 gROOT->ProcessLine(
"#include \"" __FILE__
"\"");
105 gROOT->ProcessLine(
"jets(100,200,true)");
double read(const std::string &file_name)
reading
double write(int n, const std::string &file_name, const std::string &vector_type, int compress=0)
writing
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 TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
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 Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual void Print(Option_t *option="") const
Print a summary of the tree contents.
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 TSystem * gSystem
R__EXTERN TRandom * gRandom
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
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.
virtual Long64_t GetEntries() const
A TTree object has a header with a name and a title.