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 | |
stage_cfg |
Configure a Full Chain of pull simulations for cosmics and LEDs.
Definition at line 26 of file runDoublePulse.py.
def share::runDoublePulse::ConfigureDoublePulse::__init__ | ( | self, | ||
argv | ||||
) |
def share::runDoublePulse::ConfigureDoublePulse::parse_args | ( | self, | ||
argv | ||||
) |
Definition at line 36 of file runDoublePulse.py.
00038 : 00039 from optparse import OptionParser 00040 import time 00041 import sys 00042 parser = OptionParser(usage=self.__doc__) 00043 00044 parser.add_option("-T","--top-stage", 00045 help="Kinematic,Detector,Electronic,TrigRead,SingleLoader", 00046 default="SingleLoader") 00047 00048 # Primary LED specification 00049 parser.add_option("-I","--Primary-LED-intensity", 00050 help="Number of photons per LED flash for primary LED. If <= 0 then no LED flashing enabled.", 00051 default=3500, type="int") 00052 00053 # Secondary LED specification. Default is no secondary LED. 00054 parser.add_option("-i","--Secondary-LED-intensity", 00055 help="Number of photons per LED flash for secondary LED. If <= 0 then SECONDARY LED flashing is DISABLED.", 00056 default=-1, type="int") 00057 00058 # double-pulse delay 00059 parser.add_option("-D","--Double-pulse-delay", 00060 help="Delay in nanoseconds of Secondary LED with respect to Primary LED for double-pulse", 00061 default=30.e3, 00062 type="float") 00063 00064 00065 # Now parse options to setup the job. Quit if invalid inputs are found. 00066 (options,args) = parser.parse_args(args=argv) 00067 self.opts = options 00068 self.args = args 00069 00070 print 'Top stage =',self.opts.top_stage 00071 00072 print "ACU A LED intensity/flash (photons) = ", self.opts.Primary_LED_intensity 00073 print "ACU B LED intensity/flash (photons) = ", self.opts.Secondary_LED_intensity 00074 print 'Double-pulse separation (ns) = ',self.opts.Double_pulse_delay 00075 return
def share::runDoublePulse::ConfigureDoublePulse::configureKinematic | ( | self | ) |
Definition at line 76 of file runDoublePulse.py.
00078 : 00079 00080 # only import and configure LED if it will be used 00081 from MDC10b.runLED_Muon import LED 00082 led1=LED.LED(stage=self.stage_cfg, 00083 name='PrimaryLED', 00084 intensity=self.opts.Primary_LED_intensity, 00085 time_offset_in_nanosec=0, 00086 ledName='DayaBayAD1_ACU_A_Center_LED') 00087 00088 led2=LED.LED(stage=self.stage_cfg, 00089 name='SecondaryLED', 00090 intensity=self.opts.Secondary_LED_intensity, 00091 time_offset_in_nanosec= self.opts.Double_pulse_delay, 00092 ledName= 'DayaBayAD1_ACU_B_GdlsEdge_LED') 00093 return
def share::runDoublePulse::ConfigureDoublePulse::configureDetector | ( | self | ) |
Configure the Detector stage
Definition at line 94 of file runDoublePulse.py.
00096 : 00097 '''Configure the Detector stage''' 00098 00099 # only use basic physics list, not nuclear. 00100 # set volume to simulate SAB (or full daya bay site, if chosen by user option) 00101 import DetSim 00102 from DetSim import Configure 00103 00104 Configure.giga_dayabay_items = ["/dd/Structure/AD/db-ade1"] # set volume to simulate 00105 00106 ds = Configure(physlist=DetSim.physics_list_basic, 00107 use_push_algs = False, 00108 site = 'dayabay') 00109 00110 00111 # QuantumEfficiency*CollectionEfficiency*QEScale = 0.24*1/0.9 00112 from DetSim.DetSimConf import DsPhysConsOptical 00113 optical = DsPhysConsOptical("GiGa.GiGaPhysListModular.DsPhysConsOptical") 00114 optical.UseScintillation = False 00115 #optical.ScintPhotonScaleWeight = 3.5 00116 #optical.UseCerenkov = False 00117 optical.CerenPhotonScaleWeight = 3.5 00118 00119 ## ...... 00120 ## ApplyWaterQe and WaterCerenQeApplied should be same 00121 optical.ApplyWaterQe = True 00122 from DetSim.DetSimConf import DsPmtSensDet 00123 pmtsd = DsPmtSensDet("GiGaGeo.DsPmtSensDet") 00124 pmtsd.WaterCerenQeApplied = optical.ApplyWaterQe 00125 ## ...... 00126 00127 from DetSimProc.DetSimProcConf import DetSimProc 00128 dsp = DetSimProc() 00129 dsp.ThisStageName = "Detector" 00130 dsp.LowerStageName = "Kinematic" 00131 #dsp.OutputLevel = 2 00132 self.stage_cfg.DetectorSequence.Members.append(dsp) 00133 00134 return
def share::runDoublePulse::ConfigureDoublePulse::configureElectronic | ( | self | ) |
Configure the Electronics stage
Definition at line 135 of file runDoublePulse.py.
00137 : 00138 '''Configure the Electronics stage''' 00139 00140 import ElecSim 00141 es = ElecSim.Configure(use_push_algs = False) 00142 00143 # turn off non-linear model (suspect that it fails for many pe pulse) 00144 from ElecSim.ElecSimConf import EsPmtEffectPulseTool 00145 pmtTool = EsPmtEffectPulseTool() 00146 pmtTool.AfterPulseAmpMode="PDF" 00147 pmtTool.EnablePrePulse=True 00148 pmtTool.EnableAfterPulse=True 00149 00150 from ElecSim.ElecSimConf import EsIdealFeeTool 00151 feeTool = EsIdealFeeTool() 00152 feeTool.EnableNonlinearity=True 00153 feeTool.EnableOvershoot=True 00154 feeTool.EnableRinging=True 00155 00156 from ElecSimProc.ElecSimProcConf import ElecSimProc 00157 esp = ElecSimProc() 00158 esp.ThisStageName = "Electronic" 00159 esp.LowerStageName = "Detector" 00160 self.stage_cfg.ElectronicSequence.Members.append(esp) 00161 00162 00163 from StatisticsSvc.StatisticsSvcConf import StatisticsSvc 00164 statsSvc = StatisticsSvc() 00165 statsSvc.Output ={"file1":"waveforms.root"} 00166 return
def share::runDoublePulse::ConfigureDoublePulse::configureTrigRead | ( | self | ) |
Configure the Trigger and Readout stage
Definition at line 167 of file runDoublePulse.py.
00169 : 00170 '''Configure the Trigger and Readout stage''' 00171 from TrigReadProc.TrigReadProcConf import TrigReadProc 00172 tsp = TrigReadProc() 00173 tsp.ThisStageName = "TrigRead" 00174 tsp.LowerStageName = "Electronic" 00175 00176 # setup Nhit trigger for Daya Bay AD1 = AD in SAB 00177 from TrigSim.TrigSimConf import TsMultTriggerTool 00178 mtt = TsMultTriggerTool() 00179 mtt.ADThreshold = 25 00180 mtt.DetectorsToProcess = ["DayaBayAD1"] 00181 00182 tsp.TrigTools = [mtt] 00183 00184 self.stage_cfg.TrigReadSequence.Members.append(tsp) return
def share::runDoublePulse::ConfigureDoublePulse::configureSingleLoader | ( | self | ) |
Configure the SingleLoader stage
Definition at line 185 of file runDoublePulse.py.
00187 : 00188 '''Configure the SingleLoader stage''' 00189 from SingleLoader.SingleLoaderConf import SingleLoader 00190 sll = SingleLoader() 00191 sll.ThisStageName = "SingleLoader" 00192 sll.LowerStageName = "TrigRead" 00193 #sll.OutputLevel = 2 self.stage_cfg.SingleLoaderSequence.Members.append(sll)
def share::runDoublePulse::ConfigureDoublePulse::configureSim15 | ( | self | ) |
Definition at line 194 of file runDoublePulse.py.
00196 : 00197 from Stage.StageConf import Sim15 00198 sim15=Sim15() 00199 sim15.TopStage=self.opts.top_stage 00200 00201 from Gaudi.Configuration import ApplicationMgr 00202 theApp = ApplicationMgr() 00203 theApp.TopAlg.append(sim15) 00204
def share::runDoublePulse::ConfigureDoublePulse::configure | ( | self | ) |
Definition at line 205 of file runDoublePulse.py.
00207 : 00208 00209 from Stage import Configure as StageConfigure 00210 self.stage_cfg = StageConfigure() 00211 00212 stagedic={'Kinematic':1,'Detector':2,'Electronic':3,'TrigRead':4,'SingleLoader':5} 00213 00214 if not self.opts.top_stage in stagedic: 00215 print 'Error, wrong top stage parameter.', self.opts.top_stage 00216 print 'Valid stage is Kinematic, Detector, Electronic, TrigRead or SingleLoader' 00217 00218 for stg,idx in stagedic.iteritems(): 00219 if idx <= stagedic[self.opts.top_stage]: 00220 self.stage_cfg.addStages([stg]) ## stage tools are configured here. 00221 00222 for stg in self.stage_cfg.stages: 00223 #self.stage_cfg.__dict__[stg].OutputLevel = 2 00224 pass 00225 00226 if stagedic[self.opts.top_stage]>=1: 00227 self.configureKinematic() 00228 if stagedic[self.opts.top_stage]>=2: 00229 self.configureDetector() 00230 if stagedic[self.opts.top_stage]>=3: 00231 self.configureElectronic() 00232 if stagedic[self.opts.top_stage]>=4: 00233 self.configureTrigRead() 00234 if stagedic[self.opts.top_stage]>=5: 00235 self.configureSingleLoader() 00236 00237 self.configureSim15() 00238 return
Definition at line 65 of file runDoublePulse.py.
Definition at line 66 of file runDoublePulse.py.
Definition at line 208 of file runDoublePulse.py.