36 TFile f(
"tree108.root",
"recreate");
37 auto t3 =
new TTree(
"t3",
"Reconst ntuple");
38 t3->Branch(
"ntrack", &
ntrack,
"ntrack/I");
39 t3->Branch(
"stat", stat,
"stat[ntrack]/I");
40 t3->Branch(
"sign",
sign,
"sign[ntrack]/I");
41 t3->Branch(
"px", px,
"px[ntrack]/F");
42 t3->Branch(
"py", py,
"py[ntrack]/F");
43 t3->Branch(
"pz", pz,
"pz[ntrack]/F");
44 t3->Branch(
"zv",
zv,
"zv[ntrack]/F");
45 t3->Branch(
"chi2",
chi2,
"chi2[ntrack]/F");
47 TFile fr(
"tree108f.root",
"recreate");
48 auto t3f =
new TTree(
"t3f",
"a friend Tree");
49 t3f->Branch(
"ntrack", &
ntrack,
"ntrack/I");
51 t3f->Branch(
"pt",
pt,
"pt[ntrack]/F");
53 for (
Int_t i=0; i<1000; i++) {
82 t3->AddFriend(
"t3f",
"tree108f.root");
83 t3->Draw(
"pz",
"pt>3");
88 auto p =
new TPad(
"p",
"p", 0.6, 0.4, 0.98, 0.8);
94 t3->AddFriend(
"t3f", f2);
95 t3->Draw(
"pz",
"pt>3");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
R__EXTERN TRandom * gRandom
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
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.
The most important graphics class in the ROOT system.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Double_t Rndm() override
Machine independent random number generator.
A TTree represents a columnar dataset.
Double_t Sqrt(Double_t x)
Returns the square root of x.