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:
13 PFTrackCaloExtensionTool=CompFactory.PFTrackCaloExtensionTool
15 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
18 from TrackToCalo.TrackToCaloConfig
import ParticleCaloExtensionToolCfg
19 pcExtensionTool = result.popToolsAndMerge(ParticleCaloExtensionToolCfg(inputFlags))
21 eflowTrackCaloExtensionTool=CompFactory.eflowTrackCaloExtensionTool
24 TrackCaloExtensionTool.PFParticleCache =
""
26 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
28 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig
import (
29 PFTrackSelectionToolCfg)
30 PFTrackSelector.trackSelectionTool = result.popToolsAndMerge(PFTrackSelectionToolCfg(inputFlags))
33 if inputFlags.Detector.GeometryITk:
34 PFTrackSelector.ExtraInputs = {
35 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+ITkPixelDetectorElementCollection"),
36 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+ITkStripDetectorElementCollection"),
39 PFTrackSelector.ExtraInputs = {
40 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+PixelDetectorElementCollection"),
41 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+SCT_DetectorElementCollection"),
42 (
"InDetDD::TRT_DetElementContainer",
"ConditionStore+TRT_DetElementContainer"),
45 result.addEventAlgo (PFTrackSelector, primary=
True)
51 PFClusterSelectorToolFactory = CompFactory.PFClusterSelectorTool
52 PFClusterSelectorTool = PFClusterSelectorToolFactory(algName)
53 if clustersin
is not None:
54 PFClusterSelectorTool.clustersName = clustersin
55 if calclustersin
is not None:
56 PFClusterSelectorTool.calClustersName = calclustersin
58 if inputFlags.PF.useTruthCheating:
59 if inputFlags.PF.useTrackClusterTruthMatching:
60 PFClusterSelectorTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles =
"CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
62 if inputFlags.PF.useTopoTowers:
63 PFClusterSelectorTool.clustersName=
"CaloTopoSignal"
64 PFClusterSelectorTool.calClustersName=
"CaloCalTopoSignal"
66 return PFClusterSelectorTool
69 PFTrackClusterMatchingTool = CompFactory.PFTrackClusterMatchingTool
71 MatchingTool.ClusterPositionType = clusterPositionType
72 MatchingTool.DistanceType = distanceType
73 MatchingTool.MatchCut = matchCut*matchCut
78 if inputFlags.PF.useTruthCheating
and inputFlags.PF.useTrackClusterTruthMatching:
79 PFUnifiedCellLevelMatchingToolFactory = CompFactory.PFUnifiedMatchingTruthTool
80 PFUnifiedCellLevelMatchingTool = PFUnifiedCellLevelMatchingToolFactory(toolName+
"_truthCheating")
81 PFUnifiedCellLevelMatchingTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles =
"CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
83 PFUnifiedCellLevelMatchingToolFactory = CompFactory.PFUnifiedMatchingTool
84 PFUnifiedCellLevelMatchingTool = PFUnifiedCellLevelMatchingToolFactory(toolName)
86 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
87 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
90 PFCellEOverPTool = CompFactory.PFCellEOverPTool
91 PFUnifiedCellLevelMatchingTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
93 PFUnifiedCellLevelMatchingTool.useLegacyEBinIndex=
False
95 if(inputFlags.PF.EOverPMode):
96 PFUnifiedCellLevelMatchingTool.nClusterMatchesToUse = -1
97 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"CalObjBldMatchingTool")
99 PFUnifiedCellLevelMatchingTool.nClusterMatchesToUse = 1
100 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,1.64,
"EtaPhiSquareSignificance",
"GeomCenterEtaPhi",
"CalObjBldMatchingTool")
102 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool_02 =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"MatchingTool_Pull_02")
104 PFUnifiedCellLevelMatchingTool.addCPData = inputFlags.PF.addCPData
106 return PFUnifiedCellLevelMatchingTool
110 if inputFlags.PF.useTruthCheating
and inputFlags.PF.useTruthForChargedShowerSubtraction:
111 PFUnifiedCellLevelSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTruthTool
112 PFUnifiedCellLevelSubtractionOnlyTool = PFUnifiedCellLevelSubtractionOnlyToolFactory(toolName+
"_truthCheating", useNNEnergy = inputFlags.PF.useMLEOverP)
113 PFUnifiedCellLevelSubtractionOnlyTool.PFSimulateTruthShowerTool = CompFactory.PFSimulateTruthShowerTool(
"PFSimulateTruthShowerTool")
115 PFUnifiedCellLevelSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTool
116 PFUnifiedCellLevelSubtractionOnlyTool = PFUnifiedCellLevelSubtractionOnlyToolFactory(toolName, useNNEnergy = inputFlags.PF.useMLEOverP)
118 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
119 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
122 PFCellEOverPTool = CompFactory.PFCellEOverPTool
123 PFUnifiedCellLevelSubtractionOnlyTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
125 PFUnifiedCellLevelSubtractionOnlyTool.useLegacyEBinIndex=
False
127 if(inputFlags.PF.EOverPMode):
128 PFUnifiedCellLevelSubtractionOnlyTool.CalcEOverP =
True
130 PFUnifiedCellLevelSubtractionOnlyTool.addCPData = inputFlags.PF.addCPData
132 if inputFlags.PF.useMLEOverP:
133 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFCellLevelEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
134 PFUnifiedCellLevelSubtractionOnlyTool.NNEnergyPredictorTool = PFEnergyPredictorTool
137 return PFUnifiedCellLevelSubtractionOnlyTool
145 PFUnifiedRecoverSplitShowersMatchingToolFactory = CompFactory.PFUnifiedMatchingTool
146 PFUnifiedRecoverSplitShowersMatchingTool = PFUnifiedRecoverSplitShowersMatchingToolFactory(toolName)
148 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
149 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
152 PFCellEOverPTool = CompFactory.PFCellEOverPTool
153 PFUnifiedRecoverSplitShowersMatchingTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
155 PFUnifiedRecoverSplitShowersMatchingTool.useLegacyEBinIndex=
False
157 PFUnifiedRecoverSplitShowersMatchingTool.RecoverSplitShowers =
True
159 return PFUnifiedRecoverSplitShowersMatchingTool
166 PFUnifiedRecoverSplitShowersSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTool
167 PFUnifiedRecoverSplitShowersSubtractionOnlyTool = PFUnifiedRecoverSplitShowersSubtractionOnlyToolFactory(toolName, useNNEnergy = inputFlags.PF.useMLEOverP)
169 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
170 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
173 PFCellEOverPTool = CompFactory.PFCellEOverPTool
174 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
176 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.useLegacyEBinIndex=
False
178 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.RecoverSplitShowers =
True
180 if inputFlags.PF.useMLEOverP:
181 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFRecoverSplitShowersEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
182 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.NNEnergyPredictorTool = PFEnergyPredictorTool
184 return PFUnifiedRecoverSplitShowersSubtractionOnlyTool
189 result=ComponentAccumulator()
190 PFMomentCalculatorToolFactory = CompFactory.PFUnifiedMomentCalculatorTool
192 PFMomentCalculatorTool = PFMomentCalculatorToolFactory(
"PFMomentCalculatorTool")
194 from CaloRec.CaloTopoClusterConfig
import getTopoMoments
195 PFClusterMomentsMaker = result.popToolsAndMerge(getTopoMoments(inputFlags))
197 if momentsToCalculateList:
198 PFClusterMomentsMaker.MomentsNames = momentsToCalculateList
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)
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)
getPFUnifiedMomentCalculatorTool(inputFlags, momentsToCalculateList=None)