17 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
18 fhistory = os.path.expanduser(
"~/.LArCellConditionsHist")
22 print(sys.argv[0]+
": Convert and expand LAr Identifiers, print some database content")
24 print(
"-c Print also (some) electronic calibration constants")
25 print(
"-s Use SingleVersion folders (default)")
26 print(
"-m Use MultiVersion folders (the opposite of -s)")
27 print(
"-g Include geometrical position (true eta/phi)")
28 print(
"-r <run> Specify a run number")
29 print(
"-t <tag> Specify global tag")
30 print(
"--detdescr <DetDescrVersion>")
31 print(
"--sqlite <sqlitefile>")
32 print(
"-h Print this help text and exit")
35 opts,args=getopt.getopt(sys.argv[1:],
"csmgdhr:t:",[
"help",
"detdescr=",
"sqlite="])
36 except Exception
as e:
47 detdescrtag=defaultGeometryTags.RUN2
52 if (o==
"-c"): printCond=
True
54 if (o==
"-r" and a.isdigit()): run=
int(a)
56 if (o==
"-m"): sv=
False
57 if (o==
"-g"): geo=
True
58 if (o==
"-h" or o==
"--help"):
64 if (o==
"--sqlite"): sqlite=a
71 prompt=
"Enter run number [%i]:" % defRun
72 runIn=input(prompt).strip()
80 print(
"Expect numerical parameter for run, got",runIn)
88 defTag=
"CONDBR2-BLKPA-2014-00"
90 defTag=
"COMCOND-BLKPA-RUN1-06"
92 prompt=
"Enter conditions tag [%s]:" % defTag
93 tagIn=input(prompt).strip()
100 if geo
and not detdescrset:
101 prompt=
"Enter DetectorDescripton tag [%s]:" % detdescrtag
102 detdescrtagIn=input(prompt).strip()
103 if detdescrtagIn !=
"":
104 detdescrtag=detdescrtagIn
107 print(
"Failed to get run number and/or conditions tag")
112 sys.argv = sys.argv[:1] + [
'-b']
114 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
116 flags.Input.Files = []
117 flags.Input.TimeStamps = [1000]
118 flags.Input.isMC=
False
119 flags.Input.RunNumbers=[run]
120 flags.IOVDb.DatabaseInstance=
"CONDBR2" if run>222222
else "COMP200"
121 flags.IOVDb.GlobalTag=tag
122 flags.GeoModel.AtlasVersion = detdescrtag
123 flags.LAr.doAlign=
False
125 flags.Exec.OutputLevel=FATAL
128 from RootUtils
import PyROOTFixes
129 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
132 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
133 cfg.merge (McEventSelectorCfg (flags))
136 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
139 from DetDescrCnvSvc.DetDescrCnvSvcConfig
import DetDescrCnvSvcCfg
142 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
145 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
146 requiredConditions=[
"Pedestal",
"Ramp",
"DAC2uA",
"uA2MeV",
"MphysOverMcal",
"HVScaleCorr"]
149 from LArBadChannelTool.LArBadChannelConfig
import LArBadChannelCfg
152 from LArConditionsCommon.LArCellConditionsAlg
import LArCellConditionsAlg
153 theLArCellConditionsAlg=LArCellConditionsAlg(
"LArCellConditions",
154 printConditions=printCond,
156 cfg.addEventAlgo(theLArCellConditionsAlg)
158 if os.path.exists( fhistory ):
159 readline.read_history_file( fhistory )
160 readline.set_history_length( 128 )
163 readline.write_history_file(fhistory)