74 ra = CalibDbInfo.dbr[CalibDbInfo.calibdb]
75 tns = CalibDbInfo.tns[CalibDbInfo.calibdb]
76 connection=cx_Oracle.connect(ra, reader_passwd, tns)
77 cursor=connection.cursor()
80 query=
"select CHAMBER, TUBE_ID, TO_NUMBER(P4), VALIDFLAG, TO_NUMBER(ADC_0) from " + data_schema +
".MDT_TUBE where head_id=:hid and validflag>2 order by chamber"
81 cursor.arraysize = 1000*400
82 cursor.execute(query, {
'hid': head_id})
86 filled_chambers=
set([])
87 for chamber, tube, t0, validflag, adc
in cursor.fetchall():
88 if prev_chamber != chamber:
91 t0s[(up.stationNameString(), up.stationPhi(), up.stationEta())] =
build_t0_vec(current_values)
92 filled_chambers.add(prev_chamber)
93 prev_chamber = chamber
96 tid=288 * (up.mdtMultilayer() - 1) + 72 * (up.mdtTubeLayer() - 1) + (up.mdtTube() - 1 )
97 current_values[tid] = (t0, validflag, adc)
99 t0s[(up.stationNameString(), up.stationPhi(), up.stationEta())] =
build_t0_vec(current_values)