Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
athena
Manage
Activity
Members
Labels
Plan
Issues
38
Issue boards
Milestones
Wiki
Code
Merge requests
34
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
detectors
athena
Commits
c209fecd
Commit
c209fecd
authored
3 years ago
by
Chao Peng
Browse files
Options
Downloads
Patches
Plain Diff
reduce number of SciGlass modules to avoid overlaps with barrel
parent
e7a63ba1
No related branches found
No related tags found
1 merge request
!58
reduce number of SciGlass modules to avoid overlaps with barrel
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compact/ce_ecal_crystal_glass.xml
+9
-9
9 additions, 9 deletions
compact/ce_ecal_crystal_glass.xml
scripts/ce_ecal_placement.py
+17
-12
17 additions, 12 deletions
scripts/ce_ecal_placement.py
with
26 additions
and
21 deletions
compact/ce_ecal_crystal_glass.xml
+
9
−
9
View file @
c209fecd
...
...
@@ -56,11 +56,11 @@
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*1/2."
z=
"GlassModule_z0"
begin=
"12"
nmods=
"11"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*3/2."
z=
"GlassModule_z0"
begin=
"12"
nmods=
"11"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*5/2."
z=
"GlassModule_z0"
begin=
"12"
nmods=
"11"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*7/2."
z=
"GlassModule_z0"
begin=
"11"
nmods=
"1
2
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*9/2."
z=
"GlassModule_z0"
begin=
"11"
nmods=
"1
2
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*11/2."
z=
"GlassModule_z0"
begin=
"11"
nmods=
"1
2
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*7/2."
z=
"GlassModule_z0"
begin=
"11"
nmods=
"1
1
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*9/2."
z=
"GlassModule_z0"
begin=
"11"
nmods=
"1
1
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*11/2."
z=
"GlassModule_z0"
begin=
"11"
nmods=
"1
1
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*13/2."
z=
"GlassModule_z0"
begin=
"10"
nmods=
"12"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*15/2."
z=
"GlassModule_z0"
begin=
"9"
nmods=
"1
3
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*15/2."
z=
"GlassModule_z0"
begin=
"9"
nmods=
"1
2
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*17/2."
z=
"GlassModule_z0"
begin=
"8"
nmods=
"13"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*19/2."
z=
"GlassModule_z0"
begin=
"7"
nmods=
"14"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*21/2."
z=
"GlassModule_z0"
begin=
"6"
nmods=
"14"
/>
...
...
@@ -68,14 +68,14 @@
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*25/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"19"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*27/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"18"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*29/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"18"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*31/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"1
7
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*33/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"1
7
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*35/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"1
5
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*31/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"1
6
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*33/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"1
6
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*35/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"1
4
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*37/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"13"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*39/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"11"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*41/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"10"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*43/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"
8
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*45/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"
6
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*43/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"
7
"
/>
<line
axis=
"x"
x=
"GlassModule_dx/2."
y=
"GlassModule_dy*45/2."
z=
"GlassModule_z0"
begin=
"0"
nmods=
"
3
"
/>
</lines>
</placements>
</detector>
...
...
This diff is collapsed.
Click to expand it.
scripts/ce_ecal_placement.py
+
17
−
12
View file @
c209fecd
...
...
@@ -29,12 +29,12 @@ CRYSTAL_ALIGNMENT = [
GLASS_SIZE
=
(
40.
,
40.
,
400.
)
# mm
GLASS_GAP
=
1.0
# mm
GLASS_ALIGNMENT
=
[
(
12
,
11
),
(
12
,
11
),
(
12
,
11
),
(
11
,
1
2
),
(
11
,
1
2
),
(
11
,
1
2
),
(
10
,
12
),
(
9
,
1
3
),
(
12
,
11
),
(
12
,
11
),
(
12
,
11
),
(
11
,
1
1
),
(
11
,
1
1
),
(
11
,
1
1
),
(
10
,
12
),
(
9
,
1
2
),
(
8
,
13
),
(
7
,
14
),
(
6
,
14
),
(
3
,
16
),
(
0
,
19
),
(
0
,
18
),
(
0
,
18
),
(
0
,
1
7
),
(
0
,
1
7
),
(
0
,
1
5
),
(
0
,
13
),
(
0
,
11
),
(
0
,
10
),
(
0
,
8
),
(
0
,
6
),
(
0
,
19
),
(
0
,
18
),
(
0
,
18
),
(
0
,
1
6
),
(
0
,
1
6
),
(
0
,
1
4
),
(
0
,
13
),
(
0
,
11
),
(
0
,
10
),
(
0
,
7
),
(
0
,
3
),
]
# calculate positions of modules with a quad-alignment and module size
...
...
@@ -52,22 +52,26 @@ def individual_placement(alignment, module_x, module_y, gap=0.):
def
draw_placement
(
axis
,
colors
=
(
'
teal
'
),
module_alignment
=
((
CRYSTAL_SIZE
,
CRYSTAL_GAP
,
CRYSTAL_ALIGNMENT
))):
xmin
,
ymin
,
xmax
,
ymax
=
0.
,
0.
,
0.
,
0.
patches
=
[]
numbers
=
[]
for
color
,
(
mod_size
,
mod_gap
,
alignment
)
in
zip
(
colors
,
module_alignment
):
placements
=
individual_placement
(
alignment
,
*
mod_size
[:
2
],
mod_gap
)
boxes
=
[
Rectangle
((
x
-
(
mod_size
[
0
]
+
mod_gap
)
/
2.
,
y
-
(
mod_size
[
1
]
+
mod_gap
)
/
2.
),
mod_size
[
0
],
mod_size
[
1
])
for
x
,
y
in
placements
]
patches
.
append
(
Rectangle
((
0.
,
0.
),
*
mod_size
[:
2
],
facecolor
=
color
,
alpha
=
0.5
,
edgecolor
=
'
k
'
))
numbers
.
append
(
len
(
placements
))
pc
=
PatchCollection
(
boxes
,
facecolor
=
color
,
alpha
=
0.5
,
edgecolor
=
'
k
'
)
xmin
=
min
(
xmin
,
placements
.
T
[
0
].
min
()
-
3
.
*
(
mod_size
[
0
]
+
mod_gap
))
ymin
=
min
(
ymin
,
placements
.
T
[
1
].
min
()
-
3
.
*
(
mod_size
[
1
]
+
mod_gap
))
xmax
=
max
(
xmax
,
placements
.
T
[
0
].
max
()
+
3
.
*
(
mod_size
[
0
]
+
mod_gap
))
ymax
=
max
(
ymax
,
placements
.
T
[
1
].
max
()
+
3
.
*
(
mod_size
[
1
]
+
mod_gap
))
xmin
=
min
(
xmin
,
placements
.
T
[
0
].
min
()
-
8
.
*
(
mod_size
[
0
]
+
mod_gap
))
ymin
=
min
(
ymin
,
placements
.
T
[
1
].
min
()
-
8
.
*
(
mod_size
[
1
]
+
mod_gap
))
xmax
=
max
(
xmax
,
placements
.
T
[
0
].
max
()
+
8
.
*
(
mod_size
[
0
]
+
mod_gap
))
ymax
=
max
(
ymax
,
placements
.
T
[
1
].
max
()
+
8
.
*
(
mod_size
[
1
]
+
mod_gap
))
# Add collection to axes
axis
.
add_collection
(
pc
)
axis
.
set_xlim
(
xmin
,
xmax
)
axis
.
set_ylim
(
ymin
,
ymax
)
return
axis
return
axis
,
patches
,
numbers
def
compact_constants
(
path
,
names
):
...
...
@@ -261,13 +265,14 @@ if __name__ == '__main__':
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
12
,
12
),
dpi
=
160
)
ax
=
draw_placement
(
ax
,
[
'
teal
'
,
'
royalblue
'
],
[(
CRYSTAL_SIZE
,
CRYSTAL_GAP
,
CRYSTAL_ALIGNMENT
),
(
GLASS_SIZE
,
GLASS_GAP
,
GLASS_ALIGNMENT
)])
ax
,
patches
,
nblocks
=
draw_placement
(
ax
,
[
'
teal
'
,
'
royalblue
'
],
[(
CRYSTAL_SIZE
,
CRYSTAL_GAP
,
CRYSTAL_ALIGNMENT
),
(
GLASS_SIZE
,
GLASS_GAP
,
GLASS_ALIGNMENT
)])
ax
.
set_xlabel
(
'
x (mm)
'
,
fontsize
=
24
)
ax
.
set_ylabel
(
'
y (mm)
'
,
fontsize
=
24
)
ax
.
tick_params
(
direction
=
'
in
'
,
labelsize
=
22
,
which
=
'
both
'
)
ax
.
set_axisbelow
(
True
)
ax
.
grid
(
linestyle
=
'
:
'
,
which
=
'
both
'
)
ax
.
legend
(
patches
,
[
'
{} {}
'
.
format
(
num
,
name
)
for
num
,
name
in
zip
(
nblocks
,
[
'
PbWO$_4$
'
,
'
SciGlass
'
])],
fontsize
=
24
)
if
args
.
compact
and
args
.
radii
:
names
=
[
c
.
strip
()
for
c
in
args
.
radii
.
split
(
'
,
'
)]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment