115 from AthenaCommon.Logging
import logging
116 mlog_LRF = logging.getLogger(
'getLArDTRunInfoForRun' )
117 mlog_LRF.info(
"Connecting to database %s", connstring)
119 mlog_LRF.info(
"Found DT info for run %i",run)
122 mlog_LRF.error(
"Cannot connect to database %s",connstring)
123 raise RuntimeError(
"getLArFormatForRun ERROR: Cannot connect to database %s",connstring)
124 typesMap={0:
"ADC", 1:
"RawADC", 2:
"Energy", 3:
"SelectedEnergy",15:
"Invalid"}
131 folder=runDB.getFolder(
'/LAR/Configuration/RunLogDT')
133 obj=folder.findObject(runiov,0)
134 payload=obj.payload()
135 timing=payload[
'timing_configuration']
136 recipe=payload[
'recipe_tdaq']
137 mux.append(ord(payload[
'mux_setting_0']))
138 mux.append(ord(payload[
'mux_setting_1']))
139 adccalib=payload[
'ADCCalibMode']
141 mlog_LRF.warning(
"No information in /LAR/Configuration/RunLogDT for run %i", run)
142 mlog_LRF.warning(
"Using defaults: MUX0: ADC MUX1: ET_ID receipe: at0_bc5-at1_bc1_ts1-q")
143 recipe=
"at0_bc5-at1_bc1_ts1-q"
147 runDB.closeDatabase()
148 mlog_LRF.info(
"Found DT info for run %d", run)
151 for s,m
in [
"at0_bc",0],[
"at1_bc",1]:
156 n=
int(recipe[pos+6:pos+8])
159 n=
int(recipe[pos+6:pos+7])
161 mlog_LRF.warning(
"could not decode %s",recipe[pos+6:])
164 if mux[m]
in typesMap.keys():
165 sTypes.append(typesMap[mux[m]])
171 return LArDTRunInfo(sTypes, sLengths, timing, adccalib)