Skip to content
Snippets Groups Projects

feat: new ddsim features ported to npsim

Merged Wouter Deconinck requested to merge npsim-updates into master
8 files
+ 271
62
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -8,14 +8,22 @@ import ddsix as six
@@ -8,14 +8,22 @@ import ddsix as six
class Action(ConfigHelper):
class Action(ConfigHelper):
"""Action holding sensitive detector actions
"""Helper holding sensitive detector actions.
 
The default tracker and calorimeter actions can be set with
The default tracker and calorimeter actions can be set with
>>> SIM = DD4hepSimulation()
>>> SIM = DD4hepSimulation()
>>> SIM.action.tracker=('Geant4TrackerWeightedAction', {'HitPositionCombination': 2, 'CollectSingleDeposits': False})
>>> SIM.action.tracker=('Geant4TrackerWeightedAction', {'HitPositionCombination': 2, 'CollectSingleDeposits': False})
>>> SIM.action.calo = "Geant4CalorimeterAction"
>>> SIM.action.calo = "Geant4CalorimeterAction"
for specific subdetectors specific sensitive detectors can be set based on pattern matching
The default sensitive actions for calorimeters and trackers are applied based on the sensitive type.
 
The list of sensitive types can be changed with
 
 
>>> SIM = DD4hepSimulation()
 
>>> SIM.action.trackerSDTypes = ['tracker', 'myTrackerSensType']
 
>>> SIM.calor.calorimeterSDTypes = ['calorimeter', 'myCaloSensType']
 
 
For specific subdetectors specific sensitive detectors can be set based on patterns in the name of the subdetector.
>>> SIM = DD4hepSimulation()
>>> SIM = DD4hepSimulation()
>>> SIM.action.mapActions['tpc'] = "TPCSDAction"
>>> SIM.action.mapActions['tpc'] = "TPCSDAction"
@@ -66,8 +74,12 @@ class Action(ConfigHelper):
@@ -66,8 +74,12 @@ class Action(ConfigHelper):
@property
@property
def mapActions(self):
def mapActions(self):
""" create a map of patterns and actions to be applied to sensitive detectors
"""Create a map of patterns and actions to be applied to sensitive detectors.
example: SIM.action.mapActions['tpc'] = "TPCSDAction" """
 
Example: if the name of the detector matches 'tpc' the TPCSDAction is used.
 
 
SIM.action.mapActions['tpc'] = "TPCSDAction"
 
"""
return self._mapActions
return self._mapActions
@mapActions.setter
@mapActions.setter
Loading