{ TString name1 = "../GoodParam/BetheBloch.txt"; ifstream fin1(name1); TString name2 = "../GoodParam/BetheBloch_betagt1.txt"; ifstream fin2(name2); gROOT->SetStyle("Plain"); gStyle->SetOptStat(0); gStyle->SetOptFit(0); gStyle->SetFuncColor( kRed ); Float_t tp[48][3]; Float_t tpbg1[48]; Float_t X[48]; char *s = new char[1]; Int_t idummy; Float_t p0,p1,p2; for (int i=0; i<48; i++) { fin1>>idummy>>p0>>p1>>p2; cout<<" "<>idummy>>p0; cout<<" "<SetLineColor(kRed); for (Int_t ii=1; ii<20; ii++) { Float_t xb = 1.*ii/20; Float_t yhelp = f1[i]->Eval(xb); cout<GetY()[0] = tpbg1[i]; gr[i]->GetX()[0] = 1.; TH2F *hr = new TH2F("hr","",2,0,1.1,2,0,100); hr->SetXTitle("beta"); hr->SetYTitle("BB_corr"); hr->Draw(); f1[i]->Draw("same"); //f1[i]->Draw(); gr[i]->SetMarkerStyle(20); gr[i]->SetMarkerSize(1.5); gr[i]->SetMarkerColor(kBlue); gr[i]->Draw("P"); //gPad->SetLogy(); gPad->SetGrid(); c->Update(); //gets(s); } //========================================================================== //========================================================================== //========================================================================== TCanvas *c1 = new TCanvas("c1","histograms1",1100,800); c1->Divide(8,6); TF1 *f1[48]; for (Int_t i=0; i<48; i++) { cout<<"PMT "<cd(i+1); // return p[0]/(x*x)*(log(x*x/(1-x*x)) - p[1]*x*x - p[2]); f1[i] = new TF1("f1","[0]/(x*x)*(log(x*x/(1-x*x)) - [1]*x*x - [2])",0.05,0.99); f1[i].SetParameters(tp[i][0],tp[i][1],tp[i][2]); f1[i]->SetLineColor(kRed); TH2F *hr = new TH2F("hr","",2,0.1,1.1,2,0,100); hr->SetXTitle("beta"); hr->SetYTitle("BB_corr"); hr->Draw(); f1[i]->Draw("same"); gr[i]->Draw("P"); //gPad->SetLogy(); gPad->SetGrid(); } } }