485 clustersname = None, clustersnapname="CaloTopoClusters", name="HybridClusterProcessor",
486 MonitorTool = None, MonitorCells = False, PlotterTool = None,
487 addAsPrimary = True, ReallyUseGPUTools = True):
489 doLCCalib = flags.CaloRecGPU.ActiveConfig.doTopoClusterLocalCalib
491 if clustersname
is None:
492 clustersname =
"CaloCalTopoClusters" if doLCCalib
else "CaloTopoClusters"
494 if clustersname ==
"CaloTopoClusters" and doLCCalib:
495 raise RuntimeError(
"Inconsistent arguments: clustersname must not be 'CaloTopoClusters' if doTopoClusterLocalCalib is True")
499 if not instantiateForTrigger:
501 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
502 from TileGeoModel.TileGMConfig
import TileGMCfg
503 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
512 HybridClusterProcessor = CompFactory.CaloGPUHybridClusterProcessor(name)
513 HybridClusterProcessor.ClustersOutputName = clustersname
515 HybridClusterProcessor.WriteTriggerSpecificInfo = instantiateForTrigger
517 HybridClusterProcessor.MeasureTimes = flags.CaloRecGPU.ActiveConfig.MeasureTimes
519 HybridClusterProcessor.TimeFileOutput =
"GlobalTimes.txt"
521 HybridClusterProcessor.DeferConstantDataPreparationToFirstEvent =
True
522 HybridClusterProcessor.DoPlots = PlotterTool
is not None
523 HybridClusterProcessor.PlotterTool = PlotterTool
524 HybridClusterProcessor.DoMonitoring = MonitorTool
is not None
525 HybridClusterProcessor.MonitoringTool = MonitorTool
526 HybridClusterProcessor.MonitorCells = MonitorCells
527 HybridClusterProcessor.CellsName = cellsname
529 HybridClusterProcessor.NumPreAllocatedDataHolders = flags.CaloRecGPU.ActiveConfig.NumPreAllocatedDataHolders
531 if ReallyUseGPUTools:
538 HybridClusterProcessor.BeforeGPUTools = []
540 HybridClusterProcessor.GPUTools = []
544 HybridClusterProcessor.GPUTools += [result.popToolsAndMerge(
ClusterInfoCalcToolCfg(flags,
"PostGPUGrowingClusterPropertiesCalculator",
True))]
552 HybridClusterProcessor.ConstantDataToGPUTool =
None
553 HybridClusterProcessor.EventDataToGPUTool =
None
554 HybridClusterProcessor.GPUToEventDataTool =
None
555 HybridClusterProcessor.SkipConversions =
True
557 HybridClusterProcessor.GPUTools = []
559 HybridClusterProcessor.BeforeGPUTools = []
567 HybridClusterProcessor.BeforeGPUTools += [ CompFactory.CaloClusterStoreRawProperties(
"RawPropertiesStorer") ]
571 HybridClusterProcessor.AfterGPUTools = []
573 if not instantiateForTrigger:
574 from CaloBadChannelTool.CaloBadChanToolConfig
import CaloBadChanToolCfg
576 HybridClusterProcessor.AfterGPUTools += [CompFactory.CaloClusterBadChannelList(badChannelTool = caloBadChanTool)]
578 if not instantiateForTrigger
and flags.CaloRecGPU.ActiveConfig.doCalibHitMoments:
581 HybridClusterProcessor.AfterGPUTools += [calibHitsMomentsMaker]
584 if not instantiateForTrigger:
585 HybridClusterProcessor.AfterGPUTools += [CompFactory.CaloClusterSnapshot(OutputName=clustersnapname,
587 FinalClusterContainerName=clustersname)]
589 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
590 from CaloRec.CaloTopoClusterConfig
import caloTopoCoolFolderCfg
596 HybridClusterProcessor.AfterGPUTools += calibTools
599 if not instantiateForTrigger:
600 from CaloRec.CaloTopoClusterConfig
import caloTopoCoolFolderCfg
603 if instantiateForTrigger:
604 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
607 result.addEventAlgo(HybridClusterProcessor, primary=addAsPrimary)
609 if instantiateForTrigger
or clustersname
in flags.CaloRecGPU.ActiveConfig.skipWriteList:
614 AODMoments=[
"SECOND_R"
633 if flags.CaloRecGPU.ActiveConfig.writeExtendedClusterMoments:
634 AODMoments += [
"LATERAL"
640 if flags.Reco.EnableHI:
641 AODMoments += [
"CELL_SIG_SAMPLING"]
643 if flags.CaloRecGPU.ActiveConfig.writeCalibHitClusterMoments:
644 AODMoments += [
"ENG_CALIB_TOT"
650 ,
"ENG_CALIB_DEAD_TOT"
651 ,
"ENG_CALIB_DEAD_EMB0"
652 ,
"ENG_CALIB_DEAD_TILE0"
653 ,
"ENG_CALIB_DEAD_TILEG3"
654 ,
"ENG_CALIB_DEAD_EME0"
655 ,
"ENG_CALIB_DEAD_HEC0"
656 ,
"ENG_CALIB_DEAD_FCAL"
657 ,
"ENG_CALIB_DEAD_LEAKAGE"
658 ,
"ENG_CALIB_DEAD_UNCLASS"
660 ,
"ENG_CALIB_FRAC_HAD"
661 ,
"ENG_CALIB_FRAC_REST"]
664 from OutputStreamAthenaPool.OutputStreamConfig
import addToAOD, addToESD
665 toESD = [f
"xAOD::CaloClusterContainer#{clustersname}",
666 f
"xAOD::CaloClusterAuxContainer#{clustersname}Aux.",
667 f
"CaloClusterCellLinkContainer#{clustersname}_links"]
668 toAOD = [f
"xAOD::CaloClusterContainer#{clustersname}",
669 f
"CaloClusterCellLinkContainer#{clustersname}_links"]
671 AODMoments.append(
"CellLink")
672 if flags.CaloRecGPU.ActiveConfig.addCalibrationHitDecoration:
673 AODMoments.append(flags.CaloRecGPU.ActiveConfig.CalibrationHitDecorationName)
675 if flags.CaloRecGPU.ActiveConfig.addCPData:
676 AODMoments += [
"ClusterWidthEta",
"ClusterWidthPhi"]
678 auxItems = f
"xAOD::CaloClusterAuxContainer#{clustersname}Aux."
679 auxItems+=
".".
join(AODMoments)
681 toAOD.append(auxItems)
683 result.merge(
addToESD(flags, toESD))
684 result.merge(
addToAOD(flags, toAOD))