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

List of all members.

Public Member Functions

def __init__
def parse_args
def configureKinematic
def configureDetector
def configureElectronic
def configureTrigRead
def configureSingleLoader
def configureSim15
def configure

Public Attributes

 opts
 args
 start_time_seconds
 stage_cfg

Detailed Description

Configure a Full Chain of pull simulations.

Definition at line 16 of file FullChain.py.


Constructor & Destructor Documentation

def Stage::FullChain::ConfigureFullChain::__init__ (   self,
  argv 
)

Definition at line 22 of file FullChain.py.

00023                            :
00024         self.parse_args(argv)
00025         return


Member Function Documentation

def Stage::FullChain::ConfigureFullChain::parse_args (   self,
  argv 
)

Definition at line 26 of file FullChain.py.

00027                              :
00028         from optparse import OptionParser
00029         import time
00030         parser = OptionParser(usage=self.__doc__)
00031         default_time_format = '%Y-%m-%dT%H:%M:%S'
00032         parser.add_option("-w","--start-time",
00033                           help="Date string to set simulation start, assumed UTC",
00034                           default=time.strftime(default_time_format,time.gmtime(0)))
00035         parser.add_option("-F","--time-format",
00036                           help="Format for parsing time (see man date), " \
00037                               + "default is '%s'"%default_time_format \
00038                               + " ('[YYYY]-[MM]-[DD]T[HH]:[MM]:[SS]')",
00039                           default=default_time_format)
00040         parser.add_option("-T","--top-stage",
00041                           help="Kinematic,Detector,Electronic,TrigRead,SingleLoader",
00042                           default="SingleLoader")
00043         parser.add_option("-s","--seed",
00044                           help="Random seed for standalone generators",
00045                           default=1234567)
00046 
00047         (options,args) = parser.parse_args(args=argv)
00048         self.opts = options
00049         self.args = args
00050 
00051         timeformat = self.opts.time_format
00052         print "Using time format =",timeformat
00053 
00054         try:
00055             datestring = self.opts.start_time
00056         except AttributeError:
00057             self.start_time_seconds = 0
00058         else:
00059             # This may raise ValueError if string and format don't
00060             # match.  Just let it get thrown.
00061             t = time.strptime(datestring,timeformat)
00062             self.start_time_seconds = time.mktime(t) - time.timezone
00063         print 'Start time in seconds UTC =',self.start_time_seconds
00064         print 'Top stage =',self.opts.top_stage
00065 
00066         return

def Stage::FullChain::ConfigureFullChain::configureKinematic (   self)

Definition at line 67 of file FullChain.py.

00068                                 :
00069         #from Stage.gun import gun
00070         #gun=gun(stage=self.stage_cfg,start_time=self.start_time_seconds)
00071 
00072         #from Stage.Muon import Muon
00073         #muon=Muon(stage=self.stage_cfg,start_time=self.start_time_seconds)
00074 
00075         from FastMuon import FastMuon
00076         fastMuon=FastMuon(stage=self.stage_cfg,start_time=self.start_time_seconds)
00077 
00078         #from Stage.IBD import IBD
00079         #ibd=IBD(stage=self.stage_cfg,
00080         #        start_time=self.start_time_seconds,
00081         #        seed=self.opts.seed)
00082 
00083         #from Stage.K40 import K40
00084         #k40=K40(stage=self.stage_cfg,start_time=self.start_time_seconds)
00085 
00086         #from Stage.U import Uranium
00087         #u=Uranium(stage=self.stage_cfg,start_time=self.start_time_seconds)
00088 
00089         #from Stage.Th import Thorium
00090         #th=Thorium(stage=self.stage_cfg,start_time=self.start_time_seconds)
00091 
00092         return

def Stage::FullChain::ConfigureFullChain::configureDetector (   self)
Configure the Detector stage

Definition at line 93 of file FullChain.py.

00094                                :
00095         '''Configure the Detector stage'''
00096         
00097         import DetSim
00098         ds = DetSim.Configure(physlist=DetSim.physics_list_basic+DetSim.physics_list_nuclear,
00099                               use_push_algs = False)
00100 
00101         # QuantumEfficiency*CollectionEfficiency*QEScale = 0.24*1/0.9
00102         from DetSim.DetSimConf import DsPhysConsOptical
00103         optical = DsPhysConsOptical()
00104         optical.CerenPhotonScaleWeight = 3.5
00105         optical.ScintPhotonScaleWeight = 3.5
00106 
00107         from DetSimProc.DetSimProcConf import DetSimProc
00108         dsp = DetSimProc()
00109         dsp.ThisStageName = "Detector"
00110         dsp.LowerStageName = "Kinematic"
00111         #dsp.OutputLevel = 2
00112         self.stage_cfg.DetectorSequence.Members.append(dsp)
00113         return

def Stage::FullChain::ConfigureFullChain::configureElectronic (   self)
Configure the Electronics stage

Definition at line 114 of file FullChain.py.

00115                                  :
00116         '''Configure the Electronics stage'''
00117 
00118         import ElecSim
00119         es = ElecSim.Configure(use_push_algs = False)
00120 
00121         from ElecSimProc.ElecSimProcConf import ElecSimProc
00122         esp = ElecSimProc()
00123         esp.ThisStageName = "Electronic"
00124         esp.LowerStageName = "Detector"
00125         #esp.OutputLevel = 2
00126         self.stage_cfg.ElectronicSequence.Members.append(esp)
00127         return

def Stage::FullChain::ConfigureFullChain::configureTrigRead (   self)
Configure the Trigger and Readout stage

Definition at line 128 of file FullChain.py.

00129                                :
00130         '''Configure the Trigger and Readout stage'''
00131         from TrigReadProc.TrigReadProcConf import TrigReadProc
00132         tsp = TrigReadProc()
00133         tsp.ThisStageName = "TrigRead"
00134         tsp.LowerStageName = "Electronic"
00135         #tsp.TrigTools = [...]
00136         #tsp.RoTools = [...]
00137         #tsp.OutputLevel = 2
00138         self.stage_cfg.TrigReadSequence.Members.append(tsp)
00139         return

def Stage::FullChain::ConfigureFullChain::configureSingleLoader (   self)
Configure the SingleLoader stage

Definition at line 140 of file FullChain.py.

00141                                    :
00142         '''Configure the SingleLoader stage'''
00143         from SingleLoader.SingleLoaderConf import SingleLoader
00144         sll = SingleLoader()
00145         sll.ThisStageName = "SingleLoader"
00146         sll.LowerStageName = "TrigRead"
00147         #sll.OutputLevel = 2
00148         self.stage_cfg.SingleLoaderSequence.Members.append(sll)

def Stage::FullChain::ConfigureFullChain::configureSim15 (   self)

Definition at line 149 of file FullChain.py.

00150                             :
00151         from Stage.StageConf import Sim15
00152         sim15=Sim15()
00153         sim15.TopStage=self.opts.top_stage
00154 
00155         from Gaudi.Configuration import ApplicationMgr
00156         theApp = ApplicationMgr()
00157         theApp.TopAlg.append(sim15)

def Stage::FullChain::ConfigureFullChain::configure (   self)

Definition at line 158 of file FullChain.py.

00159                        :
00160 
00161         from Stage import Configure as StageConfigure
00162         self.stage_cfg = StageConfigure()
00163 
00164         stagedic={'Kinematic':1,'Detector':2,'Electronic':3,'TrigRead':4,'SingleLoader':5}
00165 
00166         if not self.opts.top_stage in stagedic:
00167             print 'Error, wrong top stage parameter.', self.opts.top_stage
00168             print 'Valid stage is Kinematic, Detector, Electronic, TrigRead or SingleLoader'
00169 
00170         for stg,idx in stagedic.iteritems():
00171             if idx <= stagedic[self.opts.top_stage]:
00172                 self.stage_cfg.addStages([stg])           ## stage tools are configured here.
00173                 
00174         for stg in self.stage_cfg.stages:
00175             #self.stage_cfg.__dict__[stg].OutputLevel = 2
00176             pass
00177 
00178         if stagedic[self.opts.top_stage]>=1:
00179             self.configureKinematic()
00180         if stagedic[self.opts.top_stage]>=2:
00181             self.configureDetector()
00182         if stagedic[self.opts.top_stage]>=3:
00183             self.configureElectronic()
00184         if stagedic[self.opts.top_stage]>=4:
00185             self.configureTrigRead()
00186         if stagedic[self.opts.top_stage]>=5:
00187             self.configureSingleLoader()
00188 
00189         self.configureSim15()
00190         
00191         return
        

Member Data Documentation

Definition at line 26 of file FullChain.py.

Definition at line 26 of file FullChain.py.

Definition at line 26 of file FullChain.py.

Definition at line 158 of file FullChain.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:07:33 for Stage by doxygen 1.7.4