Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDSim: add option to set userInputPlugin for simulation #942

Merged
merged 3 commits into from Aug 5, 2022

Conversation

andresailer
Copy link
Member

@andresailer andresailer commented Aug 2, 2022

BEGINRELEASENOTES

  • DDSim: add option to set userInputPlugin for simulation by adding a plugin for themselves, and this to the ddsim steering file (for Integration of external library (CRY) for cosmic ray generation in DDG4 simulation (Question) #940)
       def exampleUserPlugin(dd4hepSimulation):
         '''Example code for user created plugin.
    
         :param DD4hepSimulation dd4hepSimulation: The DD4hepSimulation instance, so all parameters can be accessed
         :return: GeneratorAction
         '''
         from DDG4 import GeneratorAction, Kernel
         # Geant4InputAction is the type of plugin, Cry1 just an identifier
         gen = GeneratorAction(Kernel(), 'Geant4InputAction/Cry1' , True)
         # CRYEventReader is the actual plugin, steeringFile its constructor parameter
         gen.Input = 'CRYEventReader|' + 'steeringFile'
         # we can give a dictionary of Parameters that has to be interpreted by the setParameters function of the plugin
         gen.Parameters = {'DataFilePath': '/path/to/files/data'}
         gen.enableUI()
         return gen
    
       SIM.inputConfig.userInputPlugin = exampleUserPlugin

ENDRELEASENOTES

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant