4 from AthenaConfiguration.ComponentFactory
import CompFactory
8 from LArCalibProcessing.LArCalibBaseConfig
import LArCalibBaseCfg
10 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
12 if flags.LArCalib.isSC:
13 from LArCabling.LArCablingConfig
import LArOnOffIdMappingSCCfg
16 theLArCompleteToFlat = CompFactory.LArCompleteToFlat(FakeEMBPSLowGain =
not flags.LArCalib.isSC, isSC=flags.LArCalib.isSC)
17 theLArCompleteToFlat.OutputLevel = 2
22 for (fldr,ftag,key,classtype)
in inputFolders:
23 if "Pedestal" in fldr:
24 outTypes.append(
"Pedestal")
25 theLArCompleteToFlat.PedestalInput=key
26 overrides.extend([
"Pedestal",
"PedestalRMS"])
28 outTypes.append(
"Ramp")
29 theLArCompleteToFlat.RampInput=key
30 overrides.extend([
"RampVec"])
32 if 'CaliWave' in fldr:
33 outTypes.append(
"OFCCali")
34 theLArCompleteToFlat.OFCCaliInput=key
36 outTypes.append(
"OFC")
37 theLArCompleteToFlat.OFCInput=key
38 overrides.extend([
"OFCa",
"OFCb",
"TimeOffset"])
39 elif "MphysOverMcal" in fldr:
40 outTypes.append(
"MphysOverMcal")
41 theLArCompleteToFlat.MphysOverMcalInput=key
42 overrides.extend([
"MphysOverMcal"])
44 outTypes.append(
"Shape")
45 theLArCompleteToFlat.ShapeInput=key
46 overrides.extend([
"Shape",
"ShapeDer"])
48 from IOVDbSvc.IOVDbSvcConfig
import addFolders
50 result.merge(
addFolders(flags,fldr,detDb=flags.LArCalib.Input.Database,tag=ftag))
56 result.merge(
addFolders(flags,fldr,detDb=flags.LArCalib.Input.Database))
60 result.addEventAlgo(theLArCompleteToFlat)
62 flatName=
"ElecCalibFlat"
63 if flags.LArCalib.isSC:
65 if "outObjects" not in dir():
66 outObjects=[
"CondAttrListCollection#/LAR/"+flatName+
"/"+ot
for ot
in outTypes]
68 print(
"outObjects are: ",outObjects)
70 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
72 outputFile=
"dummy.root",
73 ObjectList=outObjects,
75 Run1=flags.LArCalib.IOVStart,
76 Run2=flags.LArCalib.IOVEnd
79 print(
"OVERRIDES ARE:",overrides)
81 for i
in range(len(overrides)):
82 types.append(
"Blob16M")
83 result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders =
True, SVFolder=
True,OverrideNames = overrides, OverrideTypes = types))
84 result.getService(
"IOVDbSvc").DBInstance=
""
87 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
89 RunNumber = flags.LArCalib.Input.RunNumbers[0],
93 TimeStampInterval = 1))
98 if __name__==
"__main__":
103 parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
104 parser.add_argument(
'-r',
'--run', dest=
'run', default=
str(0x7FFFFFFF), help=
'Run number to query input DB', type=str)
105 parser.add_argument(
'-i',
'--insqlite', dest=
'insql', default=
"freshConstants_AP.db", help=
'Input sqlite file containing the (merged) output of the AP.', type=str)
106 parser.add_argument(
'-f',
'--infolders', dest=
'infold', default=
"ConvertToInline.py", help=
'python file with inputFolders definition', type=str)
107 parser.add_argument(
'-o',
'--outsqlite', dest=
'outsql', default=
"freshConstants_merged.db", help=
'Output sqlite file', type=str)
108 parser.add_argument(
'--iovstart',dest=
"iovstart", default=0, help=
"IOV start (run-number)", type=int)
109 parser.add_argument(
'--isSC', dest=
'supercells', default=
False, help=
'is SC data ?', action=
"store_true")
110 parser.add_argument(
'--poolcat', dest=
'poolcat', default=
"freshConstants.xml", help=
'Catalog of POOL files', type=str)
111 args = parser.parse_args()
112 if help
in args
and args.help
is not None and args.help:
120 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
123 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
124 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
129 flags.LArCalib.Input.Database = args.insql
131 flags.IOVDb.DBConnection=
"sqlite://;schema="+args.outsql +
";dbname=CONDBR2"
134 flags.IOVDb.GlobalTag =
"LARCALIB-RUN2-00"
136 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
137 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
140 flags.LArCalib.Input.Files = [ ]
141 flags.LArCalib.IOVStart = args.iovstart
143 flags.LArCalib.Input.RunNumbers=[
int(args.run),]
144 flags.Input.RunNumbers=flags.LArCalib.Input.RunNumbers
146 flags.Debug.DumpDetStore=
True
147 flags.Debug.DumpCondStore=
True
148 flags.Debug.DumpEvtStore=
True
151 flags.Exec.OutputLevel=DEBUG
157 from pathlib
import Path
158 to_import = args.infold
159 if "/" not in args.infold:
163 path=Path(args.infold)
164 to_import = path.name
165 sys.path.append(
str(path.parent))
166 module = importlib.import_module(to_import)
167 except Exception
as e:
171 print(
"Input Folders: ",module.inputFolders)
175 cfg.getService(
"PoolSvc").WriteCatalog=(
"xmlcatalog_file:%s"%args.poolcat)
176 cfg.getService(
"PoolSvc").ReadCatalog+=[
"xmlcatalog_file:PoolFileCatalog.xml",]
177 cfg.getService(
"PoolSvc").SortReplicas =
False
179 cfg.getService(
"MessageSvc").debugLimit=9999999