CMS 3D CMS Logo

geometryDiffVisualizer.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 from __future__ import print_function
4 import sys, ROOT
5 
6 from geometryDiffVisualization import *
7 
8 ROOT.gROOT.SetBatch(1)
9 
10 cargs = sys.argv[:]
11 
12 if len(cargs) != 5:
13  print("Makes schematic drawings of the detector in various projections with overlayed chambers")
14  print("shifted and rotated by their correction amounts times some scale (geom2-geom1)")
15  print("usage: ./geometryDiffVisualizer.py label svg_template_dir geometry2.xml geometry1.xml")
16  print("The label will be included into the filenames as geoVisual_label__specifier.png")
17  print("")
18  sys.exit()
19 
20 label = cargs[1]
21 svg_template_dir = cargs[2]
22 
23 xmlfile2 = cargs[3]
24 xmlfile1 = cargs[4]
25 
26 g2 = MuonGeometry(xmlfile2)
27 g1 = MuonGeometry(xmlfile1)
28 
29 pfx = "geoVisual__" + label + "__"
30 sf_dt = 200.
31 sf_csc = 100.
32 
33 draw_station(g2, g1, 1, pfx+"st_1_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
34 draw_station(g2, g1, 2, pfx+"st_2_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
35 draw_station(g2, g1, 3, pfx+"st_3_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
36 draw_station(g2, g1, 4, pfx+"st_4_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
37 
38 draw_wheel(g2, g1, -2, pfx+"wh_a_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
39 draw_wheel(g2, g1, -1, pfx+"wh_b_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
40 draw_wheel(g2, g1, 0, pfx+"wh_c_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
41 draw_wheel(g2, g1, +1, pfx+"wh_d_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
42 draw_wheel(g2, g1, +2, pfx+"wh_e_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
43 
44 draw_disk(g2, g1, 1, 1, pfx+"e1_st1_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
45 draw_disk(g2, g1, 1, 2, pfx+"e1_st2_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
46 draw_disk(g2, g1, 1, 3, pfx+"e1_st3_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
47 draw_disk(g2, g1, 1, 4, pfx+"e1_st4_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
48 draw_disk(g2, g1, 2, 1, pfx+"e2_st1_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
49 draw_disk(g2, g1, 2, 2, pfx+"e2_st2_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
50 draw_disk(g2, g1, 2, 3, pfx+"e2_st3_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
51 draw_disk(g2, g1, 2, 4, pfx+"e2_st4_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
geometryXMLparser.MuonGeometry
Definition: geometryXMLparser.py:99
geometryDiffVisualization.draw_wheel
def draw_wheel(geom1, geom2, wheel, filename, length_factor=100., angle_factor=100., colors=dt_colors, template_dir='./')
Definition: geometryDiffVisualization.py:72
geometryDiffVisualization.draw_station
def draw_station(geom1, geom2, station, filename, length_factor=100., angle_factor=100., colors=dt_colors, template_dir='./')
Definition: geometryDiffVisualization.py:14
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
geometryDiffVisualization.draw_disk
def draw_disk(geom1, geom2, endcap, station, filename, length_factor=1., angle_factor=100., colors=csc_colors, template_dir='./')
Definition: geometryDiffVisualization.py:116