This commit is contained in:
Jan Kieseler
2024-08-22 14:41:24 +02:00
parent ee622c57ba
commit 64399dbf3c
3 changed files with 13 additions and 17 deletions
+1 -1
View File
@@ -317,7 +317,7 @@ def _run_mini_batch(
print(f"Running mini batch {counter} with {nEvents} events")
import time
time.sleep(counter/1000)
time.sleep(counter/20)
print(f'done sleeping {counter}')
#this is now encapsuled
+11 -13
View File
@@ -6,19 +6,16 @@
"metadata": {},
"outputs": [],
"source": [
"from G4Calo import GeometryDescriptor, G4System\n",
"from G4Calo import GeometryDescriptor, run_batch, display_event\n",
"\n",
"cw = GeometryDescriptor() #the width of the calorimeter is 50 cm times 50 cm (also steerable, but I'd leave it)\n",
"gd = GeometryDescriptor() #the width of the calorimeter is 50 cm times 50 cm (also steerable, but I'd leave it)\n",
"\n",
"cw.addLayer(3,\"G4_Si\",True, 7)\n",
"cw.addLayer(4,\"G4_Pb\",False) \n",
"cw.addLayer(3,\"G4_Si\",True, 7)\n",
"cw.addLayer(4,\"G4_Pb\",False)\n",
"cw.addLayer(3,\"G4_Si\",True, 7)\n",
"cw.addLayer(4,\"G4_Pb\",False)\n",
"\n",
"G4s = G4System\n",
"G4s.init(cw)"
"gd.addLayer(3,\"G4_Si\",True, 7)\n",
"gd.addLayer(4,\"G4_Pb\",False) \n",
"gd.addLayer(3,\"G4_Si\",True, 7)\n",
"gd.addLayer(4,\"G4_Pb\",False)\n",
"gd.addLayer(3,\"G4_Si\",True, 7)\n",
"gd.addLayer(4,\"G4_Pb\",False)"
]
},
{
@@ -27,7 +24,8 @@
"metadata": {},
"outputs": [],
"source": [
"df = G4s.run_batch(10, 'gamma', 1)"
"df = run_batch(gd, 1000, 'gamma', 1)\n",
"df"
]
},
{
@@ -36,7 +34,7 @@
"metadata": {},
"outputs": [],
"source": [
"G4s.displayEvent()"
"display_event(gd,\"gamma\", 2)"
]
},
{
+1 -3
View File
@@ -3,8 +3,7 @@ from G4Calo import GeometryDescriptor, run_batch, display_event
import sys
if __name__ == '__main__':
#multiprocessing.set_start_method('spawn')
gd = GeometryDescriptor()
for _ in range(25):
@@ -19,5 +18,4 @@ if __name__ == '__main__':
gd.addLayer(1.,"G4_POLYSTYRENE",True,1)
df = run_batch(gd,10, 'gamma', 1)
display_event(gd,"gamma", 2)