2 from AthenaConfiguration.ComponentFactory
import CompFactory
3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.Enums
import LHCPeriod
7 PFTrackSelectorFactory=CompFactory.PFTrackSelector
8 PFTrackSelector=PFTrackSelectorFactory(algName)
12 from TrackToCalo.TrackToCaloConfig
import ParticleCaloExtensionToolCfg
15 eflowTrackCaloExtensionTool=CompFactory.eflowTrackCaloExtensionTool
18 TrackCaloExtensionTool.PFParticleCache =
""
20 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
22 from InDetConfig.InDetTrackSelectionToolConfig
import PFTrackSelectionToolCfg
26 if inputFlags.Detector.GeometryITk:
27 PFTrackSelector.ExtraInputs = {
28 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+ITkPixelDetectorElementCollection"),
29 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+ITkStripDetectorElementCollection"),
32 PFTrackSelector.ExtraInputs = {
33 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+PixelDetectorElementCollection"),
34 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+SCT_DetectorElementCollection"),
35 (
"InDetDD::TRT_DetElementContainer",
"ConditionStore+TRT_DetElementContainer"),
38 result.addEventAlgo (PFTrackSelector, primary=
True)
44 PFClusterSelectorToolFactory = CompFactory.PFClusterSelectorTool
45 PFClusterSelectorTool = PFClusterSelectorToolFactory(algName)
46 if clustersin
is not None:
47 PFClusterSelectorTool.clustersName = clustersin
48 if calclustersin
is not None:
49 PFClusterSelectorTool.calClustersName = calclustersin
51 if inputFlags.PF.useTruthCheating:
52 if inputFlags.PF.useTrackClusterTruthMatching:
53 PFClusterSelectorTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles =
"CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
55 if inputFlags.PF.useTopoTowers:
56 PFClusterSelectorTool.clustersName=
"CaloTopoSignal"
57 PFClusterSelectorTool.calClustersName=
"CaloCalTopoSignal"
59 return PFClusterSelectorTool
62 PFTrackClusterMatchingTool = CompFactory.PFTrackClusterMatchingTool
64 MatchingTool.ClusterPositionType = clusterPositionType
65 MatchingTool.DistanceType = distanceType
66 MatchingTool.MatchCut = matchCut*matchCut
71 PFCellLevelSubtractionToolFactory = CompFactory.PFSubtractionTool
72 PFCellLevelSubtractionTool = PFCellLevelSubtractionToolFactory(toolName,useNNEnergy = inputFlags.PF.useMLEOverP)
74 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
75 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
78 if inputFlags.PF.useLegacyEOverPRun4:
79 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
80 PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
82 PFCellEOverPTool = CompFactory.PFCellEOverPTool
83 PFCellLevelSubtractionTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
85 PFCellLevelSubtractionTool.useLegacyEBinIndex=
False
87 if(inputFlags.PF.EOverPMode):
88 PFCellLevelSubtractionTool.CalcEOverP =
True
89 PFCellLevelSubtractionTool.nClusterMatchesToUse = -1
91 PFCellLevelSubtractionTool.nClusterMatchesToUse = 1
93 if(inputFlags.PF.EOverPMode):
94 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"CalObjBldMatchingTool")
96 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,1.64,
"EtaPhiSquareSignificance",
"GeomCenterEtaPhi",
"CalObjBldMatchingTool")
98 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_015 =
getPFTrackClusterMatchingTool(inputFlags,0.15,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"MatchingTool_Pull_015")
99 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_02 =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"MatchingTool_Pull_02")
101 if inputFlags.PF.useMLEOverP:
102 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFCellLevelEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
103 PFCellLevelSubtractionTool.NNEnergyPredictorTool = PFEnergyPredictorTool
104 PFCellLevelSubtractionTool.addCPData = inputFlags.PF.addCPData
106 if inputFlags.PF.useTruthCheating:
107 if inputFlags.PF.useTrackClusterTruthMatching:
108 PFCellLevelSubtractionTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles =
"CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
109 PFCellLevelSubtractionTool.useTrackClusterTruthMatching=
True
111 if inputFlags.PF.useTruthForChargedShowerSubtraction:
112 PFCellLevelSubtractionTool.useTruthForChargedShowerSubtraction =
True
113 PFCellLevelSubtractionTool.PFSimulateTruthShowerTool = CompFactory.PFSimulateTruthShowerTool(
"PFSimulateTruthShowerTool")
115 return PFCellLevelSubtractionTool
118 PFRecoverSplitShowersToolFactory = CompFactory.PFSubtractionTool
119 PFRecoverSplitShowersTool = PFRecoverSplitShowersToolFactory(toolName,useNNEnergy = inputFlags.PF.useMLEOverP)
121 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
122 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
125 if inputFlags.PF.useLegacyEOverPRun4:
126 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
127 PFRecoverSplitShowersTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
129 PFCellEOverPTool = CompFactory.PFCellEOverPTool
130 PFRecoverSplitShowersTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
132 PFRecoverSplitShowersTool.useLegacyEBinIndex=
False
134 PFRecoverSplitShowersTool.RecoverSplitShowers =
True
136 if inputFlags.PF.useMLEOverP:
137 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFRecoverSplitShowersEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
138 PFRecoverSplitShowersTool.NNEnergyPredictorTool = PFEnergyPredictorTool
140 return PFRecoverSplitShowersTool
144 PFMomentCalculatorToolFactory = CompFactory.PFMomentCalculatorTool
145 PFMomentCalculatorTool = PFMomentCalculatorToolFactory(
"PFMomentCalculatorTool")
147 from CaloRec.CaloTopoClusterConfig
import getTopoMoments
148 PFClusterMomentsMaker = result.popToolsAndMerge(
getTopoMoments(inputFlags))
149 if (len(momentsToCalculateList) > 0):
150 PFClusterMomentsMaker.MomentsNames = momentsToCalculateList
151 PFMomentCalculatorTool.CaloClusterMomentsMaker = PFClusterMomentsMaker
153 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
156 if(inputFlags.PF.useCalibHitTruthClusterMoments):
157 PFMomentCalculatorTool.UseCalibHitTruth=
True
158 from CaloRec.CaloTopoClusterConfig
import getTopoCalibMoments
161 result.setPrivateTools(PFMomentCalculatorTool)
165 PFLCCalibTool = CompFactory.PFLCCalibTool
168 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
170 PFLCCalibTool.UseLocalWeight =
False
172 from CaloRec.CaloTopoClusterConfig
import getTopoClusterLocalCalibTools
175 PFLCCalibTool.CaloClusterLocalCalib=lcCalibToolList[0]
176 PFLCCalibTool.CaloClusterLocalCalibOOCC=lcCalibToolList[1]
177 PFLCCalibTool.CaloClusterLocalCalibOOCCPi0=lcCalibToolList[2]
178 PFLCCalibTool.CaloClusterLocalCalibDM=lcCalibToolList[3]
183 FlowElementChargedCreatorAlgorithmFactory = CompFactory.PFChargedFlowElementCreatorAlgorithm
184 FlowElementChargedCreatorAlgorithm = FlowElementChargedCreatorAlgorithmFactory(
"PFChargedFlowElementCreatorAlgorithm"+nameSuffix)
185 FlowElementChargedCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
186 if chargedFlowElementOutputName:
187 FlowElementChargedCreatorAlgorithm.FlowElementOutputName=chargedFlowElementOutputName
188 if(inputFlags.PF.EOverPMode):
189 FlowElementChargedCreatorAlgorithm.FlowElementOutputName=
"EOverPChargedParticleFlowObjects"
190 FlowElementChargedCreatorAlgorithm.EOverPMode =
True
191 if inputFlags.PF.addCPData:
192 FlowElementChargedCreatorAlgorithm.addCPData =
True
194 return FlowElementChargedCreatorAlgorithm
197 FlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFNeutralFlowElementCreatorAlgorithm
198 FlowElementNeutralCreatorAlgorithm = FlowElementNeutralCreatorAlgorithmFactory(
"PFNeutralFlowElementCreatorAlgorithm"+nameSuffix)
199 FlowElementNeutralCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
200 if neutralFlowElementOutputName:
201 FlowElementNeutralCreatorAlgorithm.FlowElementOutputName=neutralFlowElementOutputName
202 if(inputFlags.PF.EOverPMode):
203 FlowElementNeutralCreatorAlgorithm.FlowElementOutputName=
"EOverPNeutralParticleFlowObjects"
204 if(inputFlags.PF.useCalibHitTruthClusterMoments
and inputFlags.PF.addClusterMoments):
205 FlowElementNeutralCreatorAlgorithm.UseCalibHitTruth=
True
206 if inputFlags.PF.addCPData:
207 FlowElementNeutralCreatorAlgorithm.addCPData =
True
209 return FlowElementNeutralCreatorAlgorithm
212 LCFlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFLCNeutralFlowElementCreatorAlgorithm
213 LCFlowElementNeutralCreatorAlgorithm = LCFlowElementNeutralCreatorAlgorithmFactory(
"PFLCNeutralFlowElementCreatorAlgorithm")
214 if neutralFlowElementOutputName:
215 LCFlowElementNeutralCreatorAlgorithm.FELCOutputName=neutralFlowElementOutputName
216 if(inputFlags.PF.EOverPMode):
217 LCFlowElementNeutralCreatorAlgorithm.FEInputContainerName=
"EOverPNeutralParticleFlowObjects"
218 LCFlowElementNeutralCreatorAlgorithm.FELCOutputName=
"EOverPLCNeutralParticleFlowObjects"
220 return LCFlowElementNeutralCreatorAlgorithm
224 alg = CompFactory.PFOClusterMLCorrectionAlgorithm(
"PFOClusterMLCorrectionAlgorithm")
225 suffix =
"ParticleFlowObjects"
226 alg.NeutralPFlowInputContainer = inputNameBase +
"Neutral" + suffix
227 alg.ChargedPFlowInputContainer = inputNameBase +
"Charged" + suffix
228 alg.NeutralPFlowOutputContainer = outputNameBase +
"Neutral" + suffix
229 alg.ChargedPFlowOutputContainer = outputNameBase +
"Charged" + suffix
234 if toolName ==
"NeutralPFOClusterMLCorrectionTool":
235 tool = CompFactory.NeutralPFOClusterMLCorrectionTool(toolName)
236 tool.ClusterMLCorrectedEnergyDecorationKey = clusterMLCorrectedEnergyDecorationKey
238 raise ValueError(f
"Unknown tool name: {toolName}")
241 ca.setPrivateTools(tool)
248 kwargs.setdefault(
"neutral_FE_cont_name",
"")
249 kwargs.setdefault(
"charged_FE_cont_name",
"")
250 kwargs.setdefault(
"doTCC",
False)
251 kwargs.setdefault(
"useGlobal",
False)
253 PFEGamFlowElementLinkerAlgorithmFactory=CompFactory.PFEGamFlowElementAssoc
255 algName =
"PFEGamFlowElementAssoc"
256 PFEGamFlowElementLinkerAlgorithm=PFEGamFlowElementLinkerAlgorithmFactory(algName)
263 if kwargs[
'neutral_FE_cont_name']:
264 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs[
'neutral_FE_cont_name']
266 if kwargs[
'charged_FE_cont_name']:
267 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs[
'charged_FE_cont_name']
271 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=
"TrackCaloClustersNeutral"
272 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=
"TrackCaloClustersCharged"
276 EL_NFE_Link=
str(PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey)
277 PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey=EL_NFE_Link.replace(
"FELinks",
"TCCLinks")
278 EL_CFE_Link=
str(PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey)
279 PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey=EL_CFE_Link.replace(
"FELinks",
"TCCLinks")
282 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey=
"TrackCaloClustersCharged.TCC_ElectronLinks"
283 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey=
"TrackCaloClustersNeutral.TCC_ElectronLinks"
287 PH_NFE_Link=
str(PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey)
288 PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey=PH_NFE_Link.replace(
"FELinks",
"TCCLinks")
289 PH_CFE_Link=
str(PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey)
290 PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey=PH_CFE_Link.replace(
"FELinks",
"TCCLinks")
293 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey=
"TrackCaloClustersCharged.TCC_PhotonLinks"
294 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey=
"TrackCaloClustersNeutral.TCC_PhotonLinks"
296 if kwargs[
'useGlobal']:
298 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=
"GlobalNeutralParticleFlowObjects"
299 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=
"GlobalChargedParticleFlowObjects"
303 EL_NFE_Link=
str(PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey)
304 PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey=EL_NFE_Link.replace(
"FELinks",
"GlobalFELinks")
305 EL_CFE_Link=
str(PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey)
306 PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey=EL_CFE_Link.replace(
"FELinks",
"GlobalFELinks")
309 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey=
"GlobalChargedParticleFlowObjects.GlobalFE_ElectronLinks"
310 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey=
"GlobalNeutralParticleFlowObjects.GlobalFE_ElectronLinks"
314 PH_NFE_Link=
str(PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey)
315 PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey=PH_NFE_Link.replace(
"FELinks",
"GlobalFELinks")
316 PH_CFE_Link=
str(PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey)
317 PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey=PH_CFE_Link.replace(
"FELinks",
"GlobalFELinks")
320 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey=
"GlobalChargedParticleFlowObjects.TCC_PhotonLinks"
321 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey=
"GlobalNeutralParticleFlowObjects.TCC_PhotonLinks"
325 return PFEGamFlowElementLinkerAlgorithm
329 kwargs.setdefault(
"neutral_FE_cont_name",
"")
330 kwargs.setdefault(
"charged_FE_cont_name",
"")
331 kwargs.setdefault(
"LinkNeutralFEClusters",
True)
332 kwargs.setdefault(
"doTCC",
False)
333 kwargs.setdefault(
"useGlobal",
False)
335 useMuonTopoClusters =
False
336 from AthenaConfiguration.Enums
import ProductionStep
339 if inputFlags.Common.ProductionStep
in [ProductionStep.Derivation]
or inputFlags.DQ.Environment ==
"AOD":
340 useMuonTopoClusters =
True
343 PFMuonFlowElementLinkerAlgorithmFactory=CompFactory.PFMuonFlowElementAssoc
345 algName=
"PFMuonFlowElementAssoc"
346 PFMuonFlowElementLinkerAlgorithm=PFMuonFlowElementLinkerAlgorithmFactory(algName)
352 if kwargs[
'neutral_FE_cont_name']:
354 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs[
'neutral_FE_cont_name']
357 if kwargs[
'charged_FE_cont_name']:
358 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs[
'charged_FE_cont_name']
360 PFMuonFlowElementLinkerAlgorithm.LinkNeutralFEClusters = kwargs[
'LinkNeutralFEClusters']
361 PFMuonFlowElementLinkerAlgorithm.useMuonTopoClusters = useMuonTopoClusters
370 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=service_key+
"TrackCaloClustersCharged"
371 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=service_key+
"TrackCaloClustersNeutral"
376 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks=service_key+
"Muons.chargedTCCLinks"
377 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks=service_key+
"Muons.neutralTCCLinks"
378 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks=service_key+
"TrackCaloClustersNeutral.TCC_MuonLinks"
379 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks=service_key+
"TrackCaloClustersCharged.TCC_MuonLinks"
380 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon=
"TrackCaloClustersCharged.TCC_efrac_matched_muon"
382 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons=
"TrackCaloClustersNeutral.TCC_nMatchedMuons"
383 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon=
"TrackCaloClustersNeutral.TCC_efrac_matched_muon"
385 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE=
"Muons.muon_efrac_matched_TCC"
387 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR=
"Muons.deltaR_muon_clus_TCCalg"
389 if kwargs[
'useGlobal']:
390 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=
"GlobalChargedParticleFlowObjects"
391 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=
"GlobalNeutralParticleFlowObjects"
393 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks=
"Muons.chargedGlobalFELinks"
394 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks=
"Muons.neutralGlobalFELinks"
396 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks=
"GlobalNeutralParticleFlowObjects.GlobalFE_MuonLinks"
397 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks=
"GlobalChargedParticleFlowObjects.GlobalFE_MuonLinks"
398 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon=
"GlobalChargedParticleFlowObjects.GlobalFE_efrac_matched_muon"
400 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons=
"GlobalNeutralParticleFlowObjects.GlobalFE_nMatchedMuons"
401 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon=
"GlobalNeutralParticleFlowObjects.GlobalFE_efrac_matched_muon"
403 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE=
"Muons.muon_efrac_matched_GlobalFE"
405 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR=
"Muons.deltaR_muon_clus_GlobalFEalg"
407 if kwargs[
'LinkNeutralFEClusters']
and not useMuonTopoClusters:
410 PFMuonFlowElementLinkerAlgorithm.ExtraInputs.add((
'CaloCellContainer', inputFlags.Egamma.Keys.Input.CaloCells))
412 if kwargs[
'LinkNeutralFEClusters']:
416 from AthenaCommon.Logging
import logging
417 msg=logging.getLogger(
"PFCfg.py::getMuonFlowElementAssocAlgorithm")
418 msg.error(
"Neutral FE from AOD configured to be linked with Muon. This link will fail due to missing CaloCells in the AOD")
419 msg.info(
"Terminating job")
423 return PFMuonFlowElementLinkerAlgorithm
427 kwargs.setdefault(
"neutral_FE_cont_name",
"")
428 kwargs.setdefault(
"charged_FE_cont_name",
"")
429 kwargs.setdefault(
"doTCC",
False)
430 kwargs.setdefault(
"useGlobal",
False)
432 PFTauFlowElementLinkerAlgorithmFactory=CompFactory.PFTauFlowElementAssoc
434 algName =
"PFTauFlowElementAssoc"
436 PFTauFlowElementLinkerAlgorithm=PFTauFlowElementLinkerAlgorithmFactory(algName)
443 if kwargs[
'neutral_FE_cont_name']:
444 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer = kwargs[
'neutral_FE_cont_name']
446 if kwargs[
'charged_FE_cont_name']:
447 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer = kwargs[
'charged_FE_cont_name']
450 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer=
"TrackCaloClustersNeutral"
451 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer=
"TrackCaloClustersCharged"
453 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey=
"TauJets.neutralTCCLinks"
454 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey=
"TauJets.chargedTCCLinks"
456 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey=
"TrackCaloClustersNeutral.TCC_TauLinks"
457 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey=
"TrackCaloClustersCharged.TCC_TauLinks"
460 if kwargs[
'useGlobal']:
461 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer=
"GlobalNeutralParticleFlowObjects"
462 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer=
"GlobalChargedParticleFlowObjects"
464 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey=
"TauJets.neutralGlobalFELinks"
465 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey=
"TauJets.chargedGlobalFELinks"
467 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey=
"GlobalNeutralParticleFlowObjects.GlobalFE_TauLinks"
468 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey=
"GlobalChargedParticleFlowObjects.GlobalFE_TauLinks"
470 return PFTauFlowElementLinkerAlgorithm
475 PFAlgorithm=CompFactory.PFAlgorithm
479 if inputFlags.HeavyIon.Egamma.doSubtractedClusters:
480 PFAlgorithm.PFClusterSelectorTool =
getPFClusterSelectorTool(inputFlags,inputFlags.HeavyIon.Egamma.UncalibCaloTopoCluster,inputFlags.HeavyIon.Egamma.CaloTopoCluster,
"PFClusterSelectorTool")
482 topoClustersName=
"CaloTopoClusters"
483 PFAlgorithm.PFClusterSelectorTool =
getPFClusterSelectorTool(inputFlags,topoClustersName,
"CaloCalTopoClusters",
"PFClusterSelectorTool")
487 if(
False is inputFlags.PF.EOverPMode
and False is inputFlags.PF.useTruthCheating):
491 PFAlgorithm.BaseToolList = [PFMomentCalculatorTools]
493 if inputFlags.PF.EOverPMode:
494 PFAlgorithm.BaseToolList += [CompFactory.PFRadialEnergyCalculatorTool()]
496 result.addEventAlgo(PFAlgorithm)
502 kwargs.setdefault(
"useGlobal",
True)