// T. Kondo, 2010.4.19 updated 2020.8.7 void plot_dopeDependence() { int VB=-30; TCanvas *c1=new TCanvas("c1","canvas",0,0,700,500); c1->SetGrid(); c1->SetTopMargin(0.08); int n=0; char line[200]; double VFD[9], X[9], Ey[3][9], Rho[9]={}; double ymin=-500., ymax=500., xmin=10., xmax=0.; double x[3]={0.0, 20., 40.}; ifstream fin(Form("dopeDependence_%d.txt",VB)); fin.getline(line,sizeof(line)); while (fin >>VFD[n]>>Rho[n]>>Ey[0][n]>>Ey[1][n]>>Ey[2][n]) { if(Rho[n]> xmax) xmax = Rho[n]; if(Rho[n]< xmin) xmin = Rho[n]; n++; } fin.close(); cout<<"input ni="<GetXaxis()->SetTitle("Doping concentration [ Coulomb/m^{3} ]"); h1->GetXaxis()->SetTitleOffset(1.0); h1->GetYaxis()->SetTitle("Ey at y=0#mum [V/cm]"); if(VB<0) h1->GetYaxis()->SetTitle("Ey at y=285#mum [V/cm]"); double dx = 0.1*(xmax-xmin); xmax = xmax+dx; xmin = xmin-dx; h1->GetXaxis()->SetLimits(xmin,xmax); h1->SetMinimum(ymin); h1->SetMaximum(ymax); h1->Draw("ALP"); h2->SetLineColor(2); h2->SetMarkerColor(2); h3->SetLineColor(4); h3->SetMarkerColor(4); h2->Draw("SAME LP"); h3->Draw("SAME LP"); if(VB<0) leg = new TLegend(0.20,0.70,0.40,0.90); else leg = new TLegend(0.70,0.70,0.90,0.90); leg->AddEntry(h1,Form("x=%d#mum",int(x[0])),"lp"); leg->AddEntry(h2,Form("x=%d#mum",int(x[1])),"lp"); leg->AddEntry(h3,Form("x=%d#mum",int(x[2])),"lp"); leg->SetBorderSize(0); leg->Draw(); TLatex * z1=new TLatex(xmin, (ymax-ymin)*1.03+ymin, Form("SCT Barrel geometry : V_{B} = %dV",VB)); z1->Draw(); c1->Print(Form("dopeDependence_%d.png",VB)); return; }