def configureSuperClusterCorrections(swTool): "Add attributes ClusterCorrectionToolsXX to egammaSwTool object for corrections for superclusters." from CaloClusterCorrection.CaloSwCorrections import ( make_CaloSwCorrections, rfac, etaoff_b1, etaoff_e1, etaoff_b2, etaoff_e2, phioff_b2, phioff_e2, update, time, listBadChannel) from CaloRec.CaloRecMakers import _process_tools for attrName, clName in _clusterTypes.items(): n = 'ClusterCorrectionToolsSuperCluster' + attrName if not hasattr(swTool, n) or getattr(swTool, n): continue setattr(swTool, n, _process_tools( swTool, make_CaloSwCorrections( clName, suffix='EGSuperCluster', version=jobproperties.egammaRecFlags.clusterCorrectionVersion(), corrlist=[ [rfac, 'v5'], [etaoff_b1, 'v5'], [etaoff_e1, 'v5'], [etaoff_b2, 'v5'], [etaoff_e2, 'v5'], [phioff_b2, 'v5data'], [phioff_e2, 'v5data'], [update], [time], [listBadChannel]], cells_name=egammaKeys.caloCellKey())))
def _configureClusterCorrections(swTool, flags): "Add attributes ClusterCorrectionToolsXX to egammaSwTool object" from CaloClusterCorrection.CaloSwCorrections import make_CaloSwCorrections, rfac, etaoff_b1, etaoff_e1, \ etaoff_b2, etaoff_e2, phioff_b2, phioff_e2, update, time, listBadChannel from CaloRec.CaloRecMakers import _process_tools clusterTypes = dict(Ele35='ele35', Ele55='ele55', Ele37='ele37', Gam35='gam35_unconv', Gam55='gam55_unconv', Gam37='gam37_unconv', Econv35='gam35_conv', Econv55='gam55_conv', Econv37='gam37_conv') for attrName, clName in six.iteritems(clusterTypes): x = 'ClusterCorrectionTools' + attrName if not hasattr(swTool, x) or getattr(swTool, x): continue y = make_CaloSwCorrections( clName, suffix='EG', version=flags.Egamma.Calib.ClusterCorrectionVersion, cells_name=flags.Egamma.Keys.Input.CaloCells) setattr(swTool, x, _process_tools(swTool, y)) # Super cluster position only corrections if flags.Egamma.doSuperclusters: for attrName, clName in six.iteritems(clusterTypes): n = 'ClusterCorrectionToolsSuperCluster' + attrName if not hasattr(swTool, n) or getattr(swTool, n): continue setattr( swTool, n, _process_tools( swTool, make_CaloSwCorrections( clName, suffix='EGSuperCluster', corrlist=[[rfac, 'v5'], [etaoff_b1, 'v5'], [etaoff_e1, 'v5'], [etaoff_b2, 'v5'], [etaoff_e2, 'v5'], [phioff_b2, 'v5data'], [phioff_e2, 'v5data'], [update], [time], [listBadChannel]], cells_name=flags.Egamma.Keys.Input.CaloCells)))
def makeCorrectionTools (self): corrargs = self._corrargs.copy() if not self._corrargs.has_key ('cells_name'): cells = self.getInputGetter(jp.CaloRecFlags.clusterCellGetterName()) corrargs['cells_name'] = cells.outputKey() return make_CaloSwCorrections (key = 'gam35', suffix = 'topo35', version = 'pi0_v2_noc', **corrargs)
def configureClusterCorrections(swTool): '''Add attributes ClusterCorrectionToolsXX to egammaSwTool object''' from CaloClusterCorrection.CaloSwCorrections import make_CaloSwCorrections, rfac, etaoff_b1, etaoff_e1, \ etaoff_b2,etaoff_e2,phioff_b2,phioff_e2,update,time,listBadChannel from CaloRec.CaloRecMakers import _process_tools clusterTypes = dict(Ele35='ele35', Ele55='ele55', Ele37='ele37', Gam35='gam35_unconv', Gam55='gam55_unconv', Gam37='gam37_unconv', Econv35='gam35_conv', Econv55='gam55_conv', Econv37='gam37_conv') for attrName, clName in clusterTypes.iteritems(): x = 'ClusterCorrectionTools' + attrName if not hasattr(swTool, x) or getattr(swTool, x): continue y = make_CaloSwCorrections( clName, suffix='EG', version=EgammaSliceFlags.clusterCorrectionVersion(), cells_name="") #(egammaKeys.caloCellKey() ) setattr(swTool, x, _process_tools(swTool, y)) #Super cluster position only corrections for attrName, clName in clusterTypes.iteritems(): n = 'ClusterCorrectionToolsSuperCluster' + attrName if not hasattr(swTool, n) or getattr(swTool, n): continue setattr(swTool, n, _process_tools( swTool, make_CaloSwCorrections( clName, suffix='EGSuperCluster', corrlist=[[rfac, 'v5'], [etaoff_b1, 'v5'], [etaoff_e1, 'v5'], [etaoff_b2, 'v5'], [etaoff_e2, 'v5'], [phioff_b2, 'v5data'], [phioff_e2, 'v5data'], [update], [time], [listBadChannel]], cells_name=""))) #(((egammaKeys.caloCellKey() )))
def makeCorrectionTools(self): corrargs = self._corrargs.copy() if not self._corrargs.has_key('cells_name'): cells = resolveSGKey('CaloCellContainer', 'AODCellContainer,AllCalo') corrargs['cells_name'] = cells return make_CaloSwCorrections(self._clusterKey, suffix=self._suffix, version=self._corrversion, **corrargs)
def makeCorrectionTools(self): corrargs = self._corrargs.copy() if 'cells_name' not in self._corrargs: cells = self.getInputGetter( jp.CaloRecFlags.clusterCellGetterName()) corrargs['cells_name'] = cells.outputKey() return make_CaloSwCorrections(self._clusterKey, suffix=self._suffix, version=self._corrversion, **corrargs)
def configureClusterCorrections(slwAlg): '''Add attributes ClusterCorrectionToolsXX to egammaSwTool object''' if not hasattr(slwAlg, "ClusterCorrectionTools"): return from CaloClusterCorrection.CaloSwCorrections import make_CaloSwCorrections clusterTypes = ("ele37", "ele55") for cl in clusterTypes: clName = "CaloRunClusterCorrections" + cl if hasattr(slwAlg, clName): continue for tool in make_CaloSwCorrections( cl, version=EgammaSliceFlags.clusterCorrectionVersion()): slwAlg += tool slwAlg.ClusterCorrectionTools += [tool.getFullName()]
def configureFixedSizeClusterCorrections(swTool): "Add attributes ClusterCorrectionToolsXX to egammaSwTool object for fixed-size cluster corrections." from CaloClusterCorrection.CaloSwCorrections import ( make_CaloSwCorrections, rfac, etaoff_b1, etaoff_e1, etaoff_b2, etaoff_e2, phioff_b2, phioff_e2, update, time, listBadChannel) from CaloRec.CaloRecMakers import _process_tools for attrName, clName in _clusterTypes.items(): x = 'ClusterCorrectionTools' + attrName if not hasattr(swTool, x) or getattr(swTool, x): continue y = make_CaloSwCorrections( clName, suffix='EG', version=jobproperties.egammaRecFlags.clusterCorrectionVersion(), cells_name=egammaKeys.caloCellKey()) setattr(swTool, x, _process_tools(swTool, y))
def egammaLargeClusterMakerAlgCfg(flags, name="egammaLargeClusterMaker", **kwargs): acc = ComponentAccumulator kwargs.setdefault("SaveUncalibratedSignalState", False) kwargs.setdefault("ClustersOutputName", flags.Egamma.Keys.Output.EgammaLargeClusters) if "ClusterMakerTools" not in kwargs: toolAcc = egammaLargeClusterMakerCfg(flags) kwargs["ClusterMakerTools"] = [toolAcc.popPrivateTools()] acc.merge(toolAcc) kwargs.setdefault( "ClusterCorrectionTools", make_CaloSwCorrections("ele7_11", suffix="Nocorr", version="none", cells_name=flags.Egamma.Keys.Input.CaloCells)) acc.addEventAlgo(CaloClusterMaker(name, **kwargs)) return acc
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration __doc__ = """ToolFactory to instantiate egammaLargeClusterMaker with default configuration""" __author__ = "Jovan Mitrevski" from egammaTools.egammaToolsFactories import egammaLargeClusterMakerTool from CaloRec import CaloRecConf from egammaRec.Factories import AlgFactory, FcnWrapper from egammaRec import egammaKeys from CaloClusterCorrection.CaloSwCorrections import make_CaloSwCorrections def clusMakerTools(): return [egammaLargeClusterMakerTool()] egammaLargeClusterMakerAlg = AlgFactory( CaloRecConf.CaloClusterMaker, name="egammaLargeClusterMaker", SaveUncalibratedSignalState=False, ClustersOutputName=egammaKeys.EgammaLargeClustersKey(), ClusterMakerTools=FcnWrapper(clusMakerTools), ClusterCorrectionTools=make_CaloSwCorrections("ele7_11", suffix="Nocorr", version="none", cells_name=egammaKeys.caloCellKey()))