/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 #!/usr/bin/env python 00002 # 00003 # Generate a random table of FEE channel properties 00004 # for use in the electronics simulation 00005 00006 import random 00007 00008 import makeFeeCableMap 00009 00010 def makeFeeProperties(): 00011 "Return a list of FEE channels and their properties" 00012 properties = [] 00013 feeIds = makeFeeCableMap.getFeeChannelIds() 00014 #print "nDetectors = ",len(pmtIds) 00015 detectors = feeIds.keys() 00016 detectors.sort() 00017 for detector in detectors: 00018 #print "Detector",detector.detName(),"nPmts = ",len(pmtIds[detector]) 00019 for channelId in feeIds[detector]: 00020 properties.append( getProperties(channelId) ) 00021 return properties 00022 00023 def makeFeeCalibProperties(): 00024 "Return a list of FEE channels and their properties" 00025 properties = [] 00026 feeIds = makeFeeCableMap.getFeeChannelIds() 00027 #print "nDetectors = ",len(pmtIds) 00028 detectors = feeIds.keys() 00029 detectors.sort() 00030 for detector in detectors: 00031 #print "Detector",detector.detName(),"nPmts = ",len(pmtIds[detector]) 00032 for channelId in feeIds[detector]: 00033 properties.append( getCalibProperties(channelId) ) 00034 return properties 00035 00036 def getProperties(channelId): 00037 "Generate simulation properties for this FEE channel" 00038 channelThreshold = 0.0025 # Volts 00039 adcRangeHigh = 0.1 # Volts 00040 adcRangeLow = 1.0 # Volts 00041 adcBaselineHigh = 500.0 00042 adcBaselineLow = 500.0 00043 00044 description = makeFeeCableMap.channelDescription(channelId) 00045 format = "%-2d %30s %-4.4f %-4.3f %-4.3f %-4.2f %-4.2f" 00046 line = format % (channelId.fullPackedData(), 00047 description, 00048 channelThreshold, 00049 adcRangeHigh, 00050 adcRangeLow, 00051 adcBaselineHigh, 00052 adcBaselineLow) 00053 return line 00054 00055 def getCalibProperties(channelId): 00056 "Generate calibration properties for this FEE channel" 00057 status = 1 00058 adcThresholdHigh = 5.0 00059 adcThresholdLow = 0.0 00060 adcBaselineHigh = 500.0 00061 adcBaselineLow = 500.0 00062 00063 description = makeFeeCableMap.channelDescription(channelId) 00064 format = "%-2d %30s %-4.3f %-4.3f %-4.2f %-4.2f" 00065 line = format % (channelId.fullPackedData(), 00066 description, 00067 adcThresholdHigh, 00068 adcThresholdLow, 00069 adcBaselineHigh, 00070 adcBaselineLow) 00071 return line 00072 00073 00074 def printFeeProperties(): 00075 "Print table of Channel properties" 00076 print "# Simulation input data for FEE channel properties" 00077 print "# channelId description channelThreshold[V] adcRangeHigh[V] adcRangeLow[V] adcBaselineHigh adcBaselineLow" 00078 lines = makeFeeProperties() 00079 for line in lines: 00080 print line 00081 00082 def printFeeCalibProperties(): 00083 "Print table of Channel properties" 00084 print "# Calibration for FEE channel properties" 00085 print "# channelId description adcThresholdHigh adcThresholdLow adcBaselineHigh adcBaselineLow" 00086 lines = makeFeeCalibProperties() 00087 for line in lines: 00088 print line 00089 00090 if __name__ == "__main__": 00091 #printFeeProperties() 00092 printFeeCalibProperties() 00093 00094