/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
ElecSim::Test::ConfigureTest Class Reference

List of all members.

Public Member Functions

def __init__
def parse_args
def configure

Public Attributes

 opts
 args

Detailed Description

simple usage example:

nuwa.py --history=off -n 10 -o output.root ElecSim.Test

For a list of the options, run

nuwa.py -m "ElecSim.Test --help"

Note: You need to turn off simheader conversion to run this module:

export NUWA_PRUNESIMHITS=1 (sh)
setenv NUWA_PRUNESIMHITS 1 (csh)

Definition at line 6 of file Test.py.


Constructor & Destructor Documentation

def ElecSim::Test::ConfigureTest::__init__ (   self,
  argv 
)

Definition at line 23 of file Test.py.

00024                            :
00025         
00026         self.parse_args(argv)
00027         
00028         return
 

Member Function Documentation

def ElecSim::Test::ConfigureTest::parse_args (   self,
  argv 
)

Definition at line 29 of file Test.py.

00030                              :
00031 
00032         import optparse
00033         
00034         parser = optparse.OptionParser(usage=self.__doc__)
00035                 
00036         parser.add_option("-D","--detector",
00037                           help="List of detectors to be simulated. [default: %default]",
00038                           default='DayaBayAD1',
00039                           type="string")
00040         parser.add_option("-c","--single_Channel",
00041                           help="Only simulate 1 channel per detector. [default: %default]",
00042                           action='store_true',
00043                           default=False)
00044         parser.add_option("-q","--prompt-Charge",
00045                           help="Prompt Charge per channel in p.e. [default: %default]",
00046                           default=1,
00047                           type="float")
00048         parser.add_option("-Q","--delayed-Charge",
00049                           help="Delayed charge per channel in p.e. [default: %default]",
00050                           default=0,
00051                           type="int")
00052         parser.add_option("-t","--delay-Time",
00053                           help="Delay time of in ns. [default: %default]",
00054                           default=500,
00055                           type="float")
00056         parser.add_option("-w","--weight",
00057                           help="Weight of the hits. [default: %default]",
00058                           default=1,
00059                           type="float")
00060         parser.add_option("-m","--charge-Mode",
00061                           help="Single PMT charge distribution: Can be either 'Fixed' or 'Poisson' [default: %default]",
00062                           default='Fixed',
00063                           type="string")
00064         parser.add_option("-s","--time-Spread",
00065                           help="Sigma of Gaussian hit time distribution. [default: %default]",
00066                           default=0,
00067                           type="float")
00068         parser.add_option("-F","--fast-Electronics",
00069                           help="Turns on/off fast ElecSim mode for muons. [default: on]",
00070                           action='store_true',
00071                           default=False)
00072         parser.add_option("-a","--afterpulsing",
00073                           help="Turns off afterpulsing simulation. [default: on]",
00074                           action='store_false',
00075                           default=True)
00076         parser.add_option("-d","--darkpulsing",
00077                           help="Turns off dark pulsing simulation. [default: on]",
00078                           action='store_false',
00079                           default=True)
00080         parser.add_option("-p","--prepulsing",
00081                           help="Turns off prepulsing simulation. [default: on]",
00082                           action='store_false',
00083                           default=True)
00084         parser.add_option("-r","--ringing",
00085                           help="Turns on ringing simulation. [default: on]",
00086                           action='store_false',
00087                           default=True)
00088         parser.add_option("-o","--overshoot",
00089                           help="Turns on overshoot simulation. [default: on]",
00090                           action='store_false',
00091                           default=True)
00092         parser.add_option("-f","--fee-Threshold",
00093                           help="Scaling factor of the FEE discriminator threshold. [default: %default]",
00094                           default=1.0,
00095                           type="float")
00096         parser.add_option("-n","--nhit-Threshold",
00097                           help="Multiplicity trigger threshold, 0 turns off  nhit trigger. [default: %default]",
00098                           default=10,
00099                           type="int")
00100         parser.add_option("-e","--esum-Threshold",
00101                           help="Energy trigger threshold, 0 turns off esum trigger. [default: %default]",
00102                           default=0,
00103                           type="float")
00104         parser.add_option("-A","--fadc-Readout",
00105                           help="Turn on fADC readout. [default: off]",
00106                           action='store_true',
00107                           default=False)
00108 
00109         (options,args) = parser.parse_args(args=argv)
00110         self.opts = options
00111         self.args = args
00112         
00113         if self.opts.esum_Threshold != 0 and self.opts.nhit_Threshold != 0:
00114           
00115             self.opts.esum_Threshold = 0
00116             print "ESum trigger is turned off"
00117             
00118         print "======================================================"
00119         print "Simulate detector ",self.opts.detector
00120         print "------------------------------------------------------"
00121         print "Only simulate 1 channel  = ",self.opts.single_Channel
00122         print "------------------------------------------------------"
00123         print "Prompt charge = ",self.opts.prompt_Charge, " p.e. per PMT"
00124         print "------------------------------------------------------"
00125         print "Delayed charge = ",self.opts.delayed_Charge, " p.e. per PMT"
00126         print "------------------------------------------------------"
00127         print "Delay time = ",self.opts.delay_Time, " ns"
00128         print "------------------------------------------------------"
00129         print "Hit weight = ",self.opts.weight
00130         print "------------------------------------------------------"
00131         print "Charge distribution = ",self.opts.charge_Mode
00132         print "------------------------------------------------------"
00133         print "Gaussian hit time spread = ",self.opts.time_Spread, " ns"
00134         print "------------------------------------------------------"
00135         print "Fast electronics  = ",self.opts.fast_Electronics
00136         print "------------------------------------------------------"
00137         print "Prepulsing simulation   = ",self.opts.prepulsing
00138         print "------------------------------------------------------"
00139         print "Afterpulsing simulation   = ",self.opts.afterpulsing
00140         print "------------------------------------------------------"
00141         print "Dark pulsing simulation   = ",self.opts.darkpulsing
00142         print "------------------------------------------------------"
00143         print "Ringing simulation  = ",self.opts.ringing
00144         print "------------------------------------------------------"
00145         print "Overshoot simulation  = ",self.opts.overshoot
00146         print "------------------------------------------------------"
00147         print "Discriminator threshold scale = ",self.opts.fee_Threshold
00148         print "------------------------------------------------------"
00149         print "nHit threshold  = ",self.opts.nhit_Threshold
00150         print "------------------------------------------------------"
00151         print "ESum threshold  = ",self.opts.esum_Threshold, " Volt"
00152         print "------------------------------------------------------"
00153         print "FADC readout  = ",self.opts.fadc_Readout
00154         print "======================================================"
00155 
00156         return
        
def ElecSim::Test::ConfigureTest::configure (   self)

Definition at line 157 of file Test.py.

00158                        :
00159         
00160         from ElecSim.ElecSimConf import EsTestAlg
00161         testAlg = EsTestAlg()
00162         testAlg.Detectors = [self.opts.detector]
00163         testAlg.PromptCharge = self.opts.prompt_Charge
00164         testAlg.DelayedCharge = self.opts.delayed_Charge
00165         testAlg.DelayTime = self.opts.delay_Time
00166         testAlg.Weight = self.opts.weight
00167         testAlg.ChargeMode = self.opts.charge_Mode
00168         testAlg.TimeSmear = self.opts.time_Spread
00169         testAlg.SingleChannel = self.opts.single_Channel
00170         
00171         from Gaudi.Configuration import ApplicationMgr
00172         app = ApplicationMgr()
00173         app.TopAlg.append(testAlg)
00174         app.HistogramPersistency = 'ROOT'
00175         
00176         import ElecSim
00177         elecsim = ElecSim.Configure()
00178         
00179         from ElecSim.ElecSimConf import EsPmtEffectPulseTool
00180         pmtTool = EsPmtEffectPulseTool()
00181         pmtTool.EnableAfterPulse = self.opts.afterpulsing
00182         pmtTool.EnableDarkPulse = self.opts.darkpulsing
00183         pmtTool.EnablePrePulse = self.opts.prepulsing
00184         
00185         from ElecSim.ElecSimConf import EsIdealFeeTool
00186         feeTool = EsIdealFeeTool()
00187         feeTool.EnableFastSimMode = self.opts.fast_Electronics
00188         feeTool.EnableOvershoot = self.opts.overshoot
00189         feeTool.EnableRinging = self.opts.ringing
00190         feeTool.DiscThreshScale = self.opts.fee_Threshold
00191         if self.opts.nhit_Threshold != 0:
00192             feeTool.NHitTriggerThreshold = self.opts.nhit_Threshold
00193         else:
00194             feeTool.NHitTriggerThreshold = 200
00195         if self.opts.esum_Threshold != 0:    
00196             feeTool.TotalESumTriggerThreshold = self.opts.esum_Threshold*units.volt
00197         else:
00198             feeTool.TotalESumTriggerThreshold = 10*units.volt 
00199             
00200         import TrigSim
00201         trigsim = TrigSim.Configure()
00202         
00203         if self.opts.nhit_Threshold != 0:
00204             nht = self.opts.nhit_Threshold
00205             from TrigSim import TrigSimConf
00206             #Set nHit trigger threshold
00207             mt = TrigSimConf.TsMultTriggerTool()
00208             mt.NHitTriggerThreshold={"DayaBayAD1":nht,
00209                                     "DayaBayAD2":nht,
00210                                     "DayaBayIWS":nht,
00211                                     "DayaBayOWS":nht,
00212                                     "LingAoAD1":nht,
00213                                     "LingAoAD2":nht,
00214                                     "LingAoIWS":nht,
00215                                     "LingAoOWS":nht,
00216                                     "FarAD1":nht,
00217                                     "FarAD2":nht,
00218                                     "FarAD3":nht,
00219                                     "FarAD4":nht,
00220                                     "FarIWS":nht,
00221                                     "FarOWS":nht}
00222         if self.opts.esum_Threshold != 0:
00223             est = self.opts.esum_Threshold*units.volt
00224             from TrigSim.TrigSimConf import TsESumTriggerTool
00225             #Set ESum trigger threshold
00226             import TrigSim.TrigSimConf as TsConf
00227             TsConf.TsTriggerAlg().TrigTools=["TsESumTriggerTool"]
00228             TsConf.TsESumTriggerTool().UpperLowerThresholdMap={"DayaBayAD1":est,
00229                                                               "DayaBayAD2":est, 
00230                                                               "DayaBayIWS":est,
00231                                                               "DayaBayOWS":est,
00232                                                               "LingAoAD1":est,
00233                                                               "LingAoAD2":est,
00234                                                               "LingAoIWS":est,
00235                                                               "LingAoOWS":est,
00236                                                               "FarAD1":est,
00237                                                               "FarAD2":est,
00238                                                               "FarAD3":est,
00239                                                               "FarAD4":est,
00240                                                               "FarIWS":est,
00241                                                               "FarOWS":est}
00242                                                               
00243             TsConf.TsESumTriggerTool().DigitalTotalThresholdMap={"DayaBayAD1":est,
00244                                                               "DayaBayAD2":est,
00245                                                               "DayaBayIWS":est,
00246                                                               "DayaBayOWS":est,
00247                                                               "LingAoAD1":est,
00248                                                               "LingAoAD2":est,
00249                                                               "LingAoIWS":est,
00250                                                               "LingAoOWS":est,
00251                                                               "FarAD1":est,
00252                                                               "FarAD2":est,
00253                                                               "FarAD3":est,
00254                                                               "FarAD4":est,
00255                                                               "FarIWS":est,
00256                                                               "FarOWS":est}
00257     
00258         import ReadoutSim
00259         rosim = ReadoutSim.Configure()
00260         import ReadoutSim.ReadoutSimConf as RsConf
00261         RsConf.ROsFeeReadoutTool().EnableFadcReadout=self.opts.fadc_Readout
00262      
        return

Member Data Documentation

Definition at line 29 of file Test.py.

Definition at line 29 of file Test.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:16:37 for ElecSim by doxygen 1.7.4