/search.css" rel="stylesheet" type="text/css"/> /search.js">
Functions | |
def | Muon |
Variables | |
tuple | obj = Muon() |
def Muon::Muon | ( | name = 'Muon' , |
|
musicsite = 'DYB' , |
|||
muonvolumn = 'RPC' , |
|||
volume = '/dd/Structure/Pool/db-ows' , |
|||
start_time = 0 , |
|||
lifetime = 10*units.s , |
|||
prophet = True , |
|||
seed = 12345 |
|||
) |
configure Muon generator
Definition at line 4 of file Muon.py.
00012 : 00013 ''' 00014 configure Muon generator 00015 ''' 00016 00017 # set up Gnrtr itself 00018 from Gnrtr.GnrtrConf import Gnrtr 00019 gnrtr = Gnrtr(name) 00020 00021 gnrtr.GenTools = [ "GtHepEvtGenTool/"+name+"Gen", 00022 "GtPositionerTool/"+name+"Pos", 00023 "GtTimeratorTool/"+name+"Tim", 00024 "GtTransformTool/"+name+"Tra", 00025 "MuonProphet/"+name+"Prophet"] 00026 00027 gnrtr.TimeStamp = start_time 00028 00029 # set up each tools 00030 from GenTools.GenToolsConf import GtPositionerTool, GtTransformTool, GtTimeratorTool, GtHepEvtGenTool 00031 00032 # Set up Gen 00033 # Get cosmic muon path 00034 import os 00035 MuonDataPath = os.getenv('MuonDataPath') 00036 if MuonDataPath is None: 00037 print "Muon data path ($MuonDataPath) is not defined." 00038 import sys 00039 sys.exit() 00040 else: 00041 print "Read muon data from ",MuonDataPath 00042 00043 # set the muon generator command line 00044 # Muon.exe -n 20000 -s DYB -v RPC -seed 1 -r Yes -music_dir ....../data/trunk/NewMuonGenerator/data" 00045 hepEvtDataSource = "Muon.exe -n 20000 -s %s -v %s -seed %s -r Yes -music_dir %s|"%(musicsite,muonvolumn,seed,MuonDataPath) 00046 00047 exe = hepEvtDataSource.split(' ')[0] 00048 NAME = exe[exe.rfind('/')+1:] 00049 dot = NAME.rfind('.') 00050 baseNAME = NAME 00051 if dot > 0: baseNAME = NAME[:dot] 00052 sanitized = baseNAME.replace('.','_') 00053 00054 # If we got an executable and it is relative, look for it in the path 00055 if hepEvtDataSource[-1] == '|' and hepEvtDataSource[0] != '/': 00056 import os.path 00057 path = os.getenv('PATH') 00058 for p in path: 00059 if (os.path.isfile(path+'/'+exe)): 00060 hepEvtDataSource = path+'/'+exe + ' ' + ' '.join(hepEvtDataSource.split(' ')[1:]) 00061 break 00062 continue 00063 pass 00064 00065 #generator 00066 gen=GtHepEvtGenTool(name+'Gen',HepEvtDataSource = hepEvtDataSource) 00067 #gen.OutputLevel = 2 00068 gen.HepEvtDataSource = hepEvtDataSource 00069 00070 # Set up positioner 00071 pos=GtPositionerTool(name+'Pos',Volume=volume) 00072 pos.Mode = "Relative" 00073 pos.Position = [0,0,0] 00074 00075 # Set up timerator 00076 tim=GtTimeratorTool(name+'Tim') 00077 tim.LifeTime = lifetime 00078 00079 # transform 00080 tra=GtTransformTool(name+'Tra',Volume=volume) 00081 tra.Offset = [0., 0., (0.042)*units.meter] 00082 00083 ## More surprise from muon starts from here. 00084 from MuonProphet.MuonProphetConf import MuonProphet 00085 prophet=MuonProphet( name+"Prophet" ); 00086 # The can completely turn the tool off. 00087 prophet.Active = prophet 00088 prophet.Site = "DayaBay" 00089 # Note that the number of parameters of 00090 # Tools, Yields, YieldMeasuredAt and Lifetimes must be the same. 00091 prophet.GenTools = [ "Li9He8Decayerator/Li9He8" ] 00092 prophet.GenYields = [ 0.5*units.cm2/units.gram ] 00093 prophet.GenYieldMeasuredAt = [260*units.GeV] 00094 prophet.GenLifetimes = [ 0.002*units.s ] 00095 00096 # trigger related configuration 00097 prophet.TrkLengthInWaterThres = 20*units.cm 00098 prophet.WaterPoolTriggerEff = 0.9999 00099 #prophet.OutputLevel=2 00100 00101 return gnrtr