{ //=========Macro generated from canvas: c9/c9 //========= (Thu Jul 24 10:28:11 2014) by ROOT version5.34/09 TCanvas *c9 = new TCanvas("c9", "c9",1440,44,1000,800); c9->Range(-74.62614,-3.35176,472.6322,30.16584); c9->SetFillColor(0); c9->SetBorderMode(0); c9->SetBorderSize(2); c9->SetFrameBorderMode(0); c9->SetFrameBorderMode(0); TMultiGraph *multigraph = new TMultiGraph(); multigraph->SetName(""); TGraph *graph = new TGraph(4); graph->SetName(""); graph->SetTitle(""); graph->SetFillColor(1); graph->SetMarkerColor(1); graph->SetMarkerStyle(20); graph->SetPoint(0,385.9260819,25.53721545); graph->SetPoint(1,382.5174751,20.65673615); graph->SetPoint(2,380.8612219,18.67477873); graph->SetPoint(3,379.2106669,16.70396042); TH1F *Graph_Graph29 = new TH1F("Graph_Graph29","",100,378.5391,386.5976); Graph_Graph29->SetMinimum(15.82063); Graph_Graph29->SetMaximum(26.42054); Graph_Graph29->SetDirectory(0); Graph_Graph29->SetStats(0); graph->SetHistogram(Graph_Graph29); TF1 *mylyne = new TF1("mylyne","[0]*x+[1]",378.5391,386.5976); mylyne->SetFillColor(19); mylyne->SetLineColor(1); mylyne->SetFillStyle(0); mylyne->SetLineWidth(3); mylyne->SetChisquare(0.1080831); mylyne->SetNDF(2); mylyne->SetParameter(0,1.319405); mylyne->SetParError(0,0.04680634); mylyne->SetParLimits(0,0,0); mylyne->SetParameter(1,-483.7895); mylyne->SetParError(1,17.88643); 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,393.7277482,25.53721545); graph->SetPoint(1,390.2341824,20.65673615); graph->SetPoint(2,388.5513351,18.67477873); graph->SetPoint(3,386.9142568,16.70396042); TH1F *Graph_Graph30 = new TH1F("Graph_Graph30","",100,386.2329,394.4091); Graph_Graph30->SetMinimum(15.82063); Graph_Graph30->SetMaximum(26.42054); Graph_Graph30->SetDirectory(0); Graph_Graph30->SetStats(0); graph->SetHistogram(Graph_Graph30); TF1 *mylyne = new TF1("mylyne","[0]*x+[1]",386.2329,394.4091); mylyne->SetFillColor(19); mylyne->SetLineColor(1); mylyne->SetFillStyle(0); mylyne->SetLineWidth(3); mylyne->SetChisquare(0.08299493); mylyne->SetNDF(2); mylyne->SetParameter(0,1.298998); mylyne->SetParError(0,0.04033696); mylyne->SetParLimits(0,0,0); mylyne->SetParameter(1,-486.0302); mylyne->SetParError(1,15.72597); 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,398.0060728,25.53721545); graph->SetPoint(1,394.443521,20.65673615); graph->SetPoint(2,392.7742648,18.67477873); graph->SetPoint(3,391.1562574,16.70396042); TH1F *Graph_Graph31 = new TH1F("Graph_Graph31","",100,390.4713,398.6911); Graph_Graph31->SetMinimum(15.82063); Graph_Graph31->SetMaximum(26.42054); Graph_Graph31->SetDirectory(0); Graph_Graph31->SetStats(0); graph->SetHistogram(Graph_Graph31); TF1 *mylyne = new TF1("mylyne","[0]*x+[1]",390.4713,398.6911); mylyne->SetFillColor(19); mylyne->SetLineColor(1); mylyne->SetFillStyle(0); mylyne->SetLineWidth(3); mylyne->SetChisquare(0.05486332); mylyne->SetNDF(2); mylyne->SetParameter(0,1.291616); mylyne->SetParError(0,0.0326344); mylyne->SetParLimits(0,0,0); mylyne->SetParameter(1,-488.6264); mylyne->SetParError(1,12.86132); 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(380,400); 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.4,0.87,string); t1->SetNDC(); t1->SetTextSize(0.03); t1->Draw(); sprintf (string,"gain = 100\n"); printf("string=%s",string); t1 = new TLatex(0.4,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.65,0.87,string); t1->SetNDC(); t1->SetTextSize(0.03); t1->Draw(); sprintf (string,"gain = 150\n"); printf("string=%s",string); t1 = new TLatex(0.65,0.82,string); t1->SetNDC(); t1->SetTextSize(0.03); t1->Draw(); c9->Modified(); c9->cd(); c9->SetSelected(c9); c9->SaveAs("APD654_Slope_vs_T.pdf"); }