File indexing completed on 2026-07-26 08:23:37
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 import logging
0021
0022 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
0023 logger = logging.getLogger(__name__)
0024
0025
0026 def run():
0027 import DDG4
0028 import CLICSid
0029 import g4units
0030
0031 sid = CLICSid.CLICSid()
0032 sid.loadGeometry()
0033 DDG4.Core.setPrintFormat(str("%-32s %6s %s"))
0034
0035 sid.geant4.setupCshUI(ui=None)
0036 gun = sid.geant4.setupGun("Gun",
0037 Standalone=True,
0038 particle='geantino',
0039 energy=20 * g4units.GeV,
0040 position=(0, 0, 0),
0041 multiplicity=1,
0042 isotrop=False)
0043 scan = DDG4.SteppingAction(sid.kernel, 'Geant4MaterialScanner/MaterialScan')
0044 sid.kernel.steppingAction().adopt(scan)
0045
0046
0047 sid.setupPhysics('QGSP_BERT')
0048 sid.test_config()
0049 sid.kernel.NumEvents = 1
0050
0051
0052 gun.direction = (0, 1, 0)
0053 sid.kernel.run()
0054 gun.direction = (1, 0, 0)
0055 sid.kernel.run()
0056 gun.direction = (1, 1, 1)
0057 sid.kernel.run()
0058
0059 sid.kernel.terminate()
0060 logger.info('End of run. Terminating .......')
0061 logger.info('TEST_PASSED')
0062
0063
0064 if __name__ == "__main__":
0065 run()