30void write(
Int_t nev=100)
33 TFile f(
"JetEvent.root",
"recreate");
34 auto T =
new TTree(
"T",
"Event example with Jets");
36 T->Branch(
"event",
"JetEvent", &event, 8000, 2);
38 for (
Int_t ev=0; ev<nev; ev++) {
51 auto T =
f.Get<
TTree>(
"T");
53 T->SetBranchAddress(
"event", &event);
60 std::cout <<
" Event: "<< ev
61 <<
" Jets: " <<
event->GetNjet()
62 <<
" Tracks: " <<
event->GetNtrack()
63 <<
" Hits A: " <<
event->GetNhitA()
64 <<
" Hits B: " <<
event->GetNhitB() << std::endl;
68void pileup(
Int_t nev=200)
73 auto T =
f.Get<
TTree>(
"T");
76 const Int_t LOOPMAX=10;
79 for (loop=0; loop<LOOPMAX; loop++)
83 printf(
"building pileup: %lld\n", ev);
84 for (loop=0; loop<LOOPMAX; loop++) {
86 T->SetBranchAddress(
"event", &events[loop]);
105void tree130_jets(
Int_t nev = 100,
Int_t npileup = 200)
108 gROOT->ProcessLine(
".L " + tutdir +
"/io/tree/JetEvent.cxx+");
109 gROOT->ProcessLine(
"#define JETS_SECOND_RUN yes");
110 gROOT->ProcessLine(
"#include \"" __FILE__
"\"");
111 gROOT->ProcessLine(
"jets(100, 200, true)");
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
long long Long64_t
Portable signed long integer 8 bytes.
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.