{ //=========Macro generated from canvas: c2/c2 //========= (Thu Jul 24 10:30:01 2014) by ROOT version5.34/09 TCanvas *c2 = new TCanvas("c2", "c2",1440,44,1000,800); c2->Range(0,0,1,1); c2->SetFillColor(0); c2->SetBorderMode(0); c2->SetBorderSize(2); c2->SetFrameBorderMode(0); c2->Divide(2,2); // ------------>Primitives in pad: c2_1 // TPad *c2_1 = new TPad("c2_1", "c2_1",0.01,0.51,0.49,0.99); // c2_1->Draw(); c2->cd(1); c2_1->Range(-57.25796,-0.3081112,515.3216,2.26609); c2_1->SetFillColor(0); c2_1->SetBorderMode(0); c2_1->SetBorderSize(2); c2_1->SetLogy(); c2_1->SetFrameBorderMode(0); c2_1->SetFrameBorderMode(0); TGraphErrors *gre = new TGraphErrors(49); gre->SetName("Graph"); gre->SetTitle("Gain vs V. T=25.578729;V (Volt);Gain"); gre->SetFillColor(1); gre->SetMarkerStyle(7); gre->SetPoint(0,4.987828,1.000201); gre->SetPointError(0,0,0.01000201); gre->SetPoint(1,9.987797,0.999352); gre->SetPointError(1,0,0.00999352); gre->SetPoint(2,14.98775,1.00182); gre->SetPointError(2,0,0.0100182); gre->SetPoint(3,19.98773,0.9986912); gre->SetPointError(3,0,0.009986912); gre->SetPoint(4,24.9877,0.9990012); gre->SetPointError(4,0,0.009990012); gre->SetPoint(5,29.98768,0.998936); gre->SetPointError(5,0,0.00998936); gre->SetPoint(6,34.98766,0.999042); gre->SetPointError(6,0,0.00999042); gre->SetPoint(7,39.98764,1.000054); gre->SetPointError(7,0,0.01000054); gre->SetPoint(8,44.98762,1.000037); gre->SetPointError(8,0,0.01000037); gre->SetPoint(9,49.9876,1.000714); gre->SetPointError(9,0,0.01000714); gre->SetPoint(10,99.98713,1.02807); gre->SetPointError(10,0,0.0102807); gre->SetPoint(11,149.9845,1.227525); gre->SetPointError(11,0,0.01227525); gre->SetPoint(12,199.9764,1.873783); gre->SetPointError(12,0,0.01873783); gre->SetPoint(13,249.9584,3.318656); gre->SetPointError(13,0,0.03318656); gre->SetPoint(14,299.917,6.688399); gre->SetPointError(14,0,0.06688399); gre->SetPoint(15,319.8863,9.196529); gre->SetPointError(15,0,0.09196529); gre->SetPoint(16,329.8656,10.88735); gre->SetPointError(16,0,0.1088735); gre->SetPoint(17,339.84,12.979); gre->SetPointError(17,0,0.12979); gre->SetPoint(18,349.8079,15.59792); gre->SetPointError(18,0,0.1559792); gre->SetPoint(19,359.7672,18.92368); gre->SetPointError(19,0,0.1892368); gre->SetPoint(20,361.7578,19.69587); gre->SetPointError(20,0,0.1969587); gre->SetPoint(21,363.7477,20.51603); gre->SetPointError(21,0,0.2051603); gre->SetPoint(22,365.7371,21.38506); gre->SetPointError(22,0,0.2138506); gre->SetPoint(23,367.7259,22.30174); gre->SetPointError(23,0,0.2230174); gre->SetPoint(24,369.714,23.27511); gre->SetPointError(24,0,0.2327511); gre->SetPoint(25,371.7014,24.30511); gre->SetPointError(25,0,0.2430511); gre->SetPoint(26,373.688,25.39906); gre->SetPointError(26,0,0.2539906); gre->SetPoint(27,375.6737,26.56538); gre->SetPointError(27,0,0.2656538); gre->SetPoint(28,377.6586,27.80415); gre->SetPointError(28,0,0.2780415); gre->SetPoint(29,379.6424,29.13201); gre->SetPointError(29,0,0.2913201); gre->SetPoint(30,381.625,30.54765); gre->SetPointError(30,0,0.3054765); gre->SetPoint(31,383.6065,32.06013); gre->SetPointError(31,0,0.3206013); gre->SetPoint(32,385.5867,33.6861); gre->SetPointError(32,0,0.336861); gre->SetPoint(33,387.5654,35.42375); gre->SetPointError(33,0,0.3542375); gre->SetPoint(34,389.5425,37.29911); gre->SetPointError(34,0,0.3729911); gre->SetPoint(35,391.5177,39.32688); gre->SetPointError(35,0,0.3932688); gre->SetPoint(36,393.491,41.50753); gre->SetPointError(36,0,0.4150753); gre->SetPoint(37,395.462,43.88129); gre->SetPointError(37,0,0.4388129); gre->SetPoint(38,397.4306,46.44922); gre->SetPointError(38,0,0.4644922); gre->SetPoint(39,399.3964,49.25024); gre->SetPointError(39,0,0.4925024); gre->SetPoint(40,401.3595,52.26712); gre->SetPointError(40,0,0.5226712); gre->SetPoint(41,403.3186,55.61597); gre->SetPointError(41,0,0.5561597); gre->SetPoint(42,405.2737,59.28659); gre->SetPointError(42,0,0.5928659); gre->SetPoint(43,407.2239,63.35933); gre->SetPointError(43,0,0.6335933); gre->SetPoint(44,409.1688,67.86732); gre->SetPointError(44,0,0.6786732); gre->SetPoint(45,411.1076,72.87322); gre->SetPointError(45,0,0.7287322); gre->SetPoint(46,413.0391,78.47696); gre->SetPointError(46,0,0.7847696); gre->SetPoint(47,414.9621,84.77964); gre->SetPointError(47,0,0.8477964); gre->SetPoint(48,416.8749,91.91283); gre->SetPointError(48,0,0.9191283); TH1F *Graph_Graph29 = new TH1F("Graph_Graph29","Gain vs V. T=25.58 degC",100,0,458.0636); Graph_Graph29->SetMinimum(0.8898339); Graph_Graph29->SetMaximum(102.0163); Graph_Graph29->SetDirectory(0); Graph_Graph29->SetStats(0); Graph_Graph29->GetXaxis()->SetTitle("V (Volt)"); Graph_Graph29->GetYaxis()->SetTitle("Gain"); gre->SetHistogram(Graph_Graph29); gre->Draw("ap"); // ------------>Primitives in pad: c2_2 // TPad *c2_2 = new TPad("c2_2", "c2_2",0.01,0.51,0.49,0.99); // c2_2->Draw(); c2->cd(2); c2_2->Range(-56.437,-0.3982851,507.933,3.085831); c2_2->SetFillColor(0); c2_2->SetBorderMode(0); c2_2->SetBorderSize(2); c2_2->SetLogy(); c2_2->SetFrameBorderMode(0); c2_2->SetFrameBorderMode(0); TGraphErrors *gre1 = new TGraphErrors(49); gre1->SetName("Graph"); // gre1->SetTitle("Gain vs V. T=25.56;V (Volt);Gain"); gre1->SetFillColor(1); gre1->SetMarkerStyle(7); gre1->SetPoint(0,4.985693,1.001327); gre1->SetPointError(0,0,0.01001327); gre1->SetPoint(1,9.985661,1.00185); gre1->SetPointError(1,0,0.0100185); gre1->SetPoint(2,14.98563,1.002501); gre1->SetPointError(2,0,0.01002501); gre1->SetPoint(3,19.98559,1.000573); gre1->SetPointError(3,0,0.01000573); gre1->SetPoint(4,24.98552,1.003878); gre1->SetPointError(4,0,0.01003878); gre1->SetPoint(5,29.98545,1.005232); gre1->SetPointError(5,0,0.01005232); gre1->SetPoint(6,34.9854,1.006183); gre1->SetPointError(6,0,0.01006183); gre1->SetPoint(7,39.98536,1.006162); gre1->SetPointError(7,0,0.01006162); gre1->SetPoint(8,44.98532,1.006488); gre1->SetPointError(8,0,0.01006488); gre1->SetPoint(9,49.98528,1.00753); gre1->SetPointError(9,0,0.0100753); gre1->SetPoint(10,99.98459,1.040499); gre1->SetPointError(10,0,0.01040499); gre1->SetPoint(11,149.9809,1.283662); gre1->SetPointError(11,0,0.01283662); gre1->SetPoint(12,199.9675,2.190999); gre1->SetPointError(12,0,0.02190999); gre1->SetPoint(13,249.9352,4.416863); gre1->SetPointError(13,0,0.04416863); gre1->SetPoint(14,299.8537,10.05669); gre1->SetPointError(14,0,0.1005669); gre1->SetPoint(15,319.7883,14.58359); gre1->SetPointError(15,0,0.1458359); gre1->SetPoint(16,329.7418,17.79998); gre1->SetPointError(16,0,0.1779998); gre1->SetPoint(17,339.6816,21.97143); gre1->SetPointError(17,0,0.2197143); gre1->SetPoint(18,349.6013,27.53524); gre1->SetPointError(18,0,0.2753524); gre1->SetPoint(19,359.4909,35.18606); gre1->SetPointError(19,0,0.3518606); gre1->SetPoint(20,361.4639,37.06098); gre1->SetPointError(20,0,0.3706098); gre1->SetPoint(21,363.4347,39.08745); gre1->SetPointError(21,0,0.3908745); gre1->SetPoint(22,365.4031,41.27609); gre1->SetPointError(22,0,0.4127609); gre1->SetPoint(23,367.3689,43.64253); gre1->SetPointError(23,0,0.4364253); gre1->SetPoint(24,369.3318,46.21488); gre1->SetPointError(24,0,0.4621488); gre1->SetPoint(25,371.2914,49.01827); gre1->SetPointError(25,0,0.4901827); gre1->SetPoint(26,373.2473,52.07464); gre1->SetPointError(26,0,0.5207464); gre1->SetPoint(27,375.199,55.42433); gre1->SetPointError(27,0,0.5542433); gre1->SetPoint(28,377.146,59.10051); gre1->SetPointError(28,0,0.5910051); gre1->SetPoint(29,379.0875,63.15276); gre1->SetPointError(29,0,0.6315276); gre1->SetPoint(30,381.0227,67.64703); gre1->SetPointError(30,0,0.6764703); gre1->SetPoint(31,382.9505,72.65538); gre1->SetPointError(31,0,0.7265538); gre1->SetPoint(32,384.8699,78.24238); gre1->SetPointError(32,0,0.7824238); gre1->SetPoint(33,386.7795,84.51201); gre1->SetPointError(33,0,0.8451201); gre1->SetPoint(34,388.6771,91.6071); gre1->SetPointError(34,0,0.916071); gre1->SetPoint(35,390.5609,99.66508); gre1->SetPointError(35,0,0.9966508); gre1->SetPoint(36,392.428,108.8817); gre1->SetPointError(36,0,1.088817); gre1->SetPoint(37,394.2749,119.498); gre1->SetPointError(37,0,1.19498); gre1->SetPoint(38,396.097,131.8359); gre1->SetPointError(38,0,1.318359); gre1->SetPoint(39,397.8895,146.2274); gre1->SetPointError(39,0,1.462274); gre1->SetPoint(40,399.6485,162.9411); gre1->SetPointError(40,0,1.629411); gre1->SetPoint(41,401.3592,182.9837); gre1->SetPointError(41,0,1.829837); gre1->SetPoint(42,403.0129,206.9973); gre1->SetPointError(42,0,2.069973); gre1->SetPoint(43,404.5957,235.9414); gre1->SetPointError(43,0,2.359414); gre1->SetPoint(44,406.0939,270.7211); gre1->SetPointError(44,0,2.707211); gre1->SetPoint(45,407.4888,312.6689); gre1->SetPointError(45,0,3.126689); gre1->SetPoint(46,408.7647,362.8447); gre1->SetPointError(46,0,3.628447); gre1->SetPoint(47,409.9047,422.4386); gre1->SetPointError(47,0,4.224386); gre1->SetPoint(48,410.9041,491.7954); gre1->SetPointError(48,0,4.917954); TH1F *Graph_Graph17 = new TH1F("Graph_Graph17","Gain vs V. T=25.56 degC",100,0,451.496); Graph_Graph17->SetMinimum(0.8915108); Graph_Graph17->SetMaximum(546.2857); Graph_Graph17->SetDirectory(0); Graph_Graph17->SetStats(0); Graph_Graph17->GetXaxis()->SetTitle("V (Volt)"); Graph_Graph17->GetYaxis()->SetTitle("Gain"); gre1->SetHistogram(Graph_Graph17); gre1->Draw("ap"); // ------------>Primitives in pad: c2_3 // TPad *c2_3 = new TPad("c2_3", "c2_3",0.01,0.51,0.49,0.99); // c2_3->Draw(); c2->cd(3); c2_3->Range(-56.437,-0.3982851,507.933,3.085831); c2_3->SetFillColor(0); c2_3->SetBorderMode(0); c2_3->SetBorderSize(2); c2_3->SetLogy(); c2_3->SetFrameBorderMode(0); c2_3->SetFrameBorderMode(0); TCanvas *c3 = new TCanvas("c3", "c3",1440,44,1000,800); // get points from gre (APD 1) and modify to match gre1 (APD 655) Int_t npts=49; Int_t jj; Double_t x, y; for (jj=0;jjGetPoint(jj,x,y); cout << "jj=" << jj << " x=" << x << " y=" << y << endl; gre->SetPoint(jj,x-28,y); } TLegend *leg = new TLegend(0.2,0.8,0.7,0.9); leg->AddEntry(gre,"APD 0605004458, Shifted -28 V","p"); leg->AddEntry(gre1,"APD 655","p"); gre->SetMarkerSize(0.8); gre1->SetMarkerSize(0.8); gre->SetMarkerStyle(20); gre1->SetMarkerStyle(20); gre->SetMarkerColor(2); gre1->SetMarkerColor(4); gre1->GetXaxis()->SetRangeUser(300,430); gre1->Draw("Ap"); gre->Draw("psame"); leg->Draw(); c3->SaveAs("CompareG_1_655.pdf"); }