| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

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.


Member Function Documentation

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

Definition at line 20 of file FullChain.py.

00022                            :
00023         self.parse_args(argv)
        return

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

Definition at line 24 of file FullChain.py.

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

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

Definition at line 65 of file FullChain.py.

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

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

Configure the Detector stage

Definition at line 91 of file FullChain.py.

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

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

Configure the Electronics stage

Definition at line 112 of file FullChain.py.

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

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

Configure the Trigger and Readout stage

Definition at line 126 of file FullChain.py.

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

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

Configure the SingleLoader stage

Definition at line 138 of file FullChain.py.

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

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

Definition at line 147 of file FullChain.py.

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

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

Definition at line 156 of file FullChain.py.

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


Member Data Documentation

Stage::FullChain::ConfigureFullChain::opts

Definition at line 45 of file FullChain.py.

Stage::FullChain::ConfigureFullChain::args

Definition at line 46 of file FullChain.py.

Stage::FullChain::ConfigureFullChain::start_time_seconds

Definition at line 54 of file FullChain.py.

Stage::FullChain::ConfigureFullChain::stage_cfg

Definition at line 159 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 Mon Apr 11 20:36:11 2011 for Stage by doxygen 1.4.7