//----------------------------------------------------------------- // Simplified version of plan view of Hall A beam dump. // Script based on David's DrawGlueXBoundaries script // Updated to conform to most recent Root norms 3/24/2016. Also modified to use C1 concept // //----------------------------------------------------------------- void SiPM_test_setup_plan() { // gStyle->SetPadRightMargin(0.15); // gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); // float zmin = 0; // float zmax=3200; float zmin = 0; float zmax=100; float xmin= -20; float xmax=25; float fudge=1; float scale = fudge*(zmax-zmin)/(xmax-xmin); printf ("Scale factor =%f\n",scale); TCanvas *c1 = new TCanvas("c1","SiPM_test_setup_plan",200,10,500*scale,500); TH2D *boundaries = new TH2D("boundaries", "",zmax-zmin, zmin, zmax, xmax-xmin, xmin, xmax); boundaries->SetStats(0); boundaries->SetXTitle("Z (cm)"); boundaries->GetYaxis()->SetLabelSize(0.05); boundaries->GetYaxis()->SetTitleSize(0.07); boundaries->GetYaxis()->SetTitleOffset(0.4); boundaries->GetXaxis()->SetLabelSize(0.05); boundaries->GetXaxis()->SetTitleSize(0.07); boundaries->GetXaxis()->SetTitleOffset(0.8); boundaries->SetYTitle("X (cm)"); boundaries->Draw(); TLine *beamline = new TLine (zmin,0,zmax,0); beamline->SetLineStyle(4); beamline->Draw(); Int_t Npoints=10; float ylaser1 = 5./2; // half width of laser float ylaser2 = 2.5/2.; // half width of laser float zlaser = 20; // beginning of laser float Ltube = 3.81; // length of laser tube float Llaser = 15.2; // length of laser #define yc yc1 #define zc zc1 float yc[]={0,ylaser1,ylaser1,ylaser2,ylaser2,-ylaser2,-ylaser2,-ylaser1,-ylaser1,0}; float zc[]={zlaser,zlaser,zlaser+Llaser-Ltube,zlaser+Llaser-Ltube,zlaser+Llaser,zlaser+Llaser,zlaser+Llaser-Ltube,zlaser+Llaser-Ltube,zlaser,zlaser}; TPolyLine *laser = new TPolyLine(Npoints, zc, yc); laser->SetLineWidth(2.0); laser->SetLineColor(kBlack); laser->Draw("l"); laser->SetFillColor(590); laser->Draw("f"); Npoints = 6; float yfilter = 1.25; float zfilter = 37.4; float Lfilter = 3; #undef yc #undef zc #define yc yc1a #define zc zc1a float yc[]={0,yfilter,yfilter,-yfilter,-yfilter,0}; float zc[]={zfilter,zfilter,zfilter+Lfilter,zfilter+Lfilter,zfilter,zfilter}; TPolyLine *filter = new TPolyLine(Npoints, zc, yc); filter->SetLineWidth(2.0); filter->SetLineColor(kBlack); filter->Draw("l"); filter->SetFillColor(590); filter->Draw("f"); /*TMarker *MarkWell1 = new TMarker(zwell1,ywell1,2); MarkWell1->SetMarkerColor(2); MarkWell1->SetMarkerSize(2); MarkWell1->Draw();*/ #undef yc #undef zc #define yc yc1b #define zc zc1b float ydiffuser = 2.5; float zdiffuser = 50.4; float Ldiffuser = 0.5; float yc[]={0,ydiffuser,ydiffuser,-ydiffuser,-ydiffuser,0}; float zc[]={zdiffuser,zdiffuser,zdiffuser+Ldiffuser,zdiffuser+Ldiffuser,zdiffuser,zdiffuser}; TPolyLine *diffuser = new TPolyLine(Npoints, zc, yc); diffuser->SetLineWidth(2.0); diffuser->SetLineColor(kBlack); diffuser->Draw("l"); diffuser->SetFillColor(590); diffuser->Draw("f"); // bottom of SiPM module #undef yc #undef zc #define yc yc1c #define zc zc1c float ysipm = 8.25/2; float offsetsipm = 0; float zsipm = 70.1; float Lsipm = 5; float yc[]={0+offsetsipm,ysipm+offsetsipm,ysipm+offsetsipm,-ysipm+offsetsipm,-ysipm+offsetsipm,0+offsetsipm}; float zc[]={zsipm,zsipm,zsipm+Lsipm,zsipm+Lsipm,zsipm,zsipm}; TPolyLine *sipm = new TPolyLine(Npoints, zc, yc); sipm->SetLineWidth(2.0); sipm->SetLineColor(kBlack); sipm->Draw("l"); sipm->SetFillColor(590); sipm->Draw("f"); // top of SiPM module #undef yc #undef zc #define yc yc1f #define zc zc1f float ysipm2 = 11.4/2; float offsetsipm2 = 0; float zsipm2 = 70.1; float Lsipm2 = 5; float yc[]={0+offsetsipm2,ysipm2+offsetsipm2,ysipm2+offsetsipm2,-ysipm2+offsetsipm2,-ysipm2+offsetsipm2,0+offsetsipm2}; float zc[]={zsipm2,zsipm2,zsipm2+Lsipm2,zsipm2+Lsipm2,zsipm2,zsipm2}; TPolyLine *sipm2 = new TPolyLine(Npoints, zc, yc); sipm2->SetLineWidth(2.0); sipm2->SetLineColor(kBlack); sipm2->Draw("l"); // sipm2->SetFillColor(590); // sipm2->Draw("f"); #undef yc #undef zc #define yc yc1d #define zc zc1d float ysiarray = 1.2/2.; float offsetsiarray = -3.25; float zsiarray = 70.1; float Lsiarray = 1; float yc[]={0+offsetsiarray,ysiarray+offsetsiarray,ysiarray+offsetsiarray,-ysiarray+offsetsiarray,-ysiarray+offsetsiarray,0+offsetsiarray}; float zc[]={zsiarray,zsiarray,zsiarray+Lsiarray,zsiarray+Lsiarray,zsiarray,zsiarray}; TPolyLine *siarray = new TPolyLine(Npoints, zc, yc); siarray->SetLineWidth(2.0); siarray->SetLineColor(kRed); siarray->Draw("l"); siarray->SetFillColor(kRed); siarray->Draw("f"); TString string; string.Form("Laser"); float toffset=-15; TLatex *t3 = new TLatex(zlaser,toffset,string); t3->SetTextSize(0.07); t3->Draw(); t3->DrawLatex(zfilter-2,toffset,"filter(s)"); t3->DrawLatex(zdiffuser-2,toffset,"diffuser"); t3->DrawLatex(zsiarray,toffset,"SiPM A0"); c1->SaveAs("SiPM_test_setup_plan.pdf"); c1->SaveAs("SiPM_test_setup_plan.png"); }