/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

TestRPCsim.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import GaudiKernel.SystemOfUnits as units
00004 from DybPython.Constants import *
00005 
00006 class ConfigureTest:
00007 
00008     '''
00009     simple usage example:
00010 
00011     nuwa.py --history=off -n 10 -o output.root TestRPCsim
00012 
00013     For a list of the options, run
00014 
00015     nuwa.py -m "TestRPCElecSim --help"
00016 
00017     Note: You need to turn off simheader conversion to run this module:
00018 
00019     export NUWA_PRUNESIMHITS=1 (sh)
00020     setenv NUWA_PRUNESIMHITS 1 (csh)
00021     '''
00022 
00023     def __init__(self,argv):
00024 
00025         self.parse_args(argv)
00026 
00027         return
00028 
00029     def parse_args(self,argv):
00030 
00031         import optparse
00032 
00033         parser = optparse.OptionParser(usage=self.__doc__)
00034 
00035         parser.add_option("-D","--detector",
00036                           help="List of detectors to be simulated. [default: %default]",
00037                           default='DayaBayRPC',
00038                           type="string")
00039         parser.add_option("-c","--single_Channel",
00040                           help="Only simulate 1 channel per detector. [default: %default]",
00041                           action='store_true',
00042                           default=False)
00043         parser.add_option("-t","--delay-Time",
00044                           help="Delay time of in ns. [default: %default]",
00045                           default=500,
00046                           type="float")
00047         parser.add_option("-w","--weight",
00048                           help="Weight of the hits. [default: %default]",
00049                           default=1,
00050                           type="float")
00051         parser.add_option("-s","--time-Spread",
00052                           help="Sigma of Gaussian hit time distribution. [default: %default]",
00053                           default=0,
00054                           type="float")
00055 
00056         (options,args) = parser.parse_args(args=argv)
00057         self.opts = options
00058         self.args = args
00059 
00060 
00061         print "======================================================"
00062         print "Simulate detector ",self.opts.detector
00063         print "------------------------------------------------------"
00064         print "Only simulate 1 channel  = ",self.opts.single_Channel
00065         print "------------------------------------------------------"
00066         print "Delay time = ",self.opts.delay_Time, " ns"
00067         print "------------------------------------------------------"
00068         print "Hit weight = ",self.opts.weight
00069         print "------------------------------------------------------"
00070         print "Gaussian hit time spread = ",self.opts.time_Spread, " ns"
00071         print "======================================================"
00072 
00073         return
00074 
00075     def configure(self):
00076 
00077         from ElecSim.ElecSimConf import EsTestAlg
00078         testAlg = EsTestAlg()
00079         testAlg.Detectors = [self.opts.detector]
00080         testAlg.DelayTime = self.opts.delay_Time
00081         testAlg.Weight = self.opts.weight
00082         testAlg.TimeSmear = self.opts.time_Spread
00083         testAlg.SingleChannel = self.opts.single_Channel
00084 
00085         from Gaudi.Configuration import ApplicationMgr
00086         app = ApplicationMgr()
00087         app.TopAlg.append(testAlg)
00088         app.HistogramPersistency = 'ROOT'
00089 
00090         import ElecSim
00091         elecsim = ElecSim.Configure()
00092 
00093         from ElecSim.ElecSimConf import EsIdealFecTool
00094         fect = EsIdealFecTool()
00095         #fect.IdealNoise = 1*units.kilohertz
00096 
00097         import TrigSim
00098         trigsim = TrigSim.Configure()
00099 
00100         import ReadoutSim
00101         rosim = ReadoutSim.Configure()
00102 
00103         return
00104 
00105 def configure(argv=[]):
00106 
00107     cft = ConfigureTest(argv)
00108     cft.configure()
00109 
00110     return
00111 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:17:05 for ReadoutSim by doxygen 1.7.4