191 def make_corrections (self,
203 log = logging.getLogger (
'CaloClusterCorrection')
212 v = getattr (flags.Calo.ClusterCorrection, self.version_override_flag_name)
220 geom = flags.GeoModel.AtlasVersion
221 datasource =
'geant4' if flags.Input.isMC
else 'data'
222 (version, tryhier) = self.geom_match (datasource, geom)
225 generation = self.get_generation(flags)
229 source = flags.Calo.ClusterCorrection.defaultSource
231 if not isinstance (source, list):
233 if CALOCORR_COOL
not in source:
236 if tryhier
and version[0] !=
'@':
239 cl = cl[0:4] +
'Ofl' + cl[4:]
240 version =
"@%s-%s%s" % (cl, generation, version)
245 if version[0] !=
'@' and len(source) > 0:
246 if CALOCORR_COOL
in source:
247 source.remove (CALOCORR_COOL)
249 (vcorrlist, version) = self.lookup_version (flags, version, corrclass)
255 log.info (
"%s corrections for %s (%s) using version %s" %
256 (self.name, key, suffix, version))
261 for cspec
in corrlist:
262 (func, this_version, this_order, extra_args) = \
263 split_version_spec (cspec)
267 if this_version ==
'' or extra_args == []:
268 for vcspec
in vcorrlist:
269 if vcspec[0] == func:
270 (vfunc, vversion, vorder, vextra_args) = \
271 split_version_spec (vcspec)
272 if this_version ==
'':
273 this_version = vversion
275 extra_args = vextra_args
280 elif version[0] ==
'@' and not corrlist:
281 this_version = version
283 if this_version ==
'@':
284 this_version = version
287 this_args = dict (extra_args)
290 this_cells_name = cells_name
293 corrname = func.__name__
296 for (k, v)
in kw.items():
297 if k == corrname +
'_suffix':
299 elif k == corrname +
'_key':
301 elif k == corrname +
'_cells_name':
303 elif k == corrname +
'_source':
305 elif k == corrname +
'_version':
307 elif k == corrname +
'_order':
309 elif k.startswith (corrname +
'_'):
310 this_args[k[len(corrname)+1:]] = v
319 generation = generation,
322 tools.append (out.popToolsAndMerge (ca))
324 out.setPrivateTools (tools)