void spectrum(int i=0) { gROOT->SetStyle("Plain"); TCanvas *c1=new TCanvas("c1","Canvas",600,600); gStyle->SetOptStat(0); gStyle->SetPalette(1); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadRightMargin(0.05); c1->UseCurrentStyle(); if(i<4) { if(i==0) TFile::Open("summaryDpw.root"); if(i==1) TFile::Open("summaryNodpw.root"); if(i==2) TFile::Open("summaryDpw05.root"); if(i==3) TFile::Open("summaryNodpw05.root"); hDif->SetTitle(";Fraction of charge;Epitaxial layer volume (#mum^{3}/0.01)"); hDif->GetXaxis()->SetRange(0,60); //hDif->GetXaxis()->SetTitleOffset(1.1); hDif->GetYaxis()->SetTitleOffset(1.8); //zAmm0->GetZaxis()->SetRangeUser(0,1.0); if(i<2) hDif->GetYaxis()->SetRangeUser(0,8000); else hDif->GetYaxis()->SetRangeUser(0,3000); //Trim0Sigmas2D->GetZaxis()->SetRangeUser(0,15); hDif->SetLineWidth(2); hDif->Draw(); hDifC->SetLineWidth(0); hDifC->SetFillColor(2); hDifC->SetLineColor(2); hDifC->Draw("same"); //c1->logy(); /* TH1F hDifO(*hDif); hDifO.Add(hDifC,-1.0); hDifO.SetLineColor(4); hDifO.SetLineStyle(1); hDifO.SetLineWidth(2); hDifO.Draw("same"); hDif->Draw("same"); */ c1->Update(); if(i==0) c1->Print("../dpwSpectrum.png"); if(i==1) c1->Print("../nodpwSpectrum.png"); if(i==2) c1->Print("../dpw05Spectrum.png"); if(i==3) c1->Print("../nodpw05Spectrum.png"); } else { if(i==4) TFile::Open("summaryDpw.root"); if(i==5) TFile::Open("summaryDpw05.root"); hDif->SetTitle(";Fraction of charge;Epitaxial layer volume (#mum^{3}/0.01)"); hDif->GetXaxis()->SetRange(26,60); hDif->GetYaxis()->SetTitleOffset(1.8); if(i==4) hDif->GetYaxis()->SetRangeUser(0,5000); if(i==5) hDif->GetYaxis()->SetRangeUser(0,1400); hDif->SetLineWidth(2); hDif->SetLineColor(2); hDif->Draw(); if(i==4) TFile::Open("summaryNodpw.root"); if(i==5) TFile::Open("summaryNodpw05.root"); hDif->SetLineStyle(2); hDif->SetLineWidth(2); hDif->SetLineColor(4); hDif->Draw("same"); TLatex t; t.SetTextSize(0.04); t.SetTextColor(2); if(i==4) t.DrawLatex(0.43,4500,"With deep P-well"); if(i==5) t.DrawLatex(0.43,1200,"With deep P-well"); t.SetTextColor(4); if(i==4) t.DrawLatex(0.43,4200,"Without deep P-well"); if(i==5) t.DrawLatex(0.43,1100,"Without deep P-well"); c1->Update(); if(i==4) c1->Print("../spectra12.png"); if(i==5) c1->Print("../spectra05.png"); } }