Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:30

0001 from __future__ import print_function
0002 from builtins import range
0003 mep11angle = 0.002  # guess
0004 mep12angle = 0.002  # guess
0005 mep13angle = 0.002  # guess
0006 mep21angle = 0.00239
0007 mep22angle = 0.00273
0008 mep31angle = 0.00230
0009 mep32angle = 0.00263
0010 mep41angle = 0.00208
0011 mep42angle = 0.002  # guess
0012 mem11angle = 0.002  # guess
0013 mem12angle = 0.002  # guess
0014 mem13angle = 0.002  # guess
0015 mem21angle = 0.00261
0016 mem22angle = 0.00303
0017 mem31angle = 0.00237
0018 mem32angle = 0.00288
0019 mem41angle = 0.00221
0020 mem42angle = 0.002  # guess
0021 
0022 evenDiskToChamberCenter = 35.4
0023 oddDiskToChamberCenter = 10.6
0024 
0025 ye1_halfwidth = 30.0  # guess
0026 ye2_halfwidth = 30.0
0027 ye3_halfwidth = 11.5
0028 
0029 for endcap, station, ring, angle in (1, 1, 1, mep11angle), (1, 1, 4, mep11angle), (1, 1, 2, mep12angle), (1, 1, 3, mep13angle), (1, 2, 1, mep21angle), (1, 2, 2, mep22angle), (1, 3, 1, mep31angle), (1, 3, 2, mep32angle), (1, 4, 1, mep41angle), (1, 4, 2, mep42angle), (2, 1, 1, mem11angle), (2, 1, 4, mem11angle), (2, 1, 2, mem12angle), (2, 1, 3, mem13angle), (2, 2, 1, mem21angle), (2, 2, 2, mem22angle), (2, 3, 1, mem31angle), (2, 3, 2, mem32angle), (2, 4, 1, mem41angle), (2, 4, 2, mem42angle):
0030     if angle != 0.:
0031         numchambers = 36
0032         if station > 1 and ring == 1: numchambers = 18
0033 
0034         if station == 1: halfwidth = ye1_halfwidth
0035         elif station in (2, 3): halfwidth = ye2_halfwidth
0036         elif station == 4: halfwidth = ye3_halfwidth
0037 
0038         for cham in range(1, numchambers+1):
0039             if cham % 2 == 0: diskToChamberCenter = evenDiskToChamberCenter + halfwidth
0040             else: diskToChamberCenter = oddDiskToChamberCenter + halfwidth
0041             radial_correction = angle * diskToChamberCenter
0042             angle_correction = -angle
0043 
0044             if station == 3 or station == 4:
0045                 radial_correction *= -1.
0046                 angle_correction *= -1.
0047 
0048             print("""<operation>
0049     <CSCChamber endcap="%(endcap)d" station="%(station)d" ring="%(ring)d" chamber="%(cham)d" />
0050     <movelocal x="0." y="%(radial_correction)g" z="0." />
0051 </operation>
0052 
0053 <operation>
0054     <CSCChamber endcap="%(endcap)d" station="%(station)d" ring="%(ring)d" chamber="%(cham)d" />
0055     <rotatelocal axisx="1." axisy="0." axisz="0." angle="%(angle_correction)g" />
0056 </operation>
0057 """ % vars())