{ #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","Electric field2",80,0.,400.,114,0.,285.); double x,y,P; for (int k=0; k<80; k++){ //for (int k=0; k<1; k++){ for (int i=0; i<117; i++){ x = 5.*(k+0.5); y = 2.5*(i + 0.5); 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.0); hE2->SetYTitle("Y [#mum]"); hE2->GetYaxis()->SetTitleOffset(1.2); gStyle->SetPalette(1); hE2->Draw("COLZ"); // 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.pdf"); }