void sipm_plotBiasScan(void) { // // Input the .csv data file from excel file into arrays for processing. // //#include #include #include gROOT->Reset(); //TTree *Bfield = (TTree *) gROOT->FindObject("Bfield"); //gROOT->LoadMacro("$ROOTSYS/test/libEvent.so"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kFALSE); // gStyle->SetOptFit(kFALSE); gStyle->SetOptFit(1111); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); gStyle->SetFillColor(0); // char line[1024]; char filename[132]; char name[10]; Double_t pi=3.14159; Int_t j,jj; # define npts1 10; Double_t HVps1[npts1]={0,77.8,78.1,78.3,78.6,78.7,78.9,79.0,79.1,90}; Double_t bcal_res_ratio1[npts1]={-1,2.74,2.14,1.94,1.82,1.80,1.786,1.86,2.19,-1}; Double_t HVbias1[npts1]; # define npts2 13; Double_t HVps2[npts2]={0,77.3,77.5,77.8,78.1,78.3,78.6,78.9,79.1,78.7,79,78.9,90}; Double_t bcal_res_ratio2[npts2]={-1,5.55,3.75,2.55,2.04,1.87,1.76,1.70,1.87,1.74,1.72.1.71,-1}; Double_t HVbias2[npts2]; # define npts3 12; Double_t HVbias3[npts3]={0,74.5,74.3,74.2,73.9,73.5,73.2,72.9,73.7,73.6,72.4,90}; Double_t compact_res_ratio3[npts3]={-1,3.46,2.71,2.26,1.73,1.83,2.01,2.7,1.70,1.75,-1}; # define npts4 12; Double_t HVbias4[npts4]={0,74.5,74.3,74.2,73.9,73.5,73.2,72.9,73.7,73.6,72.4,90}; Double_t compact_res_ratio4[npts4]={-1,3.12,2.48,2.11,1.60,1.62,1.73,2.21,1.57,1.58,-1}; // scale production resolutions by geometric factors (sqrt(0.48) for prod, sqrt(0.59) for compact) Double_t geometry1=sqrt(0.48); Double_t geometry2=sqrt(0.48); Double_t geometry3=sqrt(0.59); Double_t geometry4=sqrt(0.59); // obtain bias voltages Double_t p0 = -2.272; Double_t p1 = 0.9462; for (jj=0; jjSetBorderMode(0); c1->SetFillColor(0); c1->SetGridx(); c1->SetGridy(); TGraph *bcal_res1 = new TGraph (npts1,HVbias1,bcal_res_ratio1); TGraph *bcal_res2 = new TGraph (npts2,HVbias2,bcal_res_ratio2); TGraph *compact_res3 = new TGraph (npts3,HVbias3,compact_res_ratio3); TGraph *compact_res4 = new TGraph (npts4,HVbias4,compact_res_ratio4); TLegend *leg2 = new TLegend(0.5,0.75,0.85,0.9); leg2->AddEntry(bcal_res2,"BCAL production","p"); leg2->AddEntry(compact_res3,"Compact 1","p"); leg2->AddEntry(compact_res4,"Compact 2","p"); /*t1 = new TLatex(0.5,0.8,string); t1->SetTextColor(1); t1->SetNDC(); t1->Draw();*/ bcal_res2->SetTitle(""); bcal_res2->GetXaxis()->SetRangeUser(xmin,xmax); bcal_res2->GetYaxis()->SetRangeUser(ymin,ymax); bcal_res2->GetXaxis()->SetTitleSize(0.05); bcal_res2->GetYaxis()->SetTitleSize(0.05); bcal_res2->GetYaxis()->SetTitleOffset(1.5); bcal_res2->GetYaxis()->SetTitle("Resolution Ratio"); bcal_res2->GetXaxis()->SetTitle("SiPM Bias (V)"); bcal_res2->GetXaxis()->SetNdivisions(5); bcal_res2->SetMarkerColor(2); bcal_res2->SetMarkerStyle(24); bcal_res2->SetMarkerSize(1.2); bcal_res2->Draw("AP"); leg2->Draw(); Double_t fitmin=xmin; Double_t fitmax=xmax; // bcal_res2->Fit("pol1","","",fitmin,fitmax); bcal_res2->SetMarkerColor(2); bcal_res2->SetMarkerStyle(20); bcal_res2->SetMarkerSize(1.2); // bcal_res2->Draw("SameP"); compact_res3->SetMarkerColor(4); compact_res3->SetMarkerStyle(25); compact_res3->SetMarkerSize(1.2); compact_res3->Draw("SameP"); compact_res4->SetMarkerColor(4); compact_res4->SetMarkerStyle(21); compact_res4->SetMarkerSize(1.2); compact_res4->Draw("SameP"); c1->SaveAs("sipm_plotBiasScan_c1.pdf"); // close input file }