#include "StandardLabels.C" #include "GlueX_boundaries.C" void Bmag_tof(string mess="") { gROOT->Reset(); gStyle->SetPadRightMargin(0.15); TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGrid(); TFile *f = new TFile("bfield.root"); TH2D *Btot_vs_r_vs_z_tof = (TH2D*)gROOT->FindObject("Btot_vs_r_vs_z_tof"); Btot_vs_r_vs_z_tof->GetZaxis()->SetRangeUser(0.0, 60.0); Btot_vs_r_vs_z_tof->GetZaxis()->SetTitleOffset(1.2); // Convert to Gauss Btot_vs_r_vs_z_tof->Scale(10000.0); Btot_vs_r_vs_z_tof->SetTitle("Magnetic Field Magnitude"); Btot_vs_r_vs_z_tof->SetZTitle("B-field magnitude (Gauss)"); Btot_vs_r_vs_z_tof->Draw("colz"); //DrawGlueXBoundaries(); // Draw TOF double Zlo = 616.25; double Zhi = Zlo + 2.0*2.54; double Rlo = Btot_vs_r_vs_z_tof->GetYaxis()->GetXmin(); double Rhi = 252.0/2.0; TBox *box = new TBox(Zlo, Rlo, Zhi, Rhi); box->SetLineWidth(2.0); box->SetFillColor(0); box->SetFillStyle(0); box->SetLineColor(kBlack); box->Draw(); // Draw Light guides int Npts = 8; double r[] = {126.0, 138.0, 145.0, 155.0, 155.0, 145.0, 138.0, 126.0}; double z[] = { 1.03, 1.03, 0.0, 0.0, 4.6, 4.6, 3.57, 3.57}; for(unsigned int i=0; iSetLineWidth(2); lg->Draw(); TBox *box = new TBox(z[3], r[3], z[4], r[4]+20.0); box->SetLineWidth(2.0); box->SetFillColor(0); box->SetFillStyle(0); box->SetLineColor(kBlack); box->Draw(); TLatex *l = new TLatex((z[3]+z[4])/2.0, r[4]+10.0, "PMT"); l->SetTextSize(0.045); l->SetTextAngle(90.0); l->SetTextAlign(22); l->Draw(); TLatex *l = new TLatex((Zlo+Zhi)/2.0, 100.0, "TOF"); l->SetTextSize(0.045); l->SetTextAngle(90.0); l->SetTextAlign(22); l->Draw(); StandardLabels2D(Btot_vs_r_vs_z_tof, mess); // Save c1->SaveAs("Bmag_tof.pdf"); c1->SaveAs("Bmag_tof.gif"); }