n ROOT TFile file new TFilemyfile root recreate

  • Slides: 14
Download presentation

上节回顾 n ROOT 中的文件: TFile *file = new TFile(“myfile. root”, “recreate”) TFile *file =

上节回顾 n ROOT 中的文件: TFile *file = new TFile(“myfile. root”, “recreate”) TFile *file = new TFile(“myfile. root”, “read”) g. Directory n TTree : 以树状结构存储数据的类 TTree *t 1 = new TTree(“t 1”, “my tree”); t 1 ->Branch(“var 1”, &var, “var/D”); t 1 ->Fill(); … n TChain n TTree: : Make. Class() 2

6

6

例: ex 51 a. C To run: root -l ex 51 a. C 8

例: ex 51 a. C To run: root -l ex 51 a. C 8

如何�取�合�果 ? Ø 利用 TF 1: : Get. Parameters(&par) �取�合参数 TFit. Result. Ptr res

如何�取�合�果 ? Ø 利用 TF 1: : Get. Parameters(&par) �取�合参数 TFit. Result. Ptr res = h 1 ->Fit("myfun", "S"); 提醒: TH 1: : Fit() 有很多参数�� https: //root. cern. ch/root/html 534/TH 1. html#TH 1: Fit@1 10

最大似然�合 : Minuit_fit. C 三�功能分�由下面三个函数�� 1) Void get_input_data() 2) Void fcn(Int_t &npar, Double_t *gin,

最大似然�合 : Minuit_fit. C 三�功能分�由下面三个函数�� 1) Void get_input_data() 2) Void fcn(Int_t &npar, Double_t *gin, Double_t &chi 2, Double_t *par, Int_t iflag) 3) Void minuit_fit() �不同�合,可能需要更改的地方包括: 1) void get_input_data() 分布函数 2) void fcn(Int_t &npar, Double_t *gin, Double_t &chi 2, Double_t *par, Int_t iflag) 似然函数 3) void minuit_fit() 参数个数,初�,。。。 11

参考�料 ROOT Users Guide: chapter 5 n http: //root. cern. ch/root/Reference. html n http:

参考�料 ROOT Users Guide: chapter 5 n http: //root. cern. ch/root/Reference. html n http: //root. cern. ch/root/Tutorials. html n http: //root. cern. ch/root/How. To. html n 13