/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
test-GeneratorAlg::TestGenerator Class Reference

List of all members.

Public Member Functions

def __init__
def init
def init_gen_tools
def init_generator
def init_geometry
def run

Public Attributes

 app
 nevents
 volume

Detailed Description

Definition at line 3 of file test-GeneratorAlg.py.


Constructor & Destructor Documentation

def test-GeneratorAlg::TestGenerator::__init__ (   self)

Definition at line 4 of file test-GeneratorAlg.py.

00005                       :
00006         import gaudimodule as gm
00007         self.app = gm.AppMgr()
00008         msv = self.app.service('MessageSvc')
00009         msv.OutputLevel = 3
00010         self.nevents = 10
00011         self.volume = "/dd/Geometry/Pool/lvNearPoolIWS"
00012         self.init()
00013         self.app.EvtMax = self.nevents
00014         self.app.EvtSel = "NONE"
00015         return


Member Function Documentation

def test-GeneratorAlg::TestGenerator::init (   self)

Definition at line 16 of file test-GeneratorAlg.py.

00017                   :
00018         self.init_gen_tools()
00019         self.init_generator()
00020         self.init_geometry()
00021         return

def test-GeneratorAlg::TestGenerator::init_gen_tools (   self)

Definition at line 22 of file test-GeneratorAlg.py.

00023                             :
00024         from units import second
00025 
00026         print " init_gen_tools"
00027         toolSvc = self.app.toolSvc()
00028 
00029         # Set up timerator
00030         print " Creating timerator"
00031         tim = toolSvc.create("GtTimeratorTool","timerator")
00032         tim.OutputLevel=1
00033         tim.LifeTime = int(1*second)
00034 
00035         # Set up positioner
00036         print " Creating poser"
00037         poser = toolSvc.create("GtPositionerTool", "poser")
00038         poser.OutputLevel = 3
00039         poser.Volume = self.volume
00040         poser.Strategy = "FullVolume" # also "AvoidDaughters" and "Surface"
00041 
00042         # find executable
00043         exe = "Co60.exe"
00044         import os, os.path
00045         path = os.getenv('PATH')
00046         for p in path:
00047             if (os.path.isfile(path+"/"+exe)):
00048                 exe = path+"/"+exe
00049                 break
00050             continue
00051 
00052         # HEPEvt -> HepMC generator
00053         hepevt = toolSvc.create("GtHepEvtGenTool")
00054         hepevt.HepEvtDataSource = "%s -n %d -seed 1234567|"%(exe,self.nevents)
00055         print " HepEvtGenTool with", hepevt.HepEvtDataSource
00056 
00057         return

def test-GeneratorAlg::TestGenerator::init_generator (   self)

Definition at line 58 of file test-GeneratorAlg.py.

00059                             :
00060         print " init_generator"
00061         self.app.TopAlg += [ "GtGenerator/Gen", "GtHepMCDumper/Dumper" ]
00062 
00063         print " GtGenerator"
00064         gen = self.app.algorithm("Gen")
00065         gen.OutputLevel = 2
00066         gen.GenTools = [ "GtHepEvtGenTool", "poser", "timerator" ]
00067         gen.GenName = "Cobalt 60"
00068         gen.GenEventLoc = "/Event/Gen/HepMCEvents" # this is default anyways
00069 
00070         print " GtDumper"
00071         dump = self.app.algorithm("Dumper")
00072         dump.Location = "/Event/Gen/HepMCEvents"  # this is default anyways.
00073         return

def test-GeneratorAlg::TestGenerator::init_geometry (   self)

Definition at line 74 of file test-GeneratorAlg.py.

00075                            :
00076         print " init_geometry"
00077         self.app.ExtSvc += [ "XmlCnvSvc" , "XmlParserSvc" ] 
00078         
00079         det = self.app.service('DetectorPersistencySvc')
00080         det.OutputLevel=3
00081         det.CnvServices = ["XmlCnvSvc"]
00082 
00083         det = self.app.service('XmlCnvSvc')
00084         #det.OutputLevel=1
00085         det.AllowGenericConversion = True
00086 
00087         #XmlParserSvc = g.service('XmlParserSvc')
00088         #XmlParserSvc.EntityResolverSvc = "CondDBEntityResolverSvc"
00089 
00090         det = self.app.service('DetectorDataSvc')
00091         det.UsePersistency = True
00092         det.DetDbRootName  = "dd"
00093         det.DetStorageType = 7
00094         import os, os.path
00095         loc = os.getenv('XMLDETDESCROOT')
00096         if (not loc):
00097             import sys
00098             print "Failed to get XMLDETDESCROOT"
00099             sys.exit(1)
00100             return
00101         det.DetDbLocation  = loc + "/DDDB/dayabay.xml"
00102         print " Using XMLDDDB at",det.DetDbLocation
00103         return

def test-GeneratorAlg::TestGenerator::run (   self)

Definition at line 104 of file test-GeneratorAlg.py.

00105                  :
00106         self.app.run(self.nevents)
00107         return


Member Data Documentation

Definition at line 4 of file test-GeneratorAlg.py.

test-GeneratorAlg::TestGenerator::nevents

Definition at line 4 of file test-GeneratorAlg.py.

test-GeneratorAlg::TestGenerator::volume

Definition at line 4 of file test-GeneratorAlg.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:18:51 for GenTools by doxygen 1.7.4