/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
gentools::GenToolsConfig Class Reference

List of all members.

Public Member Functions

def __init__
def init
def init_gen_tools
def init_generator

Public Attributes

 app
 nevents
 seed
 volume
 hepevt_source

Detailed Description

Definition at line 3 of file gentools.py.


Constructor & Destructor Documentation

def gentools::GenToolsConfig::__init__ (   self,
  volume = "/dd/Geometry/AD/lvAD",
  nevents = 10,
  seed = 1234567,
  hepevt_source = "Co60.exe -seed %(seed)s -n %(nevents)s|" 
)

Definition at line 4 of file gentools.py.

00010                                                                          :
00011         import GaudiPython as gm
00012         self.app = gm.AppMgr()
00013         #msg = self.app.service("MessageSvc")
00014         #msg.OutputLevel = 1
00015         self.nevents = nevents
00016         self.seed = seed
00017         self.volume = volume
00018         self.hepevt_source=hepevt_source
00019         self.init()
00020         return


Member Function Documentation

def gentools::GenToolsConfig::init (   self)

Definition at line 21 of file gentools.py.

00022                   :
00023         self.init_gen_tools()
00024         self.init_generator()
00025         return

def gentools::GenToolsConfig::init_gen_tools (   self)

Definition at line 26 of file gentools.py.

00027                             :
00028         from GaudiKernel import SystemOfUnits as units
00029 
00030         #print " init_gen_tools"
00031 
00032         # Set up timerator
00033         tim = self.app.property("ToolSvc.GtTimeratorTool")
00034         #tim.OutputLevel=1
00035         tim.LifeTime = int(1*units.second)
00036 
00037 
00038         # Set up positioner
00039         #print " Creating poser"
00040         poser = self.app.property("ToolSvc.GtPositionerTool")
00041         poser.OutputLevel = 2
00042         poser.Volume = self.volume
00043         poser.Strategy = "FullVolume" # also "AvoidDaughters" and "Surface"
00044         poser.Mode = "Uniform"
00045         poser.Spread = 10*units.cm
00046         poser.Position = [0,0,0]
00047 
00048         # Deal with executable
00049         if self.hepevt_source[-1] == "|":
00050             exe = self.hepevt_source.split(' ')[0]
00051             if exe[0] != '/':   # Try to find full path
00052                 import os, os.path
00053                 path = os.getenv('PATH')
00054                 for p in path:
00055                     if (os.path.isfile(path+"/"+exe)):
00056                         exe = path+"/"+exe
00057                         break
00058                     continue
00059                 pass
00060             source = exe + ' ' + ' '.join(self.hepevt_source.split(' ')[1:])
00061             if "%" in source:   # Fill in any placemarks
00062                 source = source%{'nevents':str(self.nevents),
00063                                  'seed':str(self.seed)}
00064                 pass
00065             pass
00066         
00067 
00068         # HEPEvt -> HepMC generator
00069         #hepevt = self.app.property("ToolSvc.GtHepEvtGenTool")
00070         #hepevt.HepEvtDataSource = source
00071         #print " HepEvtGenTool with", source
00072 
00073         # Set up gun
00074         gun = self.app.property("ToolSvc.GtGunGenTool")
00075         gun.OutputLevel = 2
00076         gun.ParticleName = "opticalphoton"
00077         gun.MomentumMode = "Fixed"
00078         gun.Momentum = 2.5*units.eV
00079         gun.DirectionMode = "Fixed"
00080         gun.Direction = [ 0.0,0.0,-1.0 ]
00081 
00082 
00083         return

def gentools::GenToolsConfig::init_generator (   self)

Definition at line 84 of file gentools.py.

00085                             :
00086         #print " init_generator"
00087 #        self.app.TopAlg += [ "Gnrtr/Generator", "GtHepMCDumper/Dumper" ]
00088         self.app.TopAlg += [ "Gnrtr/Generator" ]
00089         #print " GtGenerator"
00090         gen = self.app.algorithm("Generator")
00091         #gen.OutputLevel = 2
00092         #gen.GenTools = [ "GtHepEvtGenTool", "GtPositionerTool", "GtTimeratorTool" ]
00093         gen.GenTools = [ "GtGunGenTool/GunGen", "GtPositionerTool/GunPos", "GtTimeratorTool/GunTim" ]
00094         gen.GenName = "Bang Bang"
00095         gen.Location = "/Event/Gen/HepMCEvents" # this is default anyways
00096 
00097         #print " GtDumper"
00098         dump = self.app.algorithm("Dumper")
00099         dump.Location = "/Event/Gen/HepMCEvents"  # this is default anyways.
00100         return


Member Data Documentation

Definition at line 4 of file gentools.py.

Definition at line 4 of file gentools.py.

Definition at line 4 of file gentools.py.

Definition at line 4 of file gentools.py.

Definition at line 4 of file gentools.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:44 for Gnrtr by doxygen 1.7.4