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 __init__( self, minEnergy = None ): self.RingSetContainerName = 'EgammaRingSets' self.CaloRingsContainerName = 'EgammaCaloRings' self.EtaWidth = [0.025, 0.003125, 0.025, 0.05, 0.1, 0.1, 0.2] self.PhiWidth = [0.098174770424681, 0.098174770424681, 0.024543692606170, 0.024543692606170, 0.098174770424681, 0.098174770424681, 0.098174770424681] self.NRings = [8, 64, 8, 8, 4, 4, 4] self.CellMaxDEtaDist = .2 self.CellMaxDPhiDist = .2 from ROOT import CaloCell_ID # Changes in the layers may break the algorithm because it may not be able to # recognize whether a layer is correspondent to EM1, EM2 and so on. If it is # needed to update this, please enter in touch with (Werner S. Freund) # <*****@*****.**> # TODO Remove TileGap self.Layers = [CaloCell_ID.PreSamplerB, CaloCell_ID.PreSamplerE, CaloCell_ID.EMB1, CaloCell_ID.EME1, CaloCell_ID.EMB2, CaloCell_ID.EME2, CaloCell_ID.EMB3, CaloCell_ID.EME3, CaloCell_ID.HEC0, CaloCell_ID.TileBar0, CaloCell_ID.TileGap3, CaloCell_ID.TileExt0, CaloCell_ID.HEC1, CaloCell_ID.HEC2, CaloCell_ID.TileBar1, CaloCell_ID.TileGap1, CaloCell_ID.TileExt1, CaloCell_ID.HEC3, CaloCell_ID.TileBar2, CaloCell_ID.TileGap2, CaloCell_ID.TileExt2] # FIXME recheck amount of rings self.RingSetNLayers = [2, 2, 2, 2, 4, 5, 4] self.useShowerShapeBarycenter = False self.CellsContainerName = egammaKeys.caloCellKey()
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=jobproperties.egammaRecFlags.clusterCorrectionVersion(), cells_name=egammaKeys.caloCellKey()) setattr(swTool, x, _process_tools(swTool, y)) #Super cluster position only corrections if jobproperties.egammaRecFlags.doSuperclusters(): 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 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))
# 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()))
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration __doc__ = """ToolFactory to instantiate all EMShowerBuilder with default configuration""" __author__ = "Bruno Lenzi" from egammaTools import egammaToolsConf from egammaRec.Factories import ToolFactory from egammaRec import egammaKeys from egammaCaloTools.egammaCaloToolsFactories import (egammaShowerShape, egammaIso) from CaloIdentifier import SUBCALO EMShowerBuilder = ToolFactory( egammaToolsConf.EMShowerBuilder, CellsName=egammaKeys.caloCellKey(), CaloNums=[SUBCALO.LAREM, SUBCALO.LARHEC, SUBCALO.TILE], ShowerShapeTool=egammaShowerShape, HadronicLeakageTool=egammaIso, Print=False)
from egammaRec.Factories import ToolFactory, getPropertyValue from egammaRec import egammaKeys from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__GainDecorator, DerivationFramework__ClusterEnergyPerLayerDecorator from CaloClusterCorrection.CaloClusterCorrectionConf import CaloFillRectangularCluster as CFRC from GaudiKernel.Constants import DEBUG GainDecorator = ToolFactory(DerivationFramework__GainDecorator, SGKey_electrons=egammaKeys.outputElectronKey(), SGKey_photons=egammaKeys.outputPhotonKey(), OutputLevel=DEBUG) # Define defaults for CaloFillRectangularCluster and ClusterEnergyPerLayerDecorator # will be overridden later depending on the number of cells neta X nphi CaloFillRectangularCluster = ToolFactory(CFRC, cells_name=egammaKeys.caloCellKey(), fill_cluster=True) ClusterEnergyPerLayerDecorator = ToolFactory( DerivationFramework__ClusterEnergyPerLayerDecorator, CaloFillRectangularTool=CaloFillRectangularCluster, SGKey_electrons=egammaKeys.outputElectronKey(), SGKey_photons=egammaKeys.outputPhotonKey(), SGKey_caloCells=egammaKeys.caloCellKey()) def getGainLayerNames(obj): """getGainLayerNames( obj ) -> return a list of names of the decorations added to the egamma object, given the GainDecorator object""" return [getPropertyValue(obj, "decoration_pattern").format(info=info, layer=layer, gain=gain) \ for info in ["E", "nCells"] \