17from AthenaConfiguration.TestDefaults
import defaultGeometryTags
18fhistory = 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="])
47detdescrtag=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
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
100 if geo
and not detdescrset:
101 prompt=
"Enter DetectorDescripton tag [%s]:" % detdescrtag
103 if detdescrtagIn !=
"":
104 detdescrtag=detdescrtagIn
107 print(
"Failed to get run number and/or conditions tag")
112sys.argv = sys.argv[:1] + [
'-b']
114from AthenaConfiguration.AllConfigFlags
import initConfigFlags
115flags=initConfigFlags()
116flags.Input.Files = []
117flags.Input.TimeStamps = [1000]
118flags.Input.isMC=
False
119flags.Input.RunNumbers=[run]
120flags.IOVDb.DatabaseInstance=
"CONDBR2" if run>222222
else "COMP200"
121flags.IOVDb.GlobalTag=tag
122flags.GeoModel.AtlasVersion = detdescrtag
123flags.LAr.doAlign=
False
125flags.Exec.OutputLevel=FATAL
128from RootUtils
import PyROOTFixes
129from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
130cfg=MainServicesCfg(flags)
132from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
133cfg.merge (McEventSelectorCfg (flags))
136 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
137 cfg.merge(LArGMCfg(flags))
139 from DetDescrCnvSvc.DetDescrCnvSvcConfig
import DetDescrCnvSvcCfg
140 cfg.merge(DetDescrCnvSvcCfg(flags))
142from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
143cfg.merge(LArOnOffIdMappingCfg(flags))
145from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
146requiredConditions=[
"Pedestal",
"Ramp",
"DAC2uA",
"uA2MeV",
"MphysOverMcal",
"HVScaleCorr"]
147cfg.merge(LArElecCalibDBCfg(flags,requiredConditions))
149from LArBadChannelTool.LArBadChannelConfig
import LArBadChannelCfg
150cfg.merge(LArBadChannelCfg(flags))
152from LArConditionsCommon.LArCellConditionsAlg
import LArCellConditionsAlg
153theLArCellConditionsAlg=LArCellConditionsAlg(
"LArCellConditions",
154 printConditions=printCond,
156cfg.addEventAlgo(theLArCellConditionsAlg)
158if os.path.exists( fhistory ):
159 readline.read_history_file( fhistory )
160readline.set_history_length( 128 )
163readline.write_history_file(fhistory)
void print(char *figname, TCanvas *c1)