File indexing completed on 2025-01-30 09:17:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 """
0013
0014 Perform a material scan using Geant4 shotting geantinos
0015
0016 @author M.Frank
0017 @version 1.0
0018
0019 """
0020 from __future__ import absolute_import, unicode_literals
0021 import logging
0022
0023 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
0024 logger = logging.getLogger(__name__)
0025
0026
0027 def run():
0028 import DDG4
0029 import CLICSid
0030 import g4units
0031
0032 sid = CLICSid.CLICSid()
0033 sid.loadGeometry()
0034 DDG4.Core.setPrintFormat(str("%-32s %6s %s"))
0035
0036 sid.geant4.setupCshUI(ui=None)
0037 gun = sid.geant4.setupGun("Gun",
0038 Standalone=True,
0039 particle='geantino',
0040 energy=20 * g4units.GeV,
0041 position=(0, 0, 0),
0042 multiplicity=1,
0043 isotrop=False)
0044 scan = DDG4.SteppingAction(sid.kernel, 'Geant4MaterialScanner/MaterialScan')
0045 sid.kernel.steppingAction().adopt(scan)
0046
0047
0048 sid.setupPhysics('QGSP_BERT')
0049 sid.test_config()
0050 sid.kernel.NumEvents = 1
0051
0052
0053 gun.direction = (0, 1, 0)
0054 sid.kernel.run()
0055 gun.direction = (1, 0, 0)
0056 sid.kernel.run()
0057 gun.direction = (1, 1, 1)
0058 sid.kernel.run()
0059
0060 sid.kernel.terminate()
0061 logger.info('End of run. Terminating .......')
0062 logger.info('TEST_PASSED')
0063
0064
0065 if __name__ == "__main__":
0066 run()