2from AthenaConfiguration.ComponentFactory
import CompFactory
3from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4from AthenaConfiguration.Enums
import LHCPeriod
7 PFTrackSelectorFactory=CompFactory.PFTrackSelector
8 PFTrackSelector=PFTrackSelectorFactory(algName)
10 result = ComponentAccumulator()
12 if inputFlags.PF.useActsExtrapolation:
14 from ActsConfig.ActsGeometryConfig
import ActsExtrapolationToolCfg
15 ActsExtrapolationTool = result.popToolsAndMerge(ActsExtrapolationToolCfg(inputFlags,MaxSteps=10000))
16 PFTrackCaloExtensionTool=CompFactory.PFTrackCaloExtensionTool
17 TrackCaloExtensionTool=
PFTrackCaloExtensionTool(
"PFTrackCaloExtensionTool_ACTS",ExtrapolationTool=ActsExtrapolationTool)
18 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
21 from TrackToCalo.TrackToCaloConfig
import ParticleCaloExtensionToolCfg
22 pcExtensionTool = result.popToolsAndMerge(ParticleCaloExtensionToolCfg(inputFlags))
24 eflowTrackCaloExtensionTool=CompFactory.eflowTrackCaloExtensionTool
27 TrackCaloExtensionTool.PFParticleCache =
""
29 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
31 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig
import (
32 PFTrackSelectionToolCfg)
33 PFTrackSelector.trackSelectionTool = result.popToolsAndMerge(PFTrackSelectionToolCfg(inputFlags))
36 if inputFlags.Detector.GeometryITk:
37 PFTrackSelector.ExtraInputs = {
38 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+ITkPixelDetectorElementCollection"),
39 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+ITkStripDetectorElementCollection"),
42 PFTrackSelector.ExtraInputs = {
43 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+PixelDetectorElementCollection"),
44 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+SCT_DetectorElementCollection"),
45 (
"InDetDD::TRT_DetElementContainer",
"ConditionStore+TRT_DetElementContainer"),
48 result.addEventAlgo (PFTrackSelector, primary=
True)
54 PFClusterSelectorToolFactory = CompFactory.PFClusterSelectorTool
55 PFClusterSelectorTool = PFClusterSelectorToolFactory(algName)
56 if clustersin
is not None:
57 PFClusterSelectorTool.clustersName = clustersin
58 if calclustersin
is not None:
59 PFClusterSelectorTool.calClustersName = calclustersin
61 if inputFlags.PF.useTruthCheating:
62 if inputFlags.PF.useTrackClusterTruthMatching:
63 PFClusterSelectorTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles =
"CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
65 if inputFlags.PF.useTopoTowers:
66 PFClusterSelectorTool.clustersName=
"CaloTopoSignal"
67 PFClusterSelectorTool.calClustersName=
"CaloCalTopoSignal"
69 return PFClusterSelectorTool
72 PFTrackClusterMatchingTool = CompFactory.PFTrackClusterMatchingTool
74 MatchingTool.ClusterPositionType = clusterPositionType
75 MatchingTool.DistanceType = distanceType
76 MatchingTool.MatchCut = matchCut*matchCut
81 if inputFlags.PF.useTruthCheating
and inputFlags.PF.useTrackClusterTruthMatching:
82 PFUnifiedCellLevelMatchingToolFactory = CompFactory.PFUnifiedMatchingTruthTool
83 PFUnifiedCellLevelMatchingTool = PFUnifiedCellLevelMatchingToolFactory(toolName+
"_truthCheating")
84 PFUnifiedCellLevelMatchingTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles =
"CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
86 PFUnifiedCellLevelMatchingToolFactory = CompFactory.PFUnifiedMatchingTool
87 PFUnifiedCellLevelMatchingTool = PFUnifiedCellLevelMatchingToolFactory(toolName)
89 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
90 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
93 PFCellEOverPTool = CompFactory.PFCellEOverPTool
94 PFUnifiedCellLevelMatchingTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
96 PFUnifiedCellLevelMatchingTool.useLegacyEBinIndex=
False
98 if(inputFlags.PF.EOverPMode):
99 PFUnifiedCellLevelMatchingTool.nClusterMatchesToUse = -1
100 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"CalObjBldMatchingTool")
102 PFUnifiedCellLevelMatchingTool.nClusterMatchesToUse = 1
103 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,1.64,
"EtaPhiSquareSignificance",
"GeomCenterEtaPhi",
"CalObjBldMatchingTool")
105 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool_02 =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"MatchingTool_Pull_02")
107 PFUnifiedCellLevelMatchingTool.addCPData = inputFlags.PF.addCPData
109 return PFUnifiedCellLevelMatchingTool
113 if inputFlags.PF.useTruthCheating
and inputFlags.PF.useTruthForChargedShowerSubtraction:
114 PFUnifiedCellLevelSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTruthTool
115 PFUnifiedCellLevelSubtractionOnlyTool = PFUnifiedCellLevelSubtractionOnlyToolFactory(toolName+
"_truthCheating", useNNEnergy = inputFlags.PF.useMLEOverP)
116 PFUnifiedCellLevelSubtractionOnlyTool.PFSimulateTruthShowerTool = CompFactory.PFSimulateTruthShowerTool(
"PFSimulateTruthShowerTool")
118 PFUnifiedCellLevelSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTool
119 PFUnifiedCellLevelSubtractionOnlyTool = PFUnifiedCellLevelSubtractionOnlyToolFactory(toolName, useNNEnergy = inputFlags.PF.useMLEOverP)
121 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
122 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
125 PFCellEOverPTool = CompFactory.PFCellEOverPTool
126 PFUnifiedCellLevelSubtractionOnlyTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
128 PFUnifiedCellLevelSubtractionOnlyTool.useLegacyEBinIndex=
False
130 if(inputFlags.PF.EOverPMode):
131 PFUnifiedCellLevelSubtractionOnlyTool.CalcEOverP =
True
133 PFUnifiedCellLevelSubtractionOnlyTool.addCPData = inputFlags.PF.addCPData
135 if inputFlags.PF.useMLEOverP:
136 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFCellLevelEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
137 PFUnifiedCellLevelSubtractionOnlyTool.NNEnergyPredictorTool = PFEnergyPredictorTool
140 return PFUnifiedCellLevelSubtractionOnlyTool
148 PFUnifiedRecoverSplitShowersMatchingToolFactory = CompFactory.PFUnifiedMatchingTool
149 PFUnifiedRecoverSplitShowersMatchingTool = PFUnifiedRecoverSplitShowersMatchingToolFactory(toolName)
151 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
152 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
155 PFCellEOverPTool = CompFactory.PFCellEOverPTool
156 PFUnifiedRecoverSplitShowersMatchingTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
158 PFUnifiedRecoverSplitShowersMatchingTool.useLegacyEBinIndex=
False
160 PFUnifiedRecoverSplitShowersMatchingTool.RecoverSplitShowers =
True
162 return PFUnifiedRecoverSplitShowersMatchingTool
169 PFUnifiedRecoverSplitShowersSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTool
170 PFUnifiedRecoverSplitShowersSubtractionOnlyTool = PFUnifiedRecoverSplitShowersSubtractionOnlyToolFactory(toolName, useNNEnergy = inputFlags.PF.useMLEOverP)
172 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
173 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
176 PFCellEOverPTool = CompFactory.PFCellEOverPTool
177 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
179 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.useLegacyEBinIndex=
False
181 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.RecoverSplitShowers =
True
183 if inputFlags.PF.useMLEOverP:
184 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFRecoverSplitShowersEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
185 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.NNEnergyPredictorTool = PFEnergyPredictorTool
187 return PFUnifiedRecoverSplitShowersSubtractionOnlyTool
192 result=ComponentAccumulator()
193 PFMomentCalculatorToolFactory = CompFactory.PFUnifiedMomentCalculatorTool
195 PFMomentCalculatorTool = PFMomentCalculatorToolFactory(
"PFMomentCalculatorTool")
197 from CaloRec.CaloTopoClusterConfig
import getTopoMoments
198 PFClusterMomentsMaker = result.popToolsAndMerge(getTopoMoments(inputFlags))
199 PFMomentCalculatorTool.CaloClusterMomentsMaker = PFClusterMomentsMaker
201 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
204 if(inputFlags.PF.useCalibHitTruthClusterMoments):
205 PFMomentCalculatorTool.UseCalibHitTruth=
True
206 from CaloRec.CaloTopoClusterConfig
import getTopoCalibMoments
207 PFMomentCalculatorTool.CaloCalibClusterMomentsMaker2 = getTopoCalibMoments(inputFlags)
209 result.setPrivateTools(PFMomentCalculatorTool)
214 PFLCCalibTool = CompFactory.PFUnifiedLCCalibTool(
"PFLCCalibTool")
216 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
218 PFLCCalibTool.UseLocalWeight =
False
220 from CaloRec.CaloTopoClusterConfig
import getTopoClusterLocalCalibTools
221 lcCalibToolList = getTopoClusterLocalCalibTools(inputFlags)
223 PFLCCalibTool.CaloClusterLocalCalib=lcCalibToolList[0]
224 PFLCCalibTool.CaloClusterLocalCalibOOCC=lcCalibToolList[1]
225 PFLCCalibTool.CaloClusterLocalCalibOOCCPi0=lcCalibToolList[2]
226 PFLCCalibTool.CaloClusterLocalCalibDM=lcCalibToolList[3]
231 FlowElementChargedCreatorAlgorithmFactory = CompFactory.PFChargedFlowElementCreatorAlgorithm
232 FlowElementChargedCreatorAlgorithm = FlowElementChargedCreatorAlgorithmFactory(
"PFChargedFlowElementCreatorAlgorithm"+nameSuffix)
233 FlowElementChargedCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
234 if chargedFlowElementOutputName:
235 FlowElementChargedCreatorAlgorithm.FlowElementOutputName=chargedFlowElementOutputName
236 if(inputFlags.PF.EOverPMode):
237 FlowElementChargedCreatorAlgorithm.FlowElementOutputName=
"EOverPChargedParticleFlowObjects"
238 FlowElementChargedCreatorAlgorithm.EOverPMode =
True
239 if inputFlags.PF.addCPData:
240 FlowElementChargedCreatorAlgorithm.addCPData =
True
242 return FlowElementChargedCreatorAlgorithm
245 FlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFNeutralFlowElementCreatorAlgorithm
246 FlowElementNeutralCreatorAlgorithm = FlowElementNeutralCreatorAlgorithmFactory(
"PFNeutralFlowElementCreatorAlgorithm"+nameSuffix)
247 FlowElementNeutralCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
248 if neutralFlowElementOutputName:
249 FlowElementNeutralCreatorAlgorithm.FlowElementOutputName=neutralFlowElementOutputName
250 if(inputFlags.PF.EOverPMode):
251 FlowElementNeutralCreatorAlgorithm.FlowElementOutputName=
"EOverPNeutralParticleFlowObjects"
252 if(inputFlags.PF.useCalibHitTruthClusterMoments
and inputFlags.PF.addClusterMoments):
253 FlowElementNeutralCreatorAlgorithm.UseCalibHitTruth=
True
254 if inputFlags.PF.addCPData:
255 FlowElementNeutralCreatorAlgorithm.addCPData =
True
257 return FlowElementNeutralCreatorAlgorithm
260 LCFlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFLCNeutralFlowElementCreatorAlgorithm
261 LCFlowElementNeutralCreatorAlgorithm = LCFlowElementNeutralCreatorAlgorithmFactory(
"PFLCNeutralFlowElementCreatorAlgorithm")
262 if neutralFlowElementOutputName:
263 LCFlowElementNeutralCreatorAlgorithm.FELCOutputName=neutralFlowElementOutputName
264 if(inputFlags.PF.EOverPMode):
265 LCFlowElementNeutralCreatorAlgorithm.FEInputContainerName=
"EOverPNeutralParticleFlowObjects"
266 LCFlowElementNeutralCreatorAlgorithm.FELCOutputName=
"EOverPLCNeutralParticleFlowObjects"
268 return LCFlowElementNeutralCreatorAlgorithm
272 alg = CompFactory.PFOClusterMLCorrectionAlgorithm(
"PFOClusterMLCorrectionAlgorithm")
273 suffix =
"ParticleFlowObjects"
274 alg.NeutralPFlowInputContainer = inputNameBase +
"Neutral" + suffix
275 alg.ChargedPFlowInputContainer = inputNameBase +
"Charged" + suffix
276 alg.NeutralPFlowOutputContainer = outputNameBase +
"Neutral" + suffix
277 alg.ChargedPFlowOutputContainer = outputNameBase +
"Charged" + suffix
282 if toolName ==
"NeutralPFOClusterMLCorrectionTool":
283 tool = CompFactory.NeutralPFOClusterMLCorrectionTool(toolName, **kwargs)
285 raise ValueError(f
"Unknown tool name: {toolName}")
287 ca = ComponentAccumulator()
288 ca.setPrivateTools(tool)
296 kwargs.setdefault(
"neutral_FE_cont_name",
"")
297 kwargs.setdefault(
"charged_FE_cont_name",
"")
298 kwargs.setdefault(
"doTCC",
False)
299 kwargs.setdefault(
"useGlobal",
False)
301 PFEGamFlowElementLinkerAlgorithmFactory=CompFactory.PFEGamFlowElementAssoc
303 algName =
"PFEGamFlowElementAssoc"
304 PFEGamFlowElementLinkerAlgorithm=PFEGamFlowElementLinkerAlgorithmFactory(algName)
311 if kwargs[
'neutral_FE_cont_name']:
312 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs[
'neutral_FE_cont_name']
314 if kwargs[
'charged_FE_cont_name']:
315 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs[
'charged_FE_cont_name']
319 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=
"TrackCaloClustersNeutral"
320 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=
"TrackCaloClustersCharged"
324 EL_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey)
325 PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey=EL_NFE_Link.replace(
"FELinks",
"TCCLinks")
326 EL_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey)
327 PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey=EL_CFE_Link.replace(
"FELinks",
"TCCLinks")
330 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey=
"TCC_ElectronLinks"
331 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey=
"TCC_ElectronLinks"
335 PH_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey)
336 PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey=PH_NFE_Link.replace(
"FELinks",
"TCCLinks")
337 PH_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey)
338 PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey=PH_CFE_Link.replace(
"FELinks",
"TCCLinks")
341 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey=
"TCC_PhotonLinks"
342 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey=
"TCC_PhotonLinks"
344 if kwargs[
'useGlobal']:
346 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=
"GlobalNeutralParticleFlowObjects"
347 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=
"GlobalChargedParticleFlowObjects"
351 EL_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey)
352 PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey=EL_NFE_Link.replace(
"FELinks",
"GlobalFELinks")
353 EL_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey)
354 PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey=EL_CFE_Link.replace(
"FELinks",
"GlobalFELinks")
357 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey=
"GlobalFE_ElectronLinks"
358 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey=
"GlobalFE_ElectronLinks"
362 PH_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey)
363 PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey=PH_NFE_Link.replace(
"FELinks",
"GlobalFELinks")
364 PH_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey)
365 PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey=PH_CFE_Link.replace(
"FELinks",
"GlobalFELinks")
368 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey=
"TCC_PhotonLinks"
369 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey=
"TCC_PhotonLinks"
373 return PFEGamFlowElementLinkerAlgorithm
377 kwargs.setdefault(
"neutral_FE_cont_name",
"")
378 kwargs.setdefault(
"charged_FE_cont_name",
"")
379 kwargs.setdefault(
"LinkNeutralFEClusters",
True)
380 kwargs.setdefault(
"doTCC",
False)
381 kwargs.setdefault(
"useGlobal",
False)
383 useMuonTopoClusters =
False
384 from AthenaConfiguration.Enums
import ProductionStep
387 if inputFlags.Common.ProductionStep
in [ProductionStep.Derivation]
or inputFlags.DQ.Environment ==
"AOD":
388 useMuonTopoClusters =
True
391 PFMuonFlowElementLinkerAlgorithmFactory=CompFactory.PFMuonFlowElementAssoc
393 algName=
"PFMuonFlowElementAssoc"
394 PFMuonFlowElementLinkerAlgorithm=PFMuonFlowElementLinkerAlgorithmFactory(algName)
400 if kwargs[
'neutral_FE_cont_name']:
402 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs[
'neutral_FE_cont_name']
405 if kwargs[
'charged_FE_cont_name']:
406 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs[
'charged_FE_cont_name']
408 PFMuonFlowElementLinkerAlgorithm.LinkNeutralFEClusters = kwargs[
'LinkNeutralFEClusters']
409 PFMuonFlowElementLinkerAlgorithm.useMuonTopoClusters = useMuonTopoClusters
418 PFMuonFlowElementLinkerAlgorithm.MuonContainer=service_key+
"Muons"
419 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=service_key+
"TrackCaloClustersCharged"
420 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=service_key+
"TrackCaloClustersNeutral"
425 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks=
"chargedTCCLinks"
426 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks=
"neutralTCCLinks"
427 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks=
"TCC_MuonLinks"
428 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks=
"TCC_MuonLinks"
429 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon=
"TCC_efrac_matched_muon"
431 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons=
"TCC_nMatchedMuons"
432 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon=
"TCC_efrac_matched_muon"
434 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE=
"muon_efrac_matched_TCC"
436 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR=
"deltaR_muon_clus_TCCalg"
438 if kwargs[
'useGlobal']:
439 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=
"GlobalChargedParticleFlowObjects"
440 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=
"GlobalNeutralParticleFlowObjects"
442 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks=
"chargedGlobalFELinks"
443 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks=
"neutralGlobalFELinks"
445 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks=
"GlobalFE_MuonLinks"
446 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks=
"GlobalFE_MuonLinks"
447 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon=
"GlobalFE_efrac_matched_muon"
449 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons=
"GlobalFE_nMatchedMuons"
450 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon=
"GlobalFE_efrac_matched_muon"
452 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE=
"muon_efrac_matched_GlobalFE"
454 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR=
"deltaR_muon_clus_GlobalFEalg"
456 if kwargs[
'LinkNeutralFEClusters']
and not useMuonTopoClusters:
459 PFMuonFlowElementLinkerAlgorithm.ExtraInputs.add((
'CaloCellContainer', inputFlags.Egamma.Keys.Input.CaloCells))
461 if kwargs[
'LinkNeutralFEClusters']:
465 from AthenaCommon.Logging
import logging
466 msg=logging.getLogger(
"PFCfg.py::getMuonFlowElementAssocAlgorithm")
467 msg.error(
"Neutral FE from AOD configured to be linked with Muon. This link will fail due to missing CaloCells in the AOD")
468 msg.info(
"Terminating job")
472 return PFMuonFlowElementLinkerAlgorithm
476 kwargs.setdefault(
"neutral_FE_cont_name",
"")
477 kwargs.setdefault(
"charged_FE_cont_name",
"")
478 kwargs.setdefault(
"doTCC",
False)
479 kwargs.setdefault(
"useGlobal",
False)
481 PFTauFlowElementLinkerAlgorithmFactory=CompFactory.PFTauFlowElementAssoc
483 algName =
"PFTauFlowElementAssoc"
485 PFTauFlowElementLinkerAlgorithm=PFTauFlowElementLinkerAlgorithmFactory(algName)
492 if kwargs[
'neutral_FE_cont_name']:
493 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer = kwargs[
'neutral_FE_cont_name']
495 if kwargs[
'charged_FE_cont_name']:
496 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer = kwargs[
'charged_FE_cont_name']
499 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer=
"TrackCaloClustersNeutral"
500 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer=
"TrackCaloClustersCharged"
502 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey=
"neutralTCCLinks"
503 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey=
"chargedTCCLinks"
505 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey=
"TCC_TauLinks"
506 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey=
"TCC_TauLinks"
509 if kwargs[
'useGlobal']:
510 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer=
"GlobalNeutralParticleFlowObjects"
511 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer=
"GlobalChargedParticleFlowObjects"
513 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey=
"neutralGlobalFELinks"
514 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey=
"chargedGlobalFELinks"
516 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey=
"GlobalFE_TauLinks"
517 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey=
"GlobalFE_TauLinks"
519 return PFTauFlowElementLinkerAlgorithm
522 result=ComponentAccumulator()
524 PFAlgorithm=CompFactory.PFAlgorithm
527 if inputFlags.HeavyIon.Egamma.doSubtractedClusters:
528 PFAlgorithm.PFClusterSelectorTool =
getPFClusterSelectorTool(inputFlags,inputFlags.HeavyIon.Egamma.UncalibCaloTopoCluster,inputFlags.HeavyIon.Egamma.CaloTopoCluster,
"PFClusterSelectorTool")
530 topoClustersName=
"CaloTopoClusters"
531 PFAlgorithm.PFClusterSelectorTool =
getPFClusterSelectorTool(inputFlags,topoClustersName,
"CaloCalTopoClusters",
"PFClusterSelectorTool")
533 PFAlgorithm.useUnified =
True
536 if not inputFlags.PF.EOverPMode
and not inputFlags.PF.useTruthCheating:
541 PFAlgorithm.UnifiedBaseTools += [PFUnifiedMomentCalculatorTools]
543 if inputFlags.PF.EOverPMode:
544 PFAlgorithm.UnifiedBaseTools += [CompFactory.PFUnifiedRadialEnergyCalculatorTool()]
546 result.addEventAlgo(PFAlgorithm)
552 result=ComponentAccumulator()
554 kwargs.setdefault(
"useGlobal",
True)
getPFUnifiedLCCalibTool(inputFlags)
getLCNeutralFlowElementCreatorAlgorithm(inputFlags, neutralFlowElementOutputName)
getPFUnifiedRecoverSplitShowersMatchingTool(inputFlags, toolName)
getNeutralPFOClusterMLCorrectionToolCfg(inputFlags, toolName="NeutralPFOClusterMLCorrectionTool", **kwargs)
getPFClusterSelectorTool(inputFlags, clustersin, calclustersin, algName)
getPFUnifiedMomentCalculatorTool(inputFlags)
getChargedFlowElementCreatorAlgorithm(inputFlags, chargedFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
getPFUnifiedCellLevelSubtractionOnlyTool(inputFlags, toolName)
getEGamFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
getTauFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs)
getOfflinePFAlgorithm(inputFlags, **kwargs)
getPFOClusterMLCorrectionAlgorithmCfg(inputFlags, inputNameBase="JetETMiss", outputNameBase="JetETMissClusterMLCorrected")
getPFUnifiedRecoverSplitShowersSubtractionOnlyTool(inputFlags, toolName)
getPFTrackClusterMatchingTool(inputFlags, matchCut, distanceType, clusterPositionType, name)
getPFUnifiedCellLevelMatchingTool(inputFlags, toolName)
getNeutralFlowElementCreatorAlgorithm(inputFlags, neutralFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
PFTrackSelectorAlgCfg(inputFlags, algName, useCaching=True)
getMuonFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)