{ #include #include // Electric field calculation, Taka Kondo (KEK) 2009.11.27 // unit: nsec, cm, sec, K, gROOT->LoadMacro("AtlasUtils.C"); ATLAS->SetPadRightMargin(0.20); c1 = new TCanvas("c1","A Simple Graph with error bars",0,0,700,500); c1->GetFrame()->SetBorderSize(12); // TH2F *hE2 = new TH2F("hE2","P2",160,-160.,240.,114,0.,285.); //TH2F *hE2 = new TH2F("hE2","P2",16,-160.,240.,19,0.,285.); double x,y,P; for (int k=0; k<160; k++){ //for (int k=0; k<160; k+=10){ for (int i=0; i<114; i++){ //for (int i=0; i<114; i+=6){ x = 2.5.*(k + 0.5)-160.; y = 2.5*(i + 0.99); P=Ramo_potential( x/10000., y/10000.); if(i==0) cout<<"x,y,P="<Fill(x,y,P); } } hE2->SetXTitle("X [#mum]"); hE2->GetXaxis()->SetTitleOffset(1.5); hE2->SetYTitle("Y [#mum]"); hE2->GetYaxis()->SetTitleOffset(1.8); hE2->SetOption("surf4"); hE2->SetMinimum(0.); hE2->SetMaximum(1.); hE2->Draw(); // TLatex *t=new TLatex(490.,60.,"Weighting Potential"); t->SetTextAngle(90.); t->SetTextSize(0.05); t->Draw(); // zb=new TBox(30.,285.,50., 287.); zb->SetFillColor(1); zb->Draw(); zb=new TBox(110.,285.,130., 287.); zb->SetFillColor(1); zb->Draw(); zb=new TBox(190.,285.,210., 287.); zb->SetFillColor(1); zb->Draw(); zb=new TBox(270.,285.,290., 287.); zb->SetFillColor(1); zb->Draw(); zb=new TBox(350.,285.,370., 287.); zb->SetFillColor(1); zb->Draw(); c1->Print("P_2D_surf.png"); }