#include #include #include #include #include #include #include #include #include #include #include #include "TLatex.h" #include "TPaveStats.h" #include "TGraphPainter.h" #include "TString.h" #include "TCollection.h" #include "TCanvas.h" #include "TFile.h" #include "TH1F.h" #include "TF1.h" #include "TGraph.h" #include "TGraphErrors.h" #include "TMinuit.h" #include "TKey.h" #include "TDatime.h" #include "TAxis.h" #include "TLine.h" #include "TTree.h" #include "TBranch.h" #include "TStyle.h" #include "TROOT.h" #include "TSystem.h" void SiPM_saturation_Vscan() { //gStyle->Reset(); //gROOT->SetStyle("Plain"); gStyle->SetPalette(1,0); // gStyle->SetOptStat(kTRUE); //gStyle->SetOptStat(kFALSE); // gStyle->SetOptFit(kTRUE); //gStyle->SetOptFit(kFALSE); gStyle->SetOptFit(11111); gStyle->SetOptStat(2220); /*gStyle->SetStatH(0.10); gStyle->SetStatW(0.60); gStyle->SetStatX(0.99); gStyle->SetStatY(0.99);*/ gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.2); gStyle->SetPadBottomMargin(0.15); //gStyle->SetFillColor(0); gStyle->SetTitleOffset(1.5, "Y"); gStyle->SetTitleSize(0.07,"xyz"); gStyle->SetTitleSize(0.08,"h"); gStyle->SetLabelSize(0.07,"xyz"); gStyle->SetTitleX(0); gStyle->SetTitleAlign(13); gStyle->SetNdivisions(505,"xy"); TCanvas *c0 = new TCanvas("c0","c0 SiPM_saturation_fits",200,10,800,700); c0->SetGridx(); c0->SetGridy(); Double_t xmin=73.5; Double_t xmax=76; Double_t ymin=0; Double_t ymax=3000; c0->cd(1); TGraphErrors *gr_Vscan = new TGraphErrors("Vscan_log19_421-433.txt","%lg %lg %lg %lg"); gr_Vscan->SetTitle("Voltage scan; Voltage (V); Peak (counts)"); gr_Vscan->SetMarkerStyle(20); gr_Vscan->SetMarkerColor(2); gr_Vscan->SetMinimum(0); gr_Vscan->GetXaxis()->SetRangeUser(xmin,xmax); gr_Vscan->GetYaxis()->SetRangeUser(ymin,ymax); gr_Vscan->Fit("pol2","","",74,75.5); gr_Vscan->Draw("ap"); c0->SaveAs("SiPM_saturation_Vscan.png"); c0->SaveAs("SiPM_saturation_Vscan.pdf"); }