/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
DetSimValidation::Pool::PoolMuons Class Reference

List of all members.

Public Member Functions

def __init__

Public Attributes

 detsimvali

Detailed Description

Default configuration for sending muons through a pool.  This
makes use of an external HepEVT muon generator, turns off
scintilation to increase processing speed and sets up for the
validation ntuple.  It is based on the original ran*Muon.py
scripts.

Definition at line 6 of file Pool.py.


Constructor & Destructor Documentation

def DetSimValidation::Pool::PoolMuons::__init__ (   self,
  site = "far",
  histogram_filename = '../mc_ntuple/%sMuonPool.root' 
)
Construct the default configuration for muon pool
validation.  The site can be set to "far" or "near" (dayabay
near site, near sites non-identicality was not considered).  A
non-default histogram_filename can be specified to hold the
resulting histograms.  If a "%s" is included the site will be
substituted.

Warning: this hard codes generation of 1000 muons.  Simulating
less is okay, but more is bad.

Definition at line 14 of file Pool.py.

00015                                                                                      :
00016         ''' Construct the default configuration for muon pool
00017         validation.  The site can be set to "far" or "near" (dayabay
00018         near site, near sites non-identicality was not considered).  A
00019         non-default histogram_filename can be specified to hold the
00020         resulting histograms.  If a "%s" is included the site will be
00021         substituted.
00022         
00023         Warning: this hard codes generation of 1000 muons.  Simulating
00024         less is okay, but more is bad.
00025         '''
00026 
00027         # key off site.
00028         volume = "/dd/Structure/Pool/db-ows"
00029         musicsite = 'DYB'
00030         if 'far' == site:
00031             volume = "/dd/Structure/Pool/far-ows"
00032             musicsite = 'Far'
00033         else:
00034             site = 'dayabay'    # normalize
00035 
00036         # let any %s be dereferenced.
00037         try:
00038             histogram_filename = histogram_filename%site
00039         except TypeError:
00040             pass
00041 
00042         import GaudiKernel.SystemOfUnits as units
00043 
00044         # Try to find MUSIC's data directory 
00045         import os
00046         muonroot = os.getenv('MUONROOT',None)
00047         if not muonroot:
00048             print "Can not find $MUONROOT needed to locate MUSIC directory."
00049             import sys
00050             sys.exit(1)
00051             pass
00052         
00053         source = "Muon.exe -n 1000 -s %s -music_dir %s/data|"%(musicsite,
00054                                                                muonroot)
00055 
00056         from GenTools.Helpers import HepEVT
00057         hepevt = HepEVT(source)
00058         hepevt.timerator.LifeTime = 1*units.second
00059         hepevt.transformer.Volume = volume
00060         # Geometry impedeance mismatch between Muon.exe and XmlDetDesc
00061         hepevt.transformer.Offset = [0., 0., (0.042)*units.meter]
00062 
00063         import GenTools
00064         gt = GenTools.Configure(helper=hepevt)
00065 
00066 
00067         # Configure DetSim
00068 
00069         import DetSim
00070         detsim = DetSim.Configure(site)
00071         
00072         from DetSim.DetSimConf import DsPhysConsOptical
00073         optical = DsPhysConsOptical()
00074         optical.CerenPhotonScaleWeight = 3.0
00075         optical.ScintPhotonScaleWeight = 3.0
00076 
00077         # use temps to keep lines succinct
00078         ismuon = "(pdg==13 or pdg==-13) and "
00079         material = "MaterialName == '/dd/Materials/%s"
00080         stats = [
00081             ["MuonTrkLengthInOws","dx",ismuon+material%"OwsWater'"],
00082             ["MuonTrkLengthInIws", "dx", ismuon+material%"IwsWater'"],
00083             ["MuonTrkLengthInLS", "dx", ismuon+material%"LiquidScintillator'"],
00084             ["MuonTrkLengthInGdLS","dx", ismuon+material%"GdDopedLS'"],
00085             ["MuonStop", "dx", ismuon+" (IsStopping>0)"],    
00086             ]
00087         detsim.unobserver(stats=stats)
00088         detsim.historian(trackSelection = "pdg==13 or pdg==-13")
00089 
00090         # Finally, DetSimVali itself
00091         from DetSimValidation.DetSimValidationConf import DetSimVali
00092         dsv = DetSimVali()
00093         self.detsimvali = dsv
00094         
00095         from Gaudi.Configuration import ApplicationMgr
00096         theApp = ApplicationMgr()
00097         theApp.TopAlg.append(dsv)
00098 
00099         from GaudiSvc.GaudiSvcConf import THistSvc
00100         histsvc = THistSvc()
00101         histsvc.Output =["file1 DATAFILE='%s' OPT='RECREATE' TYP='ROOT' "%histogram_filename]
00102         return


Member Data Documentation

Definition at line 23 of file Pool.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:19:12 for DetSimValidation by doxygen 1.7.4