116 def draw_disk(geom1, geom2, endcap, station, filename, length_factor=1., angle_factor=100., colors=csc_colors, template_dir='./'):
118 disk_template = load_svg(template_dir +
"disk1_template.svg")
119 if station
in (2, 3):
120 disk_template = load_svg(template_dir +
"disk23_template.svg")
121 if endcap == 1
and station == 4:
122 disk_template = load_svg(template_dir +
"diskp4_template.svg")
123 if endcap == 2
and station == 4:
124 disk_template = load_svg(template_dir +
"diskm4_template.svg")
130 for treeindex, svgitem
in disk_template:
131 if isinstance(svgitem, SVG)
and "id" in svgitem.attr
and svgitem[
"id"] ==
"fakecenter":
136 for i, di
in enumerate(fakecenter.d):
137 if di[0]
in (
"M",
"L"):
144 for treeindex, svgitem
in disk_template:
145 if isinstance(svgitem, SVG)
and "id" in svgitem.attr
and svgitem[
"id"][:3] ==
"ME_":
146 m = re.match(
"ME_([0-9]+)_([0-9]+)", svgitem[
"id"])
147 if m
is None:
raise Exception
149 ring, chamber =
int(m.group(1)),
int(m.group(2))
150 xdiff = scale_factor * length_factor * (geom1.csc[endcap, station, ring, chamber].x - geom2.csc[endcap, station, ring, chamber].x) * signConventions[
"CSC", endcap, station, ring, chamber][0]
151 ydiff = -scale_factor * length_factor * (geom1.csc[endcap, station, ring, chamber].y - geom2.csc[endcap, station, ring, chamber].y) * signConventions[
"CSC", endcap, station, ring, chamber][1]
152 phizdiff = -angle_factor * (geom1.csc[endcap, station, ring, chamber].phiz - geom2.csc[endcap, station, ring, chamber].phiz) * signConventions[
"CSC", endcap, station, ring, chamber][2]
154 svgitem[
"style"] =
"fill:#e1e1e1;fill-opacity:1;stroke:#000000;stroke-width:1.0;stroke-dasharray:1, 1;stroke-dashoffset:0" 160 for i, di
in enumerate(newBox.d):
161 if not first
and di[0] ==
"m":
164 newBox.d[i] = tuple(di)
174 for i, di
in enumerate(newBox.d):
182 phipos = atan2(centery - originy, centerx - originx) - pi/2.
183 for i, di
in enumerate(newBox.d):
184 if di[0]
in (
"M",
"L"):
186 di[1] +=
cos(phipos)*xdiff -
sin(phipos)*ydiff
187 di[2] +=
sin(phipos)*xdiff +
cos(phipos)*ydiff
188 newBox.d[i] = tuple(di)
190 centerx +=
cos(phipos)*xdiff -
sin(phipos)*ydiff
191 centery +=
sin(phipos)*xdiff +
cos(phipos)*ydiff
193 for i, di
in enumerate(newBox.d):
194 if di[0]
in (
"M",
"L"):
196 dispx =
cos(phizdiff) * (di[1] - centerx) -
sin(phizdiff) * (di[2] - centery)
197 dispy =
sin(phizdiff) * (di[1] - centerx) +
cos(phizdiff) * (di[2] - centery)
198 di[1] = dispx + centerx
199 di[2] = dispy + centery
200 newBox.d[i] = tuple(di)
202 newBox = newBox.SVG()
203 newBox[
"style"] =
"fill:%s;fill-opacity:0.5;stroke:#000000;stroke-width:1.0;stroke-opacity:1;stroke-dasharray:none" %
colors(endcap, station, ring, chamber)
204 newBox[
"id"] = newBox[
"id"] +
"_moved" 206 new_boxes.append(newBox)
208 for treeindex, svgitem
in disk_template:
209 if isinstance(svgitem, SVG)
and svgitem.t ==
"g" and "id" in svgitem.attr
and svgitem[
"id"] ==
"chambers":
210 svgitem.append(new_boxes)
212 elif isinstance(svgitem, SVG)
and "id" in svgitem.attr
and svgitem[
"id"] ==
"diskx":
213 if endcap == 1: svgitem[0] =
"Disk %+d" % station
214 else: svgitem[0] =
"Disk %+d" % (-station)
215 svgitem[0] +=
" (length x%g, angle x%g)" % (length_factor, angle_factor)
217 disk_template.save(filename)
218 def draw_disk(geom1, geom2, endcap, station, filename, length_factor=1., angle_factor=100., colors=csc_colors, template_dir='./')
Sin< T >::type sin(const T &t)
Cos< T >::type cos(const T &t)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run