48 auto T =
new TTree(
"T",
"test friend trees");
49 T->Branch(
"Run", &Run,
"Run/I");
50 T->Branch(
"Event", &
Event,
"Event/I");
51 T->Branch(
"x", &
x,
"x/F");
52 T->Branch(
"y", &
y,
"y/F");
53 T->Branch(
"z", &z,
"z/F");
55 for (
Int_t i=0; i<10000; i++) {
80 auto T =
f->Get<
TTree>(
"T");
82 auto TF = T->CopyTree(
"z<10");
84 TF->BuildIndex(
"Run",
"Event");
99 auto T =
f->Get<
TTree>(
"T");
103 T->SetBranchAddress(
"Event", &
Event);
104 T->SetBranchAddress(
"x", &
x);
105 T->SetBranchAddress(
"y", &
y);
106 T->SetBranchAddress(
"z", &z);
107 TF->SetBranchAddress(
"Run", &
fRun);
108 TF->SetBranchAddress(
"Event", &fEvent);
109 TF->SetBranchAddress(
"x", &
fx);
110 TF->SetBranchAddress(
"y", &
fy);
111 TF->SetBranchAddress(
"z", &
fz);
121 if (
TF->GetEntryWithIndex(Run,
Event) > 0) {
123 printf(
"i=%lld, Run=%d, Event=%d, x=%g, y=%g, z=%g : fRun=%d, fEvent=%d, fx=%g, fy=%g, fz=%g\n",
124 i, Run,
Event,
x,
y, z,
fRun, fEvent,
fx,
fy,
fz);
128 printf(
"nok = %d, fentries=%lld\n",
nok,
TF->GetEntries());
141 auto T =
f->Get<
TTree>(
"T");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
This is the base class for the ROOT Random number generators.
A TTree represents a columnar dataset.
virtual TFriendElement * AddFriend(const char *treename, const char *filename="")
Add a TFriendElement to the list of friends.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=nullptr)
Change branch address, dealing with clone trees properly.