{ #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,qHV, qtotal; for ( int i =0 ; i<4 ; i++) { c1->cd(i+1); x = 15. * i; // h1->Reset(); h2->Reset(); h3->Reset(); // g0->Reset(); g1->Reset(); g2->Reset();g3->Reset();g4->Reset(); TH1F *h1 = new TH1F("h1","induced charge",57, 0., 285.); TH1F *h2 = new TH1F("h2","induced charge HV",57, 0., 285.); TH1F *h3 = new TH1F("h3","induced charge total",57, 0., 285.); 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.){ qHV = inducedHV( 0, x/10000., y/10000.); qtotal = 0.; for (int istrip = -9 ; istrip < 9; istrip +=1) { q = induced( istrip, x/10000., y/10000.); qtotal += q; if (istrip==0) g0->Fill(y, q); if (istrip==1) g1->Fill(y, q); if (istrip==2) g2->Fill(y, q); if (istrip==3) g3->Fill(y, q); if (istrip==4) g4->Fill(y, q); } h2->Fill(y, qtotal); h1->Fill(y, qHV); h3->Fill(y, qtotal+qHV); } gStyle->SetOptStat(0); h1->SetMaximum(1.0); h1->SetMinimum(0.0); h1->GetXaxis()->SetTitle("Y [#mum]"); h1->GetXaxis()->SetTitleOffset(1.1); h1->GetYaxis()->SetTitle("Induced charge"); h1->GetYaxis()->SetTitleOffset(1.1); h1->Draw("L"); h2->SetLineStyle(2); h2->Draw("SAME L"); h3->SetLineStyle(3); //h3->Draw("SAME L"); g0->SetLineColor(2); g0->Draw("SAME L"); g1->SetLineColor(3); 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(h1,"HV ","l"); leg->AddEntry(g0,"strip 0","l"); leg->AddEntry(g1,"strip 1","l"); leg->AddEntry(g2,"strip 2","l"); leg->AddEntry(g3,"strip 3","l"); leg->AddEntry(g4,"strip 4","l"); leg->SetTextSize(0.06); leg->Draw(); }