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

In This Package:

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 23 of file FullChain.py.


Member Function Documentation

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

Definition at line 27 of file FullChain.py.

00029                            :
00030         self.parse_args(argv)
        return

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

Definition at line 31 of file FullChain.py.

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

def FullChain::ConfigureFullChain::configureKinematic (   self  ) 

Definition at line 72 of file FullChain.py.

00074                                 :
00075         #from Stage.gun import gun
00076         #gun=gun(stage=self.stage_cfg,start_time=self.start_time_seconds)
00077 
00078         #from Stage.Muon import Muon
00079         #muon=Muon(stage=self.stage_cfg,start_time=self.start_time_seconds)
00080 
00081         from FastMuon import FastMuon
00082         fastMuon=FastMuon(stage=self.stage_cfg,
00083                           start_time=self.start_time_seconds,
00084                           seed=self.opts.seed)
00085 
00086         #from GunMuon import GunMuon
00087         #gunMuon=GunMuon(stage=self.stage_cfg,
00088         #                start_time=self.start_time_seconds,
00089         #                seed=self.opts.seed)
00090 
        return

def 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.UseScintillation = False
00104         #optical.CerenPhotonScaleWeight = 3.5
00105         optical.UseCerenkov = False
00106         #optical.ScintPhotonScaleWeight = 3.5
00107 
00108         ## ......
00109         ## ApplyWaterQe and WaterCerenQeApplied should be same
00110         optical.ApplyWaterQe = True
00111         from DetSim.DetSimConf import DsPmtSensDet
00112         pmtsd = DsPmtSensDet("GiGaGeo.DsPmtSensDet")
00113         pmtsd.WaterCerenQeApplied = optical.ApplyWaterQe
00114         ## ......
00115 
00116         from DetSimProc.DetSimProcConf import DetSimProc
00117         dsp = DetSimProc()
00118         dsp.ThisStageName = "Detector"
00119         dsp.LowerStageName = "Kinematic"
00120         #dsp.OutputLevel = 2
00121         self.stage_cfg.DetectorSequence.Members.append(dsp)
        return

def FullChain::ConfigureFullChain::configureElectronic (   self  ) 

Configure the Electronics stage

Definition at line 122 of file FullChain.py.

00124                                  :
00125         '''Configure the Electronics stage'''
00126 
00127         import ElecSim
00128         es = ElecSim.Configure(use_push_algs = False)
00129 
00130         from ElecSimProc.ElecSimProcConf import ElecSimProc
00131         esp = ElecSimProc()
00132         esp.ThisStageName = "Electronic"
00133         esp.LowerStageName = "Detector"
00134         #esp.OutputLevel = 2
00135         self.stage_cfg.ElectronicSequence.Members.append(esp)
        return

def FullChain::ConfigureFullChain::configureTrigRead (   self  ) 

Configure the Trigger and Readout stage

Definition at line 136 of file FullChain.py.

00138                                :
00139         '''Configure the Trigger and Readout stage'''
00140         from TrigReadProc.TrigReadProcConf import TrigReadProc
00141         tsp = TrigReadProc()
00142         tsp.ThisStageName = "TrigRead"
00143         tsp.LowerStageName = "Electronic"
00144         #tsp.TrigTools = [...]
00145         #tsp.RoTools = [...]
00146         #tsp.OutputLevel = 2
00147         self.stage_cfg.TrigReadSequence.Members.append(tsp)
        return

def FullChain::ConfigureFullChain::configureSingleLoader (   self  ) 

Configure the SingleLoader stage

Definition at line 148 of file FullChain.py.

00150                                    :
00151         '''Configure the SingleLoader stage'''
00152         from SingleLoader.SingleLoaderConf import SingleLoader
00153         sll = SingleLoader()
00154         sll.ThisStageName = "SingleLoader"
00155         sll.LowerStageName = "TrigRead"
00156         #sll.OutputLevel = 2
        self.stage_cfg.SingleLoaderSequence.Members.append(sll)

def FullChain::ConfigureFullChain::configureSim15 (   self  ) 

Definition at line 157 of file FullChain.py.

00159                             :
00160         from Stage.StageConf import Sim15
00161         sim15=Sim15()
00162         sim15.TopStage=self.opts.top_stage
00163         
00164         from Gaudi.Configuration import ApplicationMgr
00165         theApp = ApplicationMgr()
        theApp.TopAlg.append(sim15)

def FullChain::ConfigureFullChain::configure (   self  ) 

Definition at line 166 of file FullChain.py.

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


Member Data Documentation

FullChain::ConfigureFullChain::opts

Definition at line 52 of file FullChain.py.

FullChain::ConfigureFullChain::args

Definition at line 53 of file FullChain.py.

FullChain::ConfigureFullChain::start_time_seconds

Definition at line 61 of file FullChain.py.

FullChain::ConfigureFullChain::stage_cfg

Definition at line 169 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 21:01:52 2011 for MuonProphet by doxygen 1.4.7