{ //=========Macro generated from canvas: c9/c9 //========= (Thu Jul 24 10:28:59 2014) by ROOT version5.34/09 TCanvas *c9 = new TCanvas("c9", "c9",1440,44,1000,800); c9->Range(-75.47457,-3.355283,478.0056,30.19755); c9->SetFillColor(0); c9->SetBorderMode(0); c9->SetBorderSize(2); c9->SetFrameBorderMode(0); c9->SetFrameBorderMode(0); TMultiGraph *multigraph = new TMultiGraph(); multigraph->SetName(""); multigraph->SetTitle("Voltage corresponding to fixed gain, as a function of temperature; V (Volt) ; T(deg)"); TGraph *graph = new TGraph(4); graph->SetName(""); graph->SetTitle(""); graph->SetFillColor(1); graph->SetMarkerStyle(20); graph->SetMarkerColor(1); graph->SetPoint(0,390.6287939,25.56406266); graph->SetPoint(1,386.8108388,20.64987777); graph->SetPoint(2,385.1476981,18.66987643); graph->SetPoint(3,383.5315713,16.69947929); TH1F *Graph_Graph60 = new TH1F("Graph_Graph60","",100,382.8218,391.3385); Graph_Graph60->SetMinimum(15.81302); Graph_Graph60->SetMaximum(26.45052); Graph_Graph60->SetDirectory(0); Graph_Graph60->SetStats(0); graph->SetHistogram(Graph_Graph60); TF1 *mylyne = new TF1("mylyne","[0]*x+[1]",382.8218,391.3385); mylyne->SetFillColor(19); mylyne->SetLineColor(1); mylyne->SetFillStyle(0); mylyne->SetLineWidth(3); mylyne->SetChisquare(0.01408536); mylyne->SetNDF(2); mylyne->SetParameter(0,1.249946); mylyne->SetParError(0,0.01592217); mylyne->SetParLimits(0,0,0); mylyne->SetParameter(1,-462.7456); mylyne->SetParError(1,6.154536); mylyne->SetParLimits(1,0,0); Float_t slope0 = mylyne->GetParameter(0); Float_t slope0err = mylyne->GetParError(0); graph->GetListOfFunctions()->Add(mylyne); multigraph->Add(graph,"P"); graph = new TGraph(4); graph->SetName(""); graph->SetTitle(""); graph->SetFillColor(1); graph->SetMarkerColor(2); graph->SetMarkerStyle(20); graph->SetPoint(0,398.2865585,25.56406266); graph->SetPoint(1,394.447364,20.64987777); graph->SetPoint(2,392.783551,18.66987643); graph->SetPoint(3,391.1729322,16.69947929); TH1F *Graph_Graph61 = new TH1F("Graph_Graph61","",100,390.4616,398.9979); Graph_Graph61->SetMinimum(15.81302); Graph_Graph61->SetMaximum(26.45052); Graph_Graph61->SetDirectory(0); Graph_Graph61->SetStats(0); graph->SetHistogram(Graph_Graph61); TF1 *mylyne = new TF1("mylyne","[0]*x+[1]",390.4616,398.9979); mylyne->SetFillColor(19); mylyne->SetLineColor(1); mylyne->SetFillStyle(0); mylyne->SetLineWidth(3); mylyne->SetChisquare(0.01129286); mylyne->SetNDF(2); mylyne->SetParameter(0,1.246686); mylyne->SetParError(0,0.01421903); mylyne->SetParLimits(0,0,0); mylyne->SetParameter(1,-471.0135); mylyne->SetParError(1,5.604879); mylyne->SetParLimits(1,0,0); Float_t slope1 = mylyne->GetParameter(0); Float_t slope1err = mylyne->GetParError(0); graph->GetListOfFunctions()->Add(mylyne); multigraph->Add(graph,"P"); graph = new TGraph(4); graph->SetName(""); graph->SetTitle(""); graph->SetFillColor(1); graph->SetMarkerColor(4); graph->SetMarkerStyle(20); graph->SetPoint(0,402.531019,25.56406266); graph->SetPoint(1,398.6670589,20.64987777); graph->SetPoint(2,396.9930493,18.66987643); graph->SetPoint(3,395.4032308,16.69947929); TH1F *Graph_Graph62 = new TH1F("Graph_Graph62","",100,394.6905,403.2438); Graph_Graph62->SetMinimum(15.81302); Graph_Graph62->SetMaximum(26.45052); Graph_Graph62->SetDirectory(0); Graph_Graph62->SetStats(0); graph->SetHistogram(Graph_Graph62); TF1 *mylyne = new TF1("mylyne","[0]*x+[1]",394.6905,403.2438); mylyne->SetFillColor(19); mylyne->SetLineColor(1); mylyne->SetFillStyle(0); mylyne->SetLineWidth(3); mylyne->SetChisquare(0.008514769); mylyne->SetNDF(2); mylyne->SetParameter(0,1.242967); mylyne->SetParError(0,0.01230871); mylyne->SetParLimits(0,0,0); mylyne->SetParameter(1,-474.8005); mylyne->SetParError(1,4.903882); mylyne->SetParLimits(1,0,0); Float_t slope2 = mylyne->GetParameter(0); Float_t slope2err = mylyne->GetParError(0); graph->GetListOfFunctions()->Add(mylyne); multigraph->Add(graph,"P"); graph = new TGraph(0); graph->SetName(""); graph->SetTitle(""); graph->SetFillColor(1); graph->SetMarkerColor(4); graph->SetMarkerStyle(20); multigraph->Add(graph,"P"); multigraph->SetTitle("Voltage corresponding to fixed gain, as a function of temperature; V (Volt) ; T(deg)"); multigraph->Draw("A"); multigraph->GetXaxis()->SetTitle(" V (Volt) "); multigraph->GetYaxis()->SetTitle(" T(deg)"); multigraph->GetXaxis()->SetRangeUser(384,402); multigraph->GetYaxis()->SetRangeUser(15,28); TPaveText *pt = new TPaveText(0.01,0.9405959,0.71,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(1); pt->SetFillColor(0); TText *text = pt->AddText("Voltage corresponding to fixed gain, as a function of temperature"); // pt->Draw(); char string[256]; sprintf (string,"a = %.3f #pm%.3f\n",slope0,slope0err); printf("string=%s",string); t1 = new TLatex(0.15,0.87,string); t1->SetNDC(); t1->SetTextSize(0.03); t1->Draw(); sprintf (string,"gain = 50\n"); printf("string=%s",string); t1 = new TLatex(0.15,0.82,string); t1->SetNDC(); t1->SetTextSize(0.03); t1->Draw(); sprintf (string,"a = %.3f #pm%.3f\n",slope1,slope1err); printf("string=%s",string); t1 = new TLatex(0.45,0.87,string); t1->SetNDC(); t1->SetTextSize(0.03); t1->Draw(); sprintf (string,"gain = 100\n"); printf("string=%s",string); t1 = new TLatex(0.45,0.82,string); t1->SetNDC(); t1->SetTextSize(0.03); t1->Draw(); sprintf (string,"a = %.3f #pm%.3f\n",slope2,slope2err); printf("string=%s",string); t1 = new TLatex(0.70,0.87,string); t1->SetNDC(); t1->SetTextSize(0.03); t1->Draw(); sprintf (string,"gain = 150\n"); printf("string=%s",string); t1 = new TLatex(0.70,0.82,string); t1->SetNDC(); t1->SetTextSize(0.03); t1->Draw(); c9->Modified(); c9->cd(); c9->SetSelected(c9); c9->SaveAs("APD655_Slope_vs_T.pdf"); }