318 def CaloTopoClusterCfg(flags, cellsname="AllCalo", clustersname=None, clustersnapname="CaloTopoClusters"):
320 Configures topo clustering
322 If output writing is enabled (ESD,AOD) the topo clusters are added to them
325 doLCCalib = flags.Calo.TopoCluster.doTopoClusterLocalCalib
327 if clustersname
is None:
328 clustersname =
"CaloCalTopoClusters" if doLCCalib
else "CaloTopoClusters"
331 if clustersname==
"CaloTopoClusters" and doLCCalib
is True:
332 raise RuntimeError(
"Inconsistent arguments: Name must not be 'CaloTopoClusters' if doLCCalib is True")
336 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
337 from TileGeoModel.TileGMConfig
import TileGMCfg
338 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
344 CaloClusterMaker, CaloClusterSnapshot=CompFactory.getComps(
"CaloClusterMaker",
"CaloClusterSnapshot",)
361 CaloTopoCluster.ClustersOutputName=clustersname
363 CaloTopoCluster.ClusterMakerTools = [TopoMaker, TopoSplitter]
365 from CaloBadChannelTool.CaloBadChanToolConfig
import CaloBadChanToolCfg
367 CaloClusterBadChannelList=CompFactory.CaloClusterBadChannelList
369 CaloTopoCluster.ClusterCorrectionTools += [BadChannelListCorr]
372 CaloTopoCluster.ClusterCorrectionTools += [momentsMaker]
374 if flags.Calo.TopoCluster.doCalibHitMoments:
376 CaloTopoCluster.ClusterCorrectionTools += [calibHitsMomentsMaker]
379 theCaloClusterSnapshot=
CaloClusterSnapshot(OutputName=clustersnapname,SetCrossLinks=
True,FinalClusterContainerName=clustersname)
380 CaloTopoCluster.ClusterCorrectionTools += [theCaloClusterSnapshot]
384 from CaloRec.CaloTopoClusterConfig
import caloTopoCoolFolderCfg
388 result.addEventAlgo(CaloTopoCluster,primary=
True)
390 if CaloTopoCluster.ClustersOutputName
in flags.Calo.TopoCluster.skipWriteList:
396 AODMoments=[
"SECOND_R"
415 if flags.Calo.TopoCluster.writeExtendedClusterMoments:
416 AODMoments += [
"LATERAL"
422 if flags.Reco.EnableHI:
423 AODMoments += [
"CELL_SIG_SAMPLING"]
425 if flags.Calo.TopoCluster.writeCalibHitClusterMoments:
426 AODMoments += [
"ENG_CALIB_TOT"
432 ,
"ENG_CALIB_DEAD_TOT"
433 ,
"ENG_CALIB_DEAD_EMB0"
434 ,
"ENG_CALIB_DEAD_TILE0"
435 ,
"ENG_CALIB_DEAD_TILEG3"
436 ,
"ENG_CALIB_DEAD_EME0"
437 ,
"ENG_CALIB_DEAD_HEC0"
438 ,
"ENG_CALIB_DEAD_FCAL"
439 ,
"ENG_CALIB_DEAD_LEAKAGE"
440 ,
"ENG_CALIB_DEAD_UNCLASS"
442 ,
"ENG_CALIB_FRAC_HAD"
443 ,
"ENG_CALIB_FRAC_REST"]
446 from OutputStreamAthenaPool.OutputStreamConfig
import addToAOD, addToESD
447 toESD = [f
"xAOD::CaloClusterContainer#{CaloTopoCluster.ClustersOutputName}",
448 f
"xAOD::CaloClusterAuxContainer#{CaloTopoCluster.ClustersOutputName}Aux.-sigmaWidth",
449 f
"CaloClusterCellLinkContainer#{CaloTopoCluster.ClustersOutputName}_links"]
450 toAOD = [f
"xAOD::CaloClusterContainer#{CaloTopoCluster.ClustersOutputName}",
451 f
"CaloClusterCellLinkContainer#{CaloTopoCluster.ClustersOutputName}_links"]
453 AODMoments.append(
"CellLink")
454 if flags.Calo.TopoCluster.addCalibrationHitDecoration:
455 AODMoments.append(flags.Calo.TopoCluster.CalibrationHitDecorationName)
457 if flags.Calo.TopoCluster.addCPData:
458 AODMoments += [
"ClusterWidthEta",
"ClusterWidthPhi"]
460 auxItems = f
"xAOD::CaloClusterAuxContainer#{CaloTopoCluster.ClustersOutputName}Aux."
461 auxItems+=
".".
join(AODMoments)
463 toAOD.append(auxItems)
465 result.merge(
addToESD(flags, toESD))
466 result.merge(
addToAOD(flags, toAOD))