{ #include #include // test program for induced charge by ATLAS SCT barrel strips // y = 0 for HV plane, y = d for strip plane // 2010.1.122 Taka Kondo (KEK) // library sub_functions.C c1 = new TCanvas("c1","A Simple Graph",0,0,700,500); c1->SetFillStyle(4100); c1->Divide(2,2); c1->cd(1); double x,y,q; for ( int i =0 ; i<4 ; i++) { c1->cd(i+1); x = 20. * i; if(i==0) x =5.; TH1F *g0 = new TH1F("g0","induced chargei strip 0",57, 0., 285.); TH1F *g1 = new TH1F("g1","induced chargei strip 1",57, 0., 285.); TH1F *g2 = new TH1F("g2","induced chargei strip 2",57, 0., 285.); TH1F *g3 = new TH1F("g3","induced chargei strip 3",57, 0., 285.); TH1F *g4 = new TH1F("g4","induced chargei strip 4",57, 0., 285.); for (y = 2.5; y<285; y+=5.){ for (int istrip = -1 ; istrip < 4; istrip +=1) { q = induced( istrip, x/10000., y/10000.); if (istrip==-1) g0->Fill(y, q); if (istrip==0) g1->Fill(y, q); if (istrip==1) g2->Fill(y, q); if (istrip==2) g3->Fill(y, q); if (istrip==3) g4->Fill(y, q); } } gStyle->SetOptStat(0); g0->SetMaximum(1.0); g0->SetMinimum(0.0); g0->GetXaxis()->SetTitle("Y [#mum]"); g0->GetXaxis()->SetTitleOffset(1.1); g0->GetYaxis()->SetTitle("Induced charge"); g0->GetYaxis()->SetTitleOffset(1.1); g0->SetLineColor(3); g0->Draw("L"); g1->SetLineColor(2); g1->Draw("SAME L"); g2->SetLineColor(4); g2->Draw("SAME L"); g3->SetLineColor(5); g3->Draw("SAME L"); g4->SetLineColor(6); g4->Draw("SAME L"); g0->Draw("SAME L"); t=new TLatex(100., 0.87,"Induced charge"); t->SetTextSize(0.06); t->Draw(); cid = new char[15]; sprintf(cid,"x = %d #mum",x);cid[14]=0; t=new TLatex(120., 0.80,cid); t->SetTextSize(0.06); t->Draw(); leg = new TLegend(0.19 ,0.35 ,0.35, 0.75); leg->SetFillColor(10);leg->SetBorderSize(1); leg->AddEntry(g0,"strip -1","l"); leg->AddEntry(g1,"strip 0","l"); leg->AddEntry(g2,"strip 1","l"); leg->AddEntry(g3,"strip 2","l"); leg->AddEntry(g4,"strip 3","l"); leg->SetTextSize(0.06); leg->Draw(); } }