void sipm_plotHVsetting(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; sprintf(filename,"%s","9-20-2011_302.csv"); printf ("Read from filename=%s\n",filename); ifstream in1 (filename); # define npts 6; Double_t HVps[npts]={78.9,78.3,78.0,77.3,76.8,76.5}; Double_t HVsipm[npts]={72.4,71.8,71.5,70.9,70.4,70.1}; Double_t xmin=75; Double_t xmax=80; Double_t ymin=70; Double_t ymax=73; // TCanvas *c1 = new TCanvas("c1","c1 sipm_plotHVsetting Canvas",200,10,700,700); c1->SetBorderMode(0); c1->SetFillColor(0); c1->SetGridx(); c1->SetGridy(); TGraph *hvplot = new TGraph (npts,HVps,HVsipm); /*t1 = new TLatex(0.5,0.8,string); t1->SetTextColor(1); t1->SetNDC(); t1->Draw();*/ hvplot->SetTitle(""); hvplot->GetXaxis()->SetRangeUser(xmin,xmax); hvplot->GetYaxis()->SetRangeUser(ymin,ymax); hvplot->GetXaxis()->SetTitleSize(0.05); hvplot->GetYaxis()->SetTitleSize(0.05); hvplot->GetYaxis()->SetTitleOffset(1.5); hvplot->GetYaxis()->SetTitle("SiPM Voltage (V)"); hvplot->GetXaxis()->SetTitle("Power Supply Voltage (V)"); hvplot->GetXaxis()->SetNdivisions(5); hvplot->SetMarkerColor(2); hvplot->SetMarkerStyle(20); hvplot->SetMarkerSize(2); hvplot->Draw("AP"); Double_t fitmin=xmin; Double_t fitmax=xmax; hvplot->Fit("pol1","","",fitmin,fitmax); c1->SaveAs("sipm_plotHVsetting_c1.pdf"); // close input file }