24 until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):
25
26
27 folderTclas = TileCalibTools.getTilePrefix(True,True)+"TIME/CHANNELOFFSET/LAS"
28
29
30
31 default = cppyy.gbl.std.vector('float')()
32 default.push_back(0.)
33
34
35
36
37 tclasWriter = TileCalibTools.TileBlobWriter(db,folderTclas,'Flt')
38 tclasWriter.setComment(os.getlogin(),fileTclas)
39 parserTclas = TileCalibTools.TileASCIIParser(fileTclas,"Tclas")
40 defTclas = cppyy.gbl.std.vector('std::vector<float>')()
41 defTclas.push_back(default)
42 defTclas.push_back(default)
43
44 ros = 0
45 for mod in range(20):
46 flt = tclasWriter.zeroBlob(ros,mod)
47 flt = tclasWriter.getDrawer(0, 0)
48 flt.init(defTclas,1,0)
49
50 for ros in range(1,5):
51 for mod in range(64):
52
53 tclasWriter.zeroBlob(ros,mod)
54 for chn in range(48):
55 tclas = parserTclas.getData(ros,mod,chn)
56 if not len(tclas):
57 log.warning("%i/%2i/%2i/x: No value found in file", ros,mod,chn)
58 continue
59
60 calibDrawer = tclasWriter.getDrawer(ros,mod)
61 if not calibDrawer.getNObjs():
62 log.info("Initializing drawer %i/%2i\t%i", ros,mod,calibDrawer.getNObjs())
63 calibDrawer.init(defTclas,48,0)
64
65 for adc in range(2):
66 val = float(tclas[adc])
67 log.debug("%i/%2i/%2i/%i: tclas = %f", ros,mod,chn,adc, val)
68 calibDrawer.setData(chn,adc,0,val)
69
71 tclasWriter.setComment(os.getlogin(),"Timing update for all partitions")
72 tclasWriter.register(since, until, folderTag)
73
74
75
76
static std::string getFullTag(const std::string &folder, const std::string &tag)
Returns the full tag string, composed of camelized folder name and tag part.