3 from AthenaConfiguration.ComponentAccumulator 
import ComponentAccumulator
 
    4 from AthenaConfiguration.ComponentFactory 
import CompFactory
 
    8     kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
 
    9     kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
 
   10     acc.setPrivateTools(CompFactory.DerivationFramework.CaloCellDecorator(**kwargs))
 
   11     from LArCabling.LArCablingConfig 
import LArOnOffIdMappingCfg
 
   19     kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
 
   20     kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
 
   21     acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(**kwargs))
 
   22     from LArCabling.LArCablingConfig 
import LArOnOffIdMappingCfg
 
   30     kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
 
   31     kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
 
   32     kwargs.setdefault(
"name", 
"GainDecor")
 
   33     acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs))
 
   40     from LArGeoAlgsNV.LArGMConfig 
import LArGMCfg
 
   42     from TileGeoModel.TileGMConfig 
import TileGMCfg
 
   46         CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
 
   53     kwargs.setdefault(
"cells_name", flags.Egamma.Keys.Input.CaloCells)
 
   54     kwargs.setdefault(
"fill_cluster", 
True)
 
   55     acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs))
 
   61     kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
 
   62     kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
 
   63     kwargs.setdefault(
"SGKey_caloCells", flags.Egamma.Keys.Input.CaloCells)
 
   64     kwargs.setdefault(
"neta", 5)
 
   65     kwargs.setdefault(
"nphi", 5)
 
   67     toolArgs.update({
"eta_size": kwargs[
"neta"]})
 
   68     toolArgs.update({
"phi_size": kwargs[
"nphi"]})
 
   70         "CaloFillRectangularClusterTool",
 
   74         CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
 
   86     kwargs.setdefault(
"AugmentationTools", augmentationTools)
 
   88     acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
 
   99     kwargs.setdefault(
"AugmentationTools", augmentationTools)
 
  101     acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
 
  108     augmentationTools = [
 
  113     cluster_sizes = (3, 7), (5, 5), (7, 11)
 
  114     for neta, nphi 
in cluster_sizes:
 
  115         cename = 
"ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
 
  116         ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge(
 
  119         augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
 
  121     kwargs.setdefault(
"AugmentationTools", augmentationTools)
 
  123     acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
 
  129     CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
 
  130     acc.addPublicTool(CaloClusterThinning(**kwargs), primary=
True)
 
  135     JetCaloClusterThinning = CompFactory.DerivationFramework.JetCaloClusterThinning
 
  136     acc.addPublicTool(JetCaloClusterThinning(**kwargs), primary=
True)
 
  145     """getGainLayerNames( tool ) -> return a list of names of the decorations added to the 
  146     egamma tool, given the GainDecorator tool""" 
  148         tool.decoration_pattern.format(info=info, layer=layer, gain=gain)
 
  149         for info 
in [
"E", 
"nCells"]
 
  150         for layer 
in tool.layers
 
  151         for gain 
in tool.gain_names.values()
 
  160     info=["E", "nCells"],
 
  162     """getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) -> 
  163     Return a list with the 'ExtraContent' to be added to the decorations to save the gain 
  164     information per layer""" 
  166     if collections 
is None:
 
  167         collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
 
  169     GainDecoratorTool = 
None 
  170     for tool 
in acc.getEventAlgo(kernel).AugmentationTools:
 
  171         if tool.getType() == 
"DerivationFramework::GainDecorator":
 
  172             GainDecoratorTool = tool
 
  174     if GainDecoratorTool:
 
  176             "{part}.{info}".
format(part=part, info=info)
 
  177             for part 
in collections
 
  185     """getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the 
  186     decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations 
  187     object (e.g. Photons.E7x11_Lr0, ...)""" 
  188     properties = 
"SGKey_photons", 
"SGKey_electrons" 
  189     ClusterEnergyPerLayerDecorators = []
 
  190     for tool 
in acc.getEventAlgo(kernel).AugmentationTools:
 
  191         if tool.getType() == 
"DerivationFramework::ClusterEnergyPerLayerDecorator":
 
  192             ClusterEnergyPerLayerDecorators.append(tool)
 
  195     for tool 
in ClusterEnergyPerLayerDecorators:
 
  196         collections = 
filter(bool, (getattr(tool, x) 
for x 
in properties))
 
  197         for part 
in collections:
 
  198             for layer 
in tool.layers:
 
  201                         "{part}.E{neta}x{nphi}_Lr{layer}".
format(