3from AthenaConfiguration.ComponentFactory
import CompFactory
4from AthenaConfiguration.MainServicesConfig
import MainEvgenServicesCfg
8 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
11 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
12 result.merge(LArOnOffIdMappingCfg(flags))
14 from LArBadChannelTool.LArBadChannelConfig
import LArBadChannelCfg
15 result.merge(LArBadChannelCfg(flags))
17 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
18 result.merge(LArElecCalibDBCfg(flags,[
"HVScaleCorr"]))
20 result.addEventAlgo(CompFactory.LArHVScaleCorr2Ntuple(
"LArHVScaleCorr2Ntuple", AddFEBTempInfo =
False, OffId=
True))
23 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBSCCfg
24 result.merge(LArElecCalibDBSCCfg(flags,[
"HVScaleCorr"]))
26 from LArCabling.LArCablingConfig
import LArOnOffIdMappingSCCfg
27 result.merge(LArOnOffIdMappingSCCfg(flags))
29 result.merge(LArBadChannelCfg(flags, isSC=
True))
31 result.addEventAlgo(CompFactory.LArHVScaleCorr2Ntuple(
"LArSCHVScaleCorr2Ntuple", AddFEBTempInfo =
False, OffId=
True,
32 ContainerKey=
"LArHVScaleCorrSC",isSC =
True, BadChanKey =
"LArBadChannelSC"))
36 if os.path.exists(rootfile):
38 result.addService(CompFactory.NTupleSvc(Output = [
"FILE1 DATAFILE='"+rootfile+
"' OPT='NEW'" ]))
39 result.setAppProperty(
"HistogramPersistency",
"ROOT")
43if __name__==
"__main__":
45 from time
import strptime
46 from calendar
import timegm
50 print(
"%s <time> <outputfile> <globaltag>" % sys.argv[0])
55 ts=strptime(sys.argv[1]+
'/UTC',
'%Y-%m-%d:%H:%M:%S/%Z')
56 TimeStamp=int(timegm(ts))
57 TimeStamp_ns=TimeStamp*1000000000
58 except ValueError
as e:
59 print(
"ERROR in time specification, use e.g. 2007-05-25:14:01:00")
63 from LArCalibProcessing.TimeStampToRunLumi
import TimeStampToRunLumi
65 rlb=TimeStampToRunLumi(TimeStamp_ns)
68 print(
"WARNING: Failed to convert time",TimeStamp_ns,
"into a run/lumi number. Using 'infinite' run-number",rlb[0])
71 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
72 flags = initConfigFlags()
73 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
74 addLArCalibFlags(flags)
76 flags.Input.RunNumbers=[rlb[0]]
77 flags.Input.TimeStamps=[TimeStamp]
79 flags.IOVDb.DatabaseInstance=
"CONDBR2"
80 from AthenaConfiguration.TestDefaults
import defaultGeometryTags, defaultConditionsTags
81 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
82 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_DATA
84 rootfile=
"hvcorr_read.root"
89 flags.IOVDb.GlobalTag=sys.argv[3]
92 cfg=MainEvgenServicesCfg(flags)
96 print(
"Start running...")
void print(char *figname, TCanvas *c1)
LArHVScaleCorr2NtupleCfg(flags, rootfile="hvcorr_read.root", addSC=False)