/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 #!/usr/bin/env python 00002 00003 def Co60(volume): 00004 00005 import GaudiPython as gm 00006 app = gm.AppMgr() 00007 #msg = self.app.service("MessageSvc") 00008 #msg.OutputLevel = 1 00009 00010 #processor 00011 gen = app.algorithm("Co60") 00012 #gen.OutputLevel = 2 00013 gen.GenTools = [ "GtHepEvtGenTool/Co60Gen", "GtPositionerTool/Co60Pos", "GtTimeratorTool/Co60Tim" ] 00014 gen.GenName = "Bang Bang" 00015 gen.Location = "/Event/Gen/HepMCEvents" # this is default anyways 00016 00017 # 00018 from GaudiKernel import SystemOfUnits as units 00019 00020 # Set up Co60Gen 00021 seed=1234567 00022 nevents=1000 00023 hepevt_source="Co60.exe -seed %(seed)s -n %(nevents)s|" 00024 # Deal with executable 00025 if hepevt_source[-1] == "|": 00026 exe = hepevt_source.split(' ')[0] 00027 if exe[0] != '/': # Try to find full path 00028 import os, os.path 00029 path = os.getenv('PATH') 00030 for p in path: 00031 if (os.path.isfile(path+"/"+exe)): 00032 exe = path+"/"+exe 00033 break 00034 continue 00035 pass 00036 source = exe + ' ' + ' '.join(hepevt_source.split(' ')[1:]) 00037 if "%" in source: # Fill in any placemarks 00038 source = source%{'nevents':str(nevents), 00039 'seed':str(seed)} 00040 pass 00041 pass 00042 00043 00044 app.property('ToolSvc.Co60Gen').OutputLevel = 2 00045 app.property('ToolSvc.Co60Gen').HepEvtDataSource = source 00046 00047 # Set up positioner 00048 app.property('ToolSvc.Co60Pos').OutputLevel = 2 00049 app.property('ToolSvc.Co60Pos').Volume = volume 00050 app.property('ToolSvc.Co60Pos').Strategy = "FullVolume" # also "AvoidDaughters" and "Surface" 00051 app.property('ToolSvc.Co60Pos').Mode = "Uniform" 00052 app.property('ToolSvc.Co60Pos').Spread = 10*units.cm 00053 app.property('ToolSvc.Co60Pos').Position = [0,0,0] 00054 00055 # Set up timerator 00056 app.property('ToolSvc.Co60Tim').LifeTime = int(5*units.ns) 00057 00058 00059 return