/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 | Public Attributes
GenMuon::Helpers::CosmicHelper Class Reference

List of all members.

Public Member Functions

def __init__
def tools

Public Attributes

 muon
 positioner
 timerator
 transformer

Detailed Description

A helper for use with GenTools.Configure()

Definition at line 10 of file Helpers.py.


Constructor & Destructor Documentation

def GenMuon::Helpers::CosmicHelper::__init__ (   self,
  site,
  volume,
  coord_de,
  path = None 
)
Create a helper to set up kinematics for cosmic muons.  
Options:

site            : set which site (DYB, LA, Mid, Far,SAB)
volume          : keyword for muon generator to determine where to put muon vertices (rock, RPC, ADE)
coord_de        : detector element providing coordinate system to convert to global (eg, '/dd/Structure/AD/db-ade1')
path            : set directory holding muon data, overrides $MuonDataPath

The tools it produces are available via: 
.muon the GtMuoneratorTool
.positioner the GtPositionerTool
.transform the GtTransformTool
.timerator the GtTimeratorTool

Definition at line 15 of file Helpers.py.

00016                                                            :
00017         '''
00018         Create a helper to set up kinematics for cosmic muons.  
00019         Options:
00020 
00021         site            : set which site (DYB, LA, Mid, Far,SAB)
00022         volume          : keyword for muon generator to determine where to put muon vertices (rock, RPC, ADE)
00023         coord_de        : detector element providing coordinate system to convert to global (eg, '/dd/Structure/AD/db-ade1')
00024         path            : set directory holding muon data, overrides $MuonDataPath
00025 
00026         The tools it produces are available via: 
00027         .muon the GtMuoneratorTool
00028         .positioner the GtPositionerTool
00029         .transform the GtTransformTool
00030         .timerator the GtTimeratorTool
00031         '''
00032 
00033         # try to find where the input files are
00034         if not path:
00035             print 'No muon data path given, checking $MuonDataPath' 
00036             path = os.getenv('MuonDataPath')
00037         if not path:
00038             for where in [os.getenv('NEWMUONGENERATORROOT','data/NewMuonGenerator/data'),
00039                           os.getenv('NEWMUONGENERATORROOT','data/trunk/NewMuonGenerator/data')]:
00040                 print 'No $MuonDataPath, trying to locate %s/' % where
00041                 sr = os.getenv('SITEROOT')
00042                 if sr:
00043                     maybe = os.path.join(sr,where)
00044                     if os.path.exists(maybe):
00045                         path = maybe
00046                         break
00047                     continue
00048                 continue
00049         if not path:
00050             raise ValueError('Could not find input muon data anywhere, go fish.')
00051 
00052         flux_file = os.path.join(path,'mountain_%s'%site)
00053         url = 'http://dayabay.ihep.ac.cn/svn/dybsvn/data/trunk/NewMuonGenerator/data/'
00054         if not os.path.exists(flux_file):
00055             raise RuntimeError('No flux file "%s" get it from %s' % (flux_file, url) )
00056 
00057         ratio_file = os.path.join(path,'mu_plus_minus_ratio.root')
00058         if not os.path.exists(ratio_file):
00059             print 'No mu+/mu- ratio file found, will rely on paramatrization.'
00060             #raise RuntimeError('No ratio file "%s" get it from %s' % (ratio_file, url) )
00061 
00062         name = 'Cosmic-%s-%s' % (site,volume)
00063 
00064         from GenMuon.GenMuonConf import GtMuoneratorTool
00065         muon = GtMuoneratorTool(name+'_muonerator')
00066         #muon.Rotation = True
00067         muon.WhichSite = site
00068         muon.MuonFile = flux_file
00069         muon.RatioFile = ratio_file
00070         muon.Volume = volume
00071         self.muon = muon
00072 
00073         from GenTools.GenToolsConf import GtPositionerTool, GtTransformTool, GtTimeratorTool
00074         from GaudiKernel import SystemOfUnits as units
00075 
00076         # Set up positioner
00077         pos = GtPositionerTool(name+'_positioner',Volume=coord_de)
00078         pos.Mode = "Relative"
00079         pos.Position = [0,0,0]
00080         self.positioner = pos
00081         
00082         # Set up timerator. note high rate of muons
00083         tim = GtTimeratorTool(name+'_timerator')
00084         muonRate = 1000.   # in Hz
00085         lifet = 1./float(muonRate)
00086         tim.LifeTime = (lifet)*units.s
00087         print "Muon: Rate per second is ",muonRate
00088         self.timerator = tim
00089         
00090         # transform
00091         tra = GtTransformTool(name+'_transformer',Volume=coord_de)
00092         tra.Offset = [0., 0., (0.042)*units.meter]
00093         self.transformer = tra
00094 
00095         return


Member Function Documentation

def GenMuon::Helpers::CosmicHelper::tools (   self)

Definition at line 96 of file Helpers.py.

00097                    :
00098         return [self.muon,self.positioner,self.timerator,self.transformer]


Member Data Documentation

Definition at line 29 of file Helpers.py.

Definition at line 29 of file Helpers.py.

Definition at line 29 of file Helpers.py.

Definition at line 29 of file Helpers.py.


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:20:55 for GenMuon by doxygen 1.7.4