/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
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.


Constructor & Destructor Documentation

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

Definition at line 29 of file FullChain.py.

00030                            :
00031         self.parse_args(argv)
00032         return


Member Function Documentation

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

Definition at line 33 of file FullChain.py.

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

def FullChain::ConfigureFullChain::configureKinematic (   self)

Definition at line 74 of file FullChain.py.

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

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

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

Definition at line 125 of file FullChain.py.

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

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

Definition at line 139 of file FullChain.py.

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

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

Definition at line 151 of file FullChain.py.

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

def FullChain::ConfigureFullChain::configureSim15 (   self)

Definition at line 160 of file FullChain.py.

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

def FullChain::ConfigureFullChain::configure (   self)

Definition at line 169 of file FullChain.py.

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

Member Data Documentation

Definition at line 33 of file FullChain.py.

Definition at line 33 of file FullChain.py.

Definition at line 33 of file FullChain.py.

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 Fri May 16 2014 10:21:29 for MuonProphet by doxygen 1.7.4