CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/Alignment/MuonAlignmentAlgorithms/scripts/geometryDiffVisualizer.py

Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 
00003 import sys, ROOT
00004 
00005 from geometryDiffVisualization import *
00006 
00007 ROOT.gROOT.SetBatch(1)
00008 
00009 cargs = sys.argv[:]
00010 
00011 if len(cargs) != 5:
00012   print "Makes schematic drawings of the detector in various projections with overlayed chambers"
00013   print "shifted and rotated by their correction amounts times some scale (geom2-geom1)"
00014   print "usage: ./geometryDiffVisualizer.py label svg_template_dir geometry2.xml geometry1.xml"
00015   print "The label will be included into the filenames as geoVisual_label__specifier.png"
00016   print ""
00017   sys.exit()
00018 
00019 label = cargs[1]
00020 svg_template_dir = cargs[2]
00021 
00022 xmlfile2 = cargs[3]
00023 xmlfile1 = cargs[4]
00024 
00025 g2 = MuonGeometry(xmlfile2)
00026 g1 = MuonGeometry(xmlfile1)
00027 
00028 pfx = "geoVisual__" + label + "__"
00029 sf_dt = 200.
00030 sf_csc = 100.
00031 
00032 draw_station(g2, g1, 1, pfx+"st_1_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
00033 draw_station(g2, g1, 2, pfx+"st_2_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
00034 draw_station(g2, g1, 3, pfx+"st_3_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
00035 draw_station(g2, g1, 4, pfx+"st_4_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
00036 
00037 draw_wheel(g2, g1, -2, pfx+"wh_a_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
00038 draw_wheel(g2, g1, -1, pfx+"wh_b_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
00039 draw_wheel(g2, g1,  0, pfx+"wh_c_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
00040 draw_wheel(g2, g1, +1, pfx+"wh_d_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
00041 draw_wheel(g2, g1, +2, pfx+"wh_e_DT.svg", length_factor=sf_dt, angle_factor=sf_dt, template_dir=svg_template_dir)
00042 
00043 draw_disk(g2, g1, 1, 1, pfx+"e1_st1_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
00044 draw_disk(g2, g1, 1, 2, pfx+"e1_st2_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
00045 draw_disk(g2, g1, 1, 3, pfx+"e1_st3_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
00046 draw_disk(g2, g1, 1, 4, pfx+"e1_st4_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
00047 draw_disk(g2, g1, 2, 1, pfx+"e2_st1_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
00048 draw_disk(g2, g1, 2, 2, pfx+"e2_st2_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
00049 draw_disk(g2, g1, 2, 3, pfx+"e2_st3_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)
00050 draw_disk(g2, g1, 2, 4, pfx+"e2_st4_CSC.svg", length_factor=sf_csc, angle_factor=sf_csc, template_dir=svg_template_dir)