/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
Stage::K40::K40 Class Reference

List of all members.

Public Member Functions

def __init__

Detailed Description

   configure K40 generator

Definition at line 3 of file K40.py.


Constructor & Destructor Documentation

def Stage::K40::K40::__init__ (   self,
  stage = 'null',
  name = 'K40',
  volume = '/dd/Structure/AD/far-oil1',
  start_time = 0,
  seed = 1234567 
)

Definition at line 8 of file K40.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 
00025         gnrtr.ThisStageName = "Kinematic"
00026         gnrtr.TimeStamp = start_time
00027 
00028         if stage != 'null':
00029             stage.KinematicSequence.Members.append(gnrtr)
00030 
00031         # set up each tools
00032         from GaudiKernel import SystemOfUnits as units
00033         from GenTools.GenToolsConf import GtPositionerTool, GtTransformTool, GtTimeratorTool, GtHepEvtGenTool
00034         # Set up Gen
00035 
00036         nevents=5000
00037         hepevt_source="K40.exe -seed %(seed)s -n %(nevents)s|"
00038         # Deal with executable
00039         if hepevt_source[-1] == "|":
00040             exe = hepevt_source.split(' ')[0]
00041             if exe[0] != '/':   # Try to find full path
00042                 import os, os.path
00043                 path = os.getenv('PATH')
00044                 for p in path:
00045                     if (os.path.isfile(path+"/"+exe)):
00046                         exe = path+"/"+exe
00047                         break
00048                     continue
00049                 pass
00050             source = exe + ' ' + ' '.join(hepevt_source.split(' ')[1:])
00051             if "%" in source:   # Fill in any placemarks
00052                 source = source%{'nevents':str(nevents),
00053                                  'seed':str(seed)}
00054                 pass
00055             pass
00056         
00057         
00058         #generator
00059         gen=GtHepEvtGenTool(name+'Gen',HepEvtDataSource = source)
00060         #gen.OutputLevel = 2
00061         gen.HepEvtDataSource = source
00062         
00063         # Set up positioner
00064         pos=GtPositionerTool(name+'Pos',Volume=volume)
00065         pos.Strategy = "FullVolume" # also "AvoidDaughters" and "Surface"
00066         pos.Mode = "Uniform"
00067         #pos.Mode = "Fixed"
00068         pos.Spread = 25*units.m
00069         pos.Position = [0,0,2.5*units.m]
00070         
00071         # Set up timerator
00072         tim=GtTimeratorTool(name+'Tim')
00073         tim.LifeTime = int(30000*units.ns)
00074         
00075         # transform
00076         tra=GtTransformTool(name+'Tra',Volume=volume)
00077         
00078         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:07:33 for Stage by doxygen 1.7.4