{ #include #include // Electric field calculation, Taka Kondo (KEK) 2009.11.27, modidied 2010.1.17 // unit: nsec, cm, sec, K, c1 = new TCanvas("c1","A Simple Graph with error bars",0,0,700,500); c1->SetFillStyle(4100); c1->SetGrid(); c1->GetFrame()->SetBorderSize(12); double d = 0.0285; // [cm] double Vd = 65.0; // [V] double Vb; // [V] double Ey, Emax, y, wd; int nhist=200; double deltay=d/nhist; TH1F *hE = new TH1F("hE","Electric field",nhist,0,d*10000.); for (int i=0; i<10 ;i++) { Vb=10.+20.*i; TH1F *h = new TH1F("h","Electric field",nhist,0,d*10000.); for (y=deltay*0.5; yVd) { Emax = (Vb+Vd)/d ; //Ey = Emax - 2.*Vd*y/(d*d); //flat diode model Ey = Vb/d; //uniform field model } else { wd = sqrt(Vb/Vd) * d; Emax = 2.* wd * Vd /(d*d); //Ey = Emax*(1-y/wd); //flat diode model Ey = Vb/wd; //uniform field model if(y>wd) Ey=0.; //uniform field model } if(i == 0) hE->Fill((d-y)*10000,Ey); else h->Fill((d-y)*10000., Ey); } gStyle->SetOptStat(0); hE->SetMaximum(10000.); hE->SetMinimum(0.); hE->SetTitle(); hE->SetXTitle("depth [#mum]"); hE->SetYTitle("Electric Filed [V/cm]"); hE->GetYaxis()->SetTitleOffset(1.5); hE->GetXaxis()->SetTitleOffset(1.0); if(Vb==150.) h->SetLineColor(2); if(i == 0) hE ->Draw("L"); else h->Draw("SAME L"); } b = new TBox(75., 8900., 220., 9600.); b->SetFillColor(10); b->Draw(); TLatex *t=new TLatex(80., 9100.,"Uniform field model (V_{D} = 65 V)");t->SetTextSize(0.04); t->Draw(); TLatex *t=new TLatex(225., 1000.,"10 V");t->SetTextSize(0.04); t->Draw(); TLatex *t=new TLatex(225., 1600.,"30 V");t->SetTextSize(0.04); t->Draw(); TLatex *t=new TLatex(225., 2050.,"50 V");t->SetTextSize(0.04); t->Draw(); TLatex *t=new TLatex(225., 2550.,"70 V");t->SetTextSize(0.04); t->Draw(); TLatex *t=new TLatex(225., 3250.,"90 V");t->SetTextSize(0.04); t->Draw(); TLatex *t=new TLatex(220., 4000.,"110 V");t->SetTextSize(0.04); t->Draw(); TLatex *t=new TLatex(220., 4700.,"130 V");t->SetTextSize(0.04); t->Draw(); TLatex *t=new TLatex(220., 5400.,"150 V");t->SetTextSize(0.04); t->SetTextColor(2);t->Draw(); TLatex *t=new TLatex(220., 6100.,"170 V");t->SetTextSize(0.04); t->Draw(); TLatex *t=new TLatex(200., 6850.,"V_{B} = 190 V");t->SetTextSize(0.04); t->Draw(); }