24 const Int_t kMaxTrack = 500;
26 Int_t stat[kMaxTrack];
27 Int_t sign[kMaxTrack];
36 TFile f(
"tree3.root",
"recreate");
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");
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(
"tree3f.root",
"recreate");
49 t3f->
Branch(
"ntrack",&ntrack,
"ntrack/I");
50 t3f->
Branch(
"sumstat",&sumstat,
"sumstat/D");
83 t3->
Draw(
"pz",
"pt>3");
88 TPad *p =
new TPad(
"p",
"p",0.6, 0.4, 0.98, 0.8);
94 t3->
Draw(
"pz",
"pt>3");
R__EXTERN TRandom * gRandom
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
The most important graphics class in the ROOT system.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
void Draw(Option_t *option="") override
Draw Pad in Current pad (re-parent pad if necessary).
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
virtual TFriendElement * AddFriend(const char *treename, const char *filename="")
Add a TFriendElement to the list of friends.
void Draw(Option_t *opt) override
Default Draw method for all objects.
void Print(Option_t *option="") const override
Print a summary of the tree contents.
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
Double_t Sqrt(Double_t x)
Returns the square root of x.