/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions
FastMuon::FastMuon Class Reference

List of all members.

Public Member Functions

def __init__

Detailed Description

   configure Muon generator

Definition at line 3 of file FastMuon.py.


Constructor & Destructor Documentation

def FastMuon::FastMuon::__init__ (   self,
  stage = 'null',
  name = 'Muon',
  volume = '/dd/Structure/Pool/db-ows',
  start_time = 0,
  seed = 1234567 
)

Definition at line 8 of file FastMuon.py.

00014                               :
00015 
00016         # set up Gnrtr itself
00017         from Gnrtr.GnrtrConf import Gnrtr
00018         gnrtr = Gnrtr(name);
00019 
00020         gnrtr.GenTools = [ "GtHepEvtGenTool/"+name+"Gen",
00021                            "GtPositionerTool/"+name+"Pos",
00022                            "GtTimeratorTool/"+name+"Tim",
00023                            "GtTransformTool/"+name+"Tra",
00024                            "MuonProphet/"+name+"Prophet"
00025                            ]
00026 
00027         gnrtr.ThisStageName = "Kinematic"
00028         gnrtr.TimeStamp = start_time
00029 
00030         if stage != 'null':
00031             stage.KinematicSequence.Members.append(gnrtr)
00032 
00033         # set up each tools
00034         from GaudiKernel import SystemOfUnits as units
00035         from GenTools.GenToolsConf import GtPositionerTool, GtTransformTool, GtTimeratorTool, GtHepEvtGenTool
00036         from MuonProphet.MuonProphetConf import MuonProphet
00037         # Set up Gen
00038 
00039         musicsite = 'DYB'
00040                 
00041         nevents=5000
00042 
00043         # Get cosmic muon path
00044         import os
00045         MuonDataPath = os.getenv('MuonDataPath')
00046         if MuonDataPath is None:
00047             print "Muon data path ($MuonDataPath) is not defined."
00048             import sys
00049             sys.exit()
00050         else:
00051             print "Read muon data from ",MuonDataPath
00052 
00053 
00054         # set the muon generator command line
00055         hepEvtDataSource = "Muon.exe -n 1100 -s %s -v rock -seed %s -r Yes -music_dir %s|"%(musicsite,seed,MuonDataPath)
00056         
00057         exe = hepEvtDataSource.split(' ')[0]
00058         NAME = exe[exe.rfind('/')+1:]
00059         dot = NAME.rfind('.')
00060         baseNAME = NAME
00061         if dot > 0: baseNAME = NAME[:dot]
00062         sanitized = baseNAME.replace('.','_')
00063         
00064         # If we got an executable and it is relative, look for it in the path
00065         if hepEvtDataSource[-1] == '|' and hepEvtDataSource[0] != '/':
00066             import os, os.path
00067             path = os.getenv('PATH')
00068             for p in path:
00069                 if (os.path.isfile(path+'/'+exe)):
00070                     hepEvtDataSource = path+'/'+exe + ' ' + ' '.join(hepEvtDataSource.split(' ')[1:])
00071                     break
00072                 continue
00073             pass
00074         
00075         #generator
00076         gen=GtHepEvtGenTool(name+'Gen',HepEvtDataSource = hepEvtDataSource)
00077         #gen.OutputLevel = 2
00078         gen.HepEvtDataSource = hepEvtDataSource
00079         
00080         # Set up positioner
00081         pos=GtPositionerTool(name+'Pos',Volume=volume)
00082         # I should use relateiv
00083         pos.Mode = "Relative"
00084         #pos.Mode = "Fixed"
00085         pos.Position = [0,0,0]
00086         
00087         # Set up timerator
00088         tim=GtTimeratorTool(name+'Tim')
00089         tim.LifeTime = 0.000595*units.s
00090         
00091         # transform
00092         tra=GtTransformTool(name+'Tra',Volume=volume)
00093         tra.Offset = [0., 0., (0.042)*units.meter]
00094 
00095         ## More surprise from muon starts from here.
00096         # muon prophet
00097         prophet=MuonProphet();
00098         # The can completely turn the tool off.
00099         #prophet.Active=False;        
00100         prophet.Site = "DayaBay"
00101         # Note that the number of parameters of 
00102         # Tools, Yields, YieldMeasuredAt and Lifetimes must be the same.
00103         prophet.GenTools     = [ "Li9He8Decayerator/Li9He8" ]
00104         prophet.GenYields    = [ 0.5*units.cm2/units.gram ]
00105         prophet.GenYieldMeasuredAt = [260*units.GeV]
00106         prophet.GenLifetimes = [ 0.002*units.s ]
00107 
00108         # trigger related configuration
00109         prophet.TrkLengthInWaterThres = 20*units.cm
00110         prophet.WaterPoolTriggerEff = 0.9999
00111 
00112         #prophet.OutputLevel=2
00113 
00114         # Set false, otherwise all times will be reset so the signal vertex is at t=0.
00115         from G4DataHelpers.G4DataHelpersConf import HepMCtoG4
00116         convertor = HepMCtoG4()
00117         convertor.ZeroTime = False
00118 
00119         pass


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:21:29 for MuonProphet by doxygen 1.7.4