41 query="select rt.validflag, rt.region_id, mp.r, mp.t from " + data_schema + ".mdt_rt rt, " + data_schema + ".mdt_rt_map mp where mp.head_id=:hid and rt.head_id=:hid and rt.region_id= mp.region_id and mp.calibflag= rt.calibflag and mp.point_nr<rt.bins and rt.validflag>2 order by rt.region_id, mp.point_nr"
42 cursor.arraysize = 1000*100
43
44 cursor.execute(query, {'hid': head_id})
45 rt_gr={}
46 rt_sp={}
47 r=[]
48 t=[]
49 prev_id=None
50for validflag_in, region_id, r_p, t_p in cursor.fetchall():
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"