Skip to content

Commit 747bda7

Browse files
committed
added colors to cherenkov, using 1 thread only for demo
1 parent eaa3fb2 commit 747bda7

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

examples/basic/b1/b1.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
gvolume.material = 'G4_AIR'
1111
gvolume.color = '889922'
1212
gvolume.style = 0
13+
gvolume.opacity = 0.1
1314
gvolume.publish(cfg)
1415

1516
gvolume = GVolume('Envelope')
@@ -48,9 +49,9 @@
4849
gvolume.description = 'B1 Shape2'
4950
gvolume.make_trapezoid(shape2_dxa * 0.5, shape2_dxb * 0.5, shape2_dya * 0.5, shape2_dyb * 0.5, shape2_dz * 0.5)
5051
gvolume.material = 'G4_BONE_COMPACT_ICRU'
51-
gvolume.color = 'lightgray'
52+
gvolume.color = 'lightpink'
5253
gvolume.set_position(0, -10, 70)
5354
gvolume.digitization = 'dosimeter' # collects edep, dose
5455
gvolume.set_identifier('mydosimeter', 1)
55-
gvolume.opacity = 0.1
56+
gvolume.opacity = 0.7
5657
gvolume.publish(cfg)

examples/optical/cherenkov/cherenkov.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
"CO2": "50*m 50*m 40*m 30*m 20*m",
2828
"C4F10": "6*m 6*m 6*m 5*m 4*m",
2929
}
30+
colors = {
31+
"CF4": "red",
32+
"CO2": "blue",
33+
"C4F10": "green"
34+
}
3035

3136
material_definitions = {
3237
"CF4": {
@@ -80,16 +85,15 @@
8085
world.description = "Air world for Cherenkov validation"
8186
world.make_box(600, 600, 600)
8287
world.material = "G4_AIR"
83-
world.color = "ghostwhite"
84-
world.style = 0
88+
world.visible = 0
8589
world.publish(cfg)
8690

8791
radiator = GVolume("radiator")
8892
radiator.mother = "root"
8993
radiator.description = f"1 m cube radiator using {material}"
9094
radiator.make_box(500, 500, 500)
9195
radiator.material = material
92-
radiator.color = "66ccff"
96+
radiator.color = colors[material]
9397
radiator.style = 2
9498
radiator.publish(cfg)
9599

@@ -105,7 +109,7 @@
105109
# by crossing into a material without matching optical properties.
106110
backplate.material = material
107111

108-
backplate.color = "lightgray"
112+
backplate.color = "slategray"
109113
backplate.digitization = "flux"
110-
backplate.set_identifier("detector", 1)
114+
backplate.set_identifier("detector", panel_id)
111115
backplate.publish(cfg)
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
experiment: examples
22
runno: 1
3-
n: 5
3+
n: 100
44
nthreads: 1
55

66
# Required for optical-photon flux hits because optical photons deposit zero energy.
@@ -10,16 +10,15 @@ gparticle:
1010
- name: e-
1111
p: 1000
1212
vz: -50
13-
delta_theta: 20
14-
delta_phi: 180
1513

1614
gsystem:
1715
- name: cherenkov
16+
variation: CO2
1817

1918
gstreamer:
2019
- format: csv
21-
filename: out
20+
filename: CO2
2221
- format: root
23-
filename: out
22+
filename: CO2
2423

2524
phys_list: FTFP_BERT + G4OpticalPhysics

0 commit comments

Comments
 (0)