Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:39:48

0001 #! /usr/bin/env python3
0002 
0003 from __future__ import print_function
0004 import sys, ROOT
0005 
0006 from geometryDiffVisualization import *
0007 
0008 ROOT.gROOT.SetBatch(1)
0009 
0010 cargs = sys.argv[:]
0011 
0012 if len(cargs) != 5:
0013   print("Makes schematic drawings of the detector in various projections with overlayed chambers")
0014   print("shifted and rotated by their correction amounts times some scale (geom2-geom1)")
0015   print("usage: ./geometryDiffVisualizer.py label svg_template_dir geometry2.xml geometry1.xml")
0016   print("The label will be included into the filenames as geoVisual_label__specifier.png")
0017   print("")
0018   sys.exit()
0019 
0020 label = cargs[1]
0021 svg_template_dir = cargs[2]
0022 
0023 xmlfile2 = cargs[3]
0024 xmlfile1 = cargs[4]
0025 
0026 g2 = MuonGeometry(xmlfile2)
0027 g1 = MuonGeometry(xmlfile1)
0028 
0029 pfx = "geoVisual__" + label + "__"
0030 sf_dt = 200.
0031 sf_csc = 100.
0032 
0033 draw_station(g2, g1, 1, pfx+"st_1_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
0034 draw_station(g2, g1, 2, pfx+"st_2_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
0035 draw_station(g2, g1, 3, pfx+"st_3_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
0036 draw_station(g2, g1, 4, pfx+"st_4_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
0037 
0038 draw_wheel(g2, g1, -2, pfx+"wh_a_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
0039 draw_wheel(g2, g1, -1, pfx+"wh_b_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
0040 draw_wheel(g2, g1,  0, pfx+"wh_c_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
0041 draw_wheel(g2, g1, +1, pfx+"wh_d_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
0042 draw_wheel(g2, g1, +2, pfx+"wh_e_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
0043 
0044 draw_disk(g2, g1, 1, 1, pfx+"e1_st1_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
0045 draw_disk(g2, g1, 1, 2, pfx+"e1_st2_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
0046 draw_disk(g2, g1, 1, 3, pfx+"e1_st3_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
0047 draw_disk(g2, g1, 1, 4, pfx+"e1_st4_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
0048 draw_disk(g2, g1, 2, 1, pfx+"e2_st1_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
0049 draw_disk(g2, g1, 2, 2, pfx+"e2_st2_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
0050 draw_disk(g2, g1, 2, 3, pfx+"e2_st3_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
0051 draw_disk(g2, g1, 2, 4, pfx+"e2_st4_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)