12 from TileCalibBlobPython
import TileCalibTools
13 from TileCalibBlobObjs.Classes
import TileCalibUtils
17 from TileCalibBlobPython.TileCalibLogger
import getLogger
20 log.setLevel(logging.DEBUG)
25 until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):
28 folder = TileCalibTools.getTilePrefix(
True,
True)+
"NOISE/AUTOCR"
34 default = cppyy.gbl.std.vector(
'float')()
37 defVec = cppyy.gbl.std.vector(
'std::vector<float>')()
38 defVec.push_back(default)
39 defVec.push_back(default)
44 writer = TileCalibTools.TileBlobWriter(db,folder,
'Flt')
45 writer.setComment(os.getlogin(),
"Giulio's file for LBC test n.0, 2009-02-27")
46 parser = TileCalibTools.TileASCIIParser(filePed,
"AutoCr")
49 util = cppyy.gbl.TileCalibUtils()
50 for ros
in range(util.max_ros()):
51 for drawer
in range(util.getMaxDrawer(ros)):
52 writer.zeroBlob(ros,drawer)
53 calibDrawer = writer.getDrawer(0,0)
54 calibDrawer.init(defVec,1,1)
57 for ros
in range(1,5):
60 writer.zeroBlob(ros,mod)
62 values = parser.getData(ros,mod,chn)
64 log.warning(
"%i/%2i/%2i/x: No value found in file", ros,mod,chn)
67 calibDrawer = writer.getDrawer(ros,mod)
68 if not calibDrawer.getNObjs():
69 log.info(
"Initializing drawer %i/%2i\t%i", ros,mod,calibDrawer.getNObjs())
70 calibDrawer.init(defVec,48,1)
73 line =
"%i/%2i/%2i/%i: " % (ros,mod,chn,adc)
75 value =
float(values[adc*6+i])
76 calibDrawer.setData(chn,adc,i,value)
77 line +=
"%f " % (value,)
81 writer.register(since, until, folderTag)
88 db = TileCalibTools.openDb(
'SQLITE',
'CONDBR2',
'UPDATE')