Classes | |
class | GenMuonHists |
Functions | |
def | configure |
def | run |
Variables | |
tuple | Gaudi = PyCintex.makeNamespace('Gaudi') |
int | TH1F = 1 |
int | TH2F = 2 |
def GenMuon::TestHist::configure | ( | argv = [] |
) |
Configure GtMuoneratorTool based kinematics and an algorithm to histogram some quantities.
Definition at line 76 of file TestHist.py.
00076 : 00077 ''' 00078 Configure GtMuoneratorTool based kinematics and an algorithm to 00079 histogram some quantities. 00080 ''' 00081 from optparse import OptionParser 00082 op = OptionParser(usage=configure.__doc__) 00083 op.add_option("-r","--rotate-site",default=False,action="store_true", 00084 help="Rotate muons to match site") 00085 op.add_option("-s","--site",default='SAB', 00086 help="Detector site (DYB, LA, Mid, Far,SAB)") 00087 op.add_option("-M","--muon-file",default="", 00088 help="Path to text file of muon energy and directions to sample") 00089 op.add_option("-R","--ratio-file",default="", 00090 help="Path to ROOT file of mu+/mu- ratio histogram") 00091 op.add_option("-v","--volume",default="rock", 00092 help="Volume to use to place vertices (rock, RPC, ADE)") 00093 (opts,args) = op.parse_args(args=argv) 00094 00095 from StatisticsSvc.StatisticsSvcConf import StatisticsSvc 00096 statsSvc = StatisticsSvc() 00097 statsSvc.Output ={"file1":"MuonTestHist.root"} 00098 00099 volume = '/dd/Structure/AD/db-ade1' 00100 name = 'Mu' 00101 00102 from GaudiKernel import SystemOfUnits as units 00103 00104 from GenMuon.GenMuonConf import GtMuoneratorTool 00105 muon = GtMuoneratorTool(name+'onerator') 00106 muon.Rotation = opts.rotate_site 00107 muon.WhichSite = opts.site 00108 muon.MuonFile = opts.muon_file 00109 muon.RatioFile = opts.ratio_file 00110 muon.Volume = opts.volume 00111 00112 from GenTools.GenToolsConf import GtPositionerTool, GtTransformTool, GtTimeratorTool, GtGenerator 00113 00114 00115 00116 # Set up positioner 00117 pos = GtPositionerTool(name+'Pos',Volume=volume) 00118 pos.Mode = "Relative" 00119 pos.Position = [0,0,0] 00120 00121 # Set up timerator. note high rate of muons 00122 tim = GtTimeratorTool(name+'Tim') 00123 muonRate = 1000. # in Hz 00124 lifet = 1./float(muonRate) 00125 tim.LifeTime = (lifet)*units.s 00126 print "Muon: Rate per second is ",muonRate 00127 00128 # transform 00129 tra = GtTransformTool(name+'Tra',Volume=volume) 00130 tra.Offset = [0., 0., (0.042)*units.meter] 00131 00132 gtgen = GtGenerator("muonerator") 00133 gtgen.GenName = 'muonerator' 00134 gtgen.GenTools = [muon,pos,tim,tra] 00135 00136 from Gaudi.Configuration import ApplicationMgr 00137 theApp = ApplicationMgr() 00138 theApp.TopAlg.append(gtgen) 00139 00140 return 00141 def run(app):
def GenMuon::TestHist::run | ( | app | ) |
Definition at line 142 of file TestHist.py.
00142 : 00143 app.ExtSvc += ["StaticCableSvc", "StatisticsSvc"] 00144 alg = GenMuonHists() 00145 app.addAlgorithm(alg) 00146 pass 00147
tuple GenMuon::TestHist::Gaudi = PyCintex.makeNamespace('Gaudi') [static] |
Definition at line 4 of file TestHist.py.
int GenMuon::TestHist::TH1F = 1 [static] |
Definition at line 15 of file TestHist.py.
int GenMuon::TestHist::TH2F = 2 [static] |
Definition at line 16 of file TestHist.py.