Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
soft:root [2020/10/21 05:15] – Ce Zhang | soft:root [2023/05/24 09:51] (current) – [ROOT study] Ce Zhang | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====ROOT study===== | =====ROOT study===== | ||
+ | ==== Divide ==== | ||
+ | < | ||
+ | hHitTime_Ratio[i] = new TH1F(*hHitTime_Num[i]); | ||
+ | hHitTime_Ratio[i]-> | ||
+ | hHitTime_Ratio[i]-> | ||
+ | </ | ||
+ | ==== Sub Canvas and Pads ==== | ||
+ | < | ||
+ | TCanvas *c1 = new TCanvas(“c1”, | ||
+ | c1-> | ||
+ | c1-> | ||
+ | |||
+ | TVirtualPad *c1_1 = c1-> | ||
+ | gPad-> | ||
+ | // enter the 4 sub-pads and do stuff | ||
+ | c1_1-> | ||
+ | (new TText(0.1, 0.5, “c1 … 1 … 1”))-> | ||
+ | c1_1-> | ||
+ | (new TText(0.1, 0.5, “c1 … 1 … 2”))-> | ||
+ | c1_1-> | ||
+ | (new TText(0.1, 0.5, “c1 … 1 … 3”))-> | ||
+ | c1_1-> | ||
+ | (new TText(0.1, 0.5, “c1 … 1 … 4”))-> | ||
+ | </ | ||
+ | |||
+ | ==== TF1 ==== | ||
+ | < | ||
+ | TF1 * fit1 = new TF1(" | ||
+ | fit1-> | ||
+ | f3-> | ||
+ | gStyle-> | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | ==== Time ==== | ||
+ | |||
+ | TDatime | ||
+ | |||
+ | < | ||
+ | TDatime * Time = new TDatime(); | ||
+ | cout<< | ||
+ | // output: Fri Jul 30 09:56:02 2021 20210730 95602 | ||
+ | // ... | ||
+ | c1-> | ||
+ | </ | ||
+ | ==== Get max and mim from TGraph ==== | ||
+ | |||
+ | < | ||
+ | TMath:: | ||
+ | </ | ||
+ | |||
+ | ==== Draw his from saved .root file in TCanvas ==== | ||
+ | |||
+ | < | ||
+ | TFile f1(" | ||
+ | | ||
+ | | ||
+ | |||
+ | TFile f2(" | ||
+ | | ||
+ | TH1D *h1; | ||
+ | |||
+ | | ||
+ | TIter next(l); | ||
+ | | ||
+ | while ((obj=next())) { | ||
+ | if (obj-> | ||
+ | h1 = (TH1D*)obj; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | TFile *_file0 = TFile:: | ||
+ | TCanvas *c1 = (TCanvas*)_file0-> | ||
+ | TH1D *aee = (TH1D*)c1-> | ||
+ | |||
+ | </ | ||
+ | ====Reset (refresh) the histogram==== | ||
+ | |||
+ | < | ||
+ | hT-> | ||
+ | </ | ||
+ | [[https:// | ||
+ | |||
====Subdivide the Canvas==== | ====Subdivide the Canvas==== | ||
Line 10: | Line 101: | ||
//the first row to take 80% and 2nd row to take 20% of the space. | //the first row to take 80% and 2nd row to take 20% of the space. | ||
+ | |||
| | ||
| | ||
Line 67: | Line 159: | ||
</ | </ | ||
+ | ====TList (adding trees)==== | ||
+ | < | ||
+ | Tree* t1 = TxtToTree(...); | ||
+ | Tree* t2 = TxtToTree(...); | ||
+ | |||
+ | TList *list = new TList; | ||
+ | |||
+ | list-> | ||
+ | list-> | ||
+ | list-> | ||
+ | //... | ||
+ | | ||
+ | TTree *newtree = TTree:: | ||
+ | newtree-> | ||
+ | |||
+ | </ | ||
====TBox==== | ====TBox==== | ||
< | < | ||
Line 103: | Line 211: | ||
- | ====TList (adding trees)==== | ||
- | < | ||
- | Tree* t1 = TxtToTree(...); | ||
- | Tree* t2 = TxtToTree(...); | ||
- | TList *list = new TList; | ||
- | |||
- | list-> | ||
- | list-> | ||
- | list-> | ||
- | //... | ||
- | | ||
- | TTree *newtree = TTree:: | ||
- | newtree-> | ||
- | |||
- | </ | ||
====TCutG==== | ====TCutG==== |