28def overlayInputMetadataCheck(flags, simDict, tagInfoDict):
29 """Check the metadata for signal HITS or presampled pileup RDO file"""
30 logger.info("Checking Overlay configuration against Signal or presampled pileup RDO metadata...")
31
32 simKeys = simDict.keys()
33 tagInfoKeys = tagInfoDict.keys()
34
35
36 if "PhysicsList" in simKeys:
37 if re.match(simDict["PhysicsList"], flags.Sim.PhysicsList):
38 logger.debug("Overlay configuration matches Signal Simulation metadata. [Sim.PhysicsList = %s]", flags.Sim.PhysicsList)
39 else:
40 flags.Sim.PhysicsList = simDict["PhysicsList"]
41 logger.warning("Overlay Sim.PhysicsList does not match the PhysicsList used in the Signal Simulation step! Assume the value from the Signal Simulation step is correct!")
42 logger.warning("Set Sim.PhysicsList = %s", flags.Sim.PhysicsList)
43 else:
44 logger.error("'PhysicsList' key not found in Signal Simulation metadata!")
45 raise AssertionError("Signal Simulation metadata key not found")
46
47
48 if "SimLayout" in simKeys:
49 if validateGeometryTag(logger, simDict["SimLayout"], flags.GeoModel.AtlasVersion):
50 logger.debug("Overlay configuration matches Signal Simulation metadata. [Geomodel.AtlasVersion = %s]",
51 flags.GeoModel.AtlasVersion)
52 else:
53 flags.GeoModel.AtlasVersion = simDict["SimLayout"]
54 logger.warning("Overlay Geomodel.AtlasVersion does not match the value used in the Signal Simulation step! Assume the value from the Signal Simulation step is correct!")
55 logger.warning("Set Geomodel.AtlasVersion = %s", flags.GeoModel.AtlasVersion)
56 else:
57 logger.error("'SimLayout' key not found in Signal Simulation metadata!")
58 raise AssertionError("Signal Simulation metadata key not found")
59
60
61 if "IOVDbGlobalTag" in tagInfoKeys:
62 if not re.match(tagInfoDict["IOVDbGlobalTag"], flags.IOVDb.GlobalTag):
63 logger.debug("Overlay configuration: [IOVDb.GlobalTag = %s], Signal Simulation metadata: [IOVDb.GlobalTag = %s]",
64 flags.IOVDb.GlobalTag, tagInfoDict['IOVDbGlobalTag'])
65 else:
66 logger.error("'IOVDbGlobalTag' key not found in Signal Simulation metadata!")
67 raise AssertionError("Signal Simulation metadata key not found")
68
69
70 if "TRTRangeCut" in simKeys:
71 if not re.match(simDict["TRTRangeCut"], str(flags.Sim.TRTRangeCut)):
72 flags.Sim.TRTRangeCut = simDict["TRTRangeCut"]
73 logger.warning("Overlay Sim.TRTRangeCut does not match the value used in the Signal Simulation step! Assume the value from the Signal Simulation step is correct!")
74 logger.warning("Set Sim.TRTRangeCut = %s", flags.Sim.TRTRangeCut)
75 else:
76 logger.warning("'TRTRangeCut' key not found in Signal Simulation metadata!")
77
78
79
80
81 logger.info("Completed checks of Overlay configuration against Signal Simulation metadata.")
82
83