Skip to content
Snippets Groups Projects
Commit 8e26f228 authored by Markus FRANK's avatar Markus FRANK Committed by MarkusFrankATcernch
Browse files

Allow for sensitive actions with multiple readout segmentation in the...

Allow for sensitive actions with multiple readout segmentation in the Geant4Sensitive action sequence
parent ba27a014
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,6 @@
from __future__ import absolute_import, unicode_literals
import DDG4
import CLICSid
from DDG4 import OutputLevel as Output
import logging
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
......@@ -33,8 +31,8 @@ def run():
import time
import g4units
install_dir = os.environ['DD4hepExamplesINSTALL']
file = str("file:" + install_dir + "/examples/CLICSiD/compact/SiD_ECAL_Parallel_Readout.xml");
sid = CLICSid.CLICSid()
file = str("file:" + install_dir + "/examples/CLICSiD/compact/SiD_ECAL_Parallel_Readout.xml")
sid = CLICSid.CLICSid()
sid.kernel.loadGeometry(file)
sid.kernel.UI = "UI"
sid.geant4.setupCshUI()
......@@ -42,15 +40,15 @@ def run():
DDG4.importConstants(sid.kernel.detectorDescription(), debug=False)
#
sid.geant4.printDetectors()
sid.geant4.setupROOTOutput('RootOutput','CLICSiD_'+time.strftime('%Y-%m-%d_%H-%M'))
sid.geant4.setupROOTOutput('RootOutput', 'CLICSiD_' + time.strftime('%Y-%m-%d_%H-%M'))
#
gun = sid.geant4.setupGun("Gun",
Standalone=True,
particle='e+',
energy=20 * g4units.GeV,
position=(0, 0, 0),
multiplicity=1,
isotrop=True)
sid.geant4.setupGun("Gun",
Standalone=True,
particle='e+',
energy=20 * g4units.GeV,
position=(0, 0, 0),
multiplicity=1,
isotrop=True)
# =============================================================================
#
# Setup the parallel readout for the detector EcalBarrel
......@@ -59,28 +57,28 @@ def run():
# First use the default definition for the basic setup (and the first sensitive action)
det = str('EcalBarrel')
typ = sid.geant4.sensitive_types['calorimeter']
seq = DDG4.SensitiveSequence(sid.kernel, str('Geant4SensDetActionSequence/')+det)
seq = DDG4.SensitiveSequence(sid.kernel, str('Geant4SensDetActionSequence/') + det)
seq.enableUI()
act = DDG4.SensitiveAction(sid.kernel, str(typ+'/EcalBarrelHandler'), det)
act = DDG4.SensitiveAction(sid.kernel, str(typ + '/EcalBarrelHandler'), det)
act.enableUI()
seq.add(act)
# Add extra parallel readout action with readout EcalBarrelHits_0
act = DDG4.SensitiveAction(sid.kernel, str(typ+'/EcalBarrelHandler_0'), det)
act = DDG4.SensitiveAction(sid.kernel, str(typ + '/EcalBarrelHandler_0'), det)
act.ReadoutName = 'EcalBarrelHits_0'
act.enableUI()
seq.add(act)
# Add extra parallel readout action with readout EcalBarrelHits_1
act = DDG4.SensitiveAction(sid.kernel, str(typ+'/EcalBarrelHandler_1'), det)
act = DDG4.SensitiveAction(sid.kernel, str(typ + '/EcalBarrelHandler_1'), det)
act.ReadoutName = 'EcalBarrelHits_1'
act.enableUI()
seq.add(act)
# Add extra parallel readout action with readout EcalBarrelHits_2
act = DDG4.SensitiveAction(sid.kernel, str(typ+'/EcalBarrelHandler_2'), det)
act = DDG4.SensitiveAction(sid.kernel, str(typ + '/EcalBarrelHandler_2'), det)
act.ReadoutName = 'EcalBarrelHits_2'
act.enableUI()
seq.add(act)
# =============================================================================
sid.setupPhysics('QGSP_BERT')
sid.test_config()
sid.kernel.run()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment