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 from TrackToCalo.TrackToCaloConfig
import ParticleCaloExtensionToolCfg
13 pcExtensionTool = result.popToolsAndMerge(ParticleCaloExtensionToolCfg(inputFlags))
15 eflowTrackCaloExtensionTool=CompFactory.eflowTrackCaloExtensionTool
18 TrackCaloExtensionTool.PFParticleCache =
""
20 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
22 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig
import (
23 PFTrackSelectionToolCfg)
24 PFTrackSelector.trackSelectionTool = result.popToolsAndMerge(PFTrackSelectionToolCfg(inputFlags))
27 if inputFlags.Detector.GeometryITk:
28 PFTrackSelector.ExtraInputs = {
29 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+ITkPixelDetectorElementCollection"),
30 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+ITkStripDetectorElementCollection"),
33 PFTrackSelector.ExtraInputs = {
34 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+PixelDetectorElementCollection"),
35 (
"InDetDD::SiDetectorElementCollection",
"ConditionStore+SCT_DetectorElementCollection"),
36 (
"InDetDD::TRT_DetElementContainer",
"ConditionStore+TRT_DetElementContainer"),
39 result.addEventAlgo (PFTrackSelector, primary=
True)
45 PFClusterSelectorToolFactory = CompFactory.PFClusterSelectorTool
46 PFClusterSelectorTool = PFClusterSelectorToolFactory(algName)
47 if clustersin
is not None:
48 PFClusterSelectorTool.clustersName = clustersin
49 if calclustersin
is not None:
50 PFClusterSelectorTool.calClustersName = calclustersin
52 if inputFlags.PF.useTruthCheating:
53 if inputFlags.PF.useTrackClusterTruthMatching:
54 PFClusterSelectorTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles =
"CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
56 if inputFlags.PF.useTopoTowers:
57 PFClusterSelectorTool.clustersName=
"CaloTopoSignal"
58 PFClusterSelectorTool.calClustersName=
"CaloCalTopoSignal"
60 return PFClusterSelectorTool
63 PFTrackClusterMatchingTool = CompFactory.PFTrackClusterMatchingTool
65 MatchingTool.ClusterPositionType = clusterPositionType
66 MatchingTool.DistanceType = distanceType
67 MatchingTool.MatchCut = matchCut*matchCut
72 PFCellLevelSubtractionToolFactory = CompFactory.PFSubtractionTool
73 PFCellLevelSubtractionTool = PFCellLevelSubtractionToolFactory(toolName,useNNEnergy = inputFlags.PF.useMLEOverP)
75 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
76 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
79 if inputFlags.PF.useLegacyEOverPRun4:
80 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
81 PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
83 PFCellEOverPTool = CompFactory.PFCellEOverPTool
84 PFCellLevelSubtractionTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
86 PFCellLevelSubtractionTool.useLegacyEBinIndex=
False
88 if(inputFlags.PF.EOverPMode):
89 PFCellLevelSubtractionTool.CalcEOverP =
True
90 PFCellLevelSubtractionTool.nClusterMatchesToUse = -1
92 PFCellLevelSubtractionTool.nClusterMatchesToUse = 1
94 if(inputFlags.PF.EOverPMode):
95 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"CalObjBldMatchingTool")
97 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,1.64,
"EtaPhiSquareSignificance",
"GeomCenterEtaPhi",
"CalObjBldMatchingTool")
99 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_015 =
getPFTrackClusterMatchingTool(inputFlags,0.15,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"MatchingTool_Pull_015")
100 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_02 =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"MatchingTool_Pull_02")
102 if inputFlags.PF.useMLEOverP:
103 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFCellLevelEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
104 PFCellLevelSubtractionTool.NNEnergyPredictorTool = PFEnergyPredictorTool
105 PFCellLevelSubtractionTool.addCPData = inputFlags.PF.addCPData
107 if inputFlags.PF.useTruthCheating:
108 if inputFlags.PF.useTrackClusterTruthMatching:
109 PFCellLevelSubtractionTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles =
"CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
110 PFCellLevelSubtractionTool.useTrackClusterTruthMatching=
True
112 if inputFlags.PF.useTruthForChargedShowerSubtraction:
113 PFCellLevelSubtractionTool.useTruthForChargedShowerSubtraction =
True
114 PFCellLevelSubtractionTool.PFSimulateTruthShowerTool = CompFactory.PFSimulateTruthShowerTool(
"PFSimulateTruthShowerTool")
116 return PFCellLevelSubtractionTool
121 if inputFlags.PF.useTruthCheating
and inputFlags.PF.useTrackClusterTruthMatching:
122 PFUnifiedCellLevelMatchingToolFactory = CompFactory.PFUnifiedMatchingTruthTool
123 PFUnifiedCellLevelMatchingTool = PFUnifiedCellLevelMatchingToolFactory(toolName+
"_truthCheating")
124 PFUnifiedCellLevelMatchingTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles =
"CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
126 PFUnifiedCellLevelMatchingToolFactory = CompFactory.PFUnifiedMatchingTool
127 PFUnifiedCellLevelMatchingTool = PFUnifiedCellLevelMatchingToolFactory(toolName)
129 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
130 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
133 if inputFlags.PF.useLegacyEOverPRun4:
134 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
135 PFUnifiedCellLevelMatchingTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
137 PFCellEOverPTool = CompFactory.PFCellEOverPTool
138 PFUnifiedCellLevelMatchingTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
140 PFUnifiedCellLevelMatchingTool.useLegacyEBinIndex=
False
142 if(inputFlags.PF.EOverPMode):
143 PFUnifiedCellLevelMatchingTool.nClusterMatchesToUse = -1
145 PFUnifiedCellLevelMatchingTool.nClusterMatchesToUse = 1
147 if(inputFlags.PF.EOverPMode):
148 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"CalObjBldMatchingTool")
150 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool =
getPFTrackClusterMatchingTool(inputFlags,1.64,
"EtaPhiSquareSignificance",
"GeomCenterEtaPhi",
"CalObjBldMatchingTool")
152 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool_015 =
getPFTrackClusterMatchingTool(inputFlags,0.15,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"MatchingTool_Pull_015")
153 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool_02 =
getPFTrackClusterMatchingTool(inputFlags,0.2,
"EtaPhiSquareDistance",
"PlainEtaPhi",
"MatchingTool_Pull_02")
155 PFUnifiedCellLevelMatchingTool.addCPData = inputFlags.PF.addCPData
157 return PFUnifiedCellLevelMatchingTool
161 if inputFlags.PF.useTruthCheating
and inputFlags.PF.useTruthForChargedShowerSubtraction:
162 PFUnifiedCellLevelSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTruthTool
163 PFUnifiedCellLevelSubtractionOnlyTool = PFUnifiedCellLevelSubtractionOnlyToolFactory(toolName+
"_truthCheating", useNNEnergy = inputFlags.PF.useMLEOverP)
164 PFUnifiedCellLevelSubtractionOnlyTool.PFSimulateTruthShowerTool = CompFactory.PFSimulateTruthShowerTool(
"PFSimulateTruthShowerTool")
166 PFUnifiedCellLevelSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTool
167 PFUnifiedCellLevelSubtractionOnlyTool = PFUnifiedCellLevelSubtractionOnlyToolFactory(toolName, useNNEnergy = inputFlags.PF.useMLEOverP)
169 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
170 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
173 if inputFlags.PF.useLegacyEOverPRun4:
174 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
175 PFUnifiedCellLevelSubtractionOnlyTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
177 PFCellEOverPTool = CompFactory.PFCellEOverPTool
178 PFUnifiedCellLevelSubtractionOnlyTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
180 PFUnifiedCellLevelSubtractionOnlyTool.useLegacyEBinIndex=
False
182 if(inputFlags.PF.EOverPMode):
183 PFUnifiedCellLevelSubtractionOnlyTool.CalcEOverP =
True
185 PFUnifiedCellLevelSubtractionOnlyTool.addCPData = inputFlags.PF.addCPData
187 if inputFlags.PF.useMLEOverP:
188 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFCellLevelEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
189 PFUnifiedCellLevelSubtractionOnlyTool.NNEnergyPredictorTool = PFEnergyPredictorTool
192 return PFUnifiedCellLevelSubtractionOnlyTool
198 PFRecoverSplitShowersToolFactory = CompFactory.PFSubtractionTool
199 PFRecoverSplitShowersTool = PFRecoverSplitShowersToolFactory(toolName,useNNEnergy = inputFlags.PF.useMLEOverP)
201 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
202 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
205 if inputFlags.PF.useLegacyEOverPRun4:
206 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
207 PFRecoverSplitShowersTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
209 PFCellEOverPTool = CompFactory.PFCellEOverPTool
210 PFRecoverSplitShowersTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
212 PFRecoverSplitShowersTool.useLegacyEBinIndex=
False
214 PFRecoverSplitShowersTool.RecoverSplitShowers =
True
216 if inputFlags.PF.useMLEOverP:
217 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFRecoverSplitShowersEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
218 PFRecoverSplitShowersTool.NNEnergyPredictorTool = PFEnergyPredictorTool
220 return PFRecoverSplitShowersTool
226 PFUnifiedRecoverSplitShowersMatchingToolFactory = CompFactory.PFUnifiedMatchingTool
227 PFUnifiedRecoverSplitShowersMatchingTool = PFUnifiedRecoverSplitShowersMatchingToolFactory(toolName)
229 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
230 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
233 if inputFlags.PF.useLegacyEOverPRun4:
234 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
235 PFUnifiedRecoverSplitShowersMatchingTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
237 PFCellEOverPTool = CompFactory.PFCellEOverPTool
238 PFUnifiedRecoverSplitShowersMatchingTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
240 PFUnifiedRecoverSplitShowersMatchingTool.useLegacyEBinIndex=
False
242 PFUnifiedRecoverSplitShowersMatchingTool.RecoverSplitShowers =
True
244 return PFUnifiedRecoverSplitShowersMatchingTool
251 PFUnifiedRecoverSplitShowersSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTool
252 PFUnifiedRecoverSplitShowersSubtractionOnlyTool = PFUnifiedRecoverSplitShowersSubtractionOnlyToolFactory(toolName, useNNEnergy = inputFlags.PF.useMLEOverP)
254 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
255 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
258 if inputFlags.PF.useLegacyEOverPRun4:
259 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
260 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
262 PFCellEOverPTool = CompFactory.PFCellEOverPTool
263 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.eflowCellEOverPTool =
PFCellEOverPTool(
"PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
265 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.useLegacyEBinIndex=
False
267 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.RecoverSplitShowers =
True
269 if inputFlags.PF.useMLEOverP:
270 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool(
"PFRecoverSplitShowersEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
271 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.NNEnergyPredictorTool = PFEnergyPredictorTool
273 return PFUnifiedRecoverSplitShowersSubtractionOnlyTool
278 result=ComponentAccumulator()
280 PFMomentCalculatorToolFactory = CompFactory.PFUnifiedMomentCalculatorTool
282 PFMomentCalculatorToolFactory = CompFactory.PFMomentCalculatorTool
284 PFMomentCalculatorTool = PFMomentCalculatorToolFactory(
"PFMomentCalculatorTool")
286 from CaloRec.CaloTopoClusterConfig
import getTopoMoments
287 PFClusterMomentsMaker = result.popToolsAndMerge(getTopoMoments(inputFlags))
288 if (len(momentsToCalculateList) > 0):
289 PFClusterMomentsMaker.MomentsNames = momentsToCalculateList
290 PFMomentCalculatorTool.CaloClusterMomentsMaker = PFClusterMomentsMaker
292 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
295 if(inputFlags.PF.useCalibHitTruthClusterMoments):
296 PFMomentCalculatorTool.UseCalibHitTruth=
True
297 from CaloRec.CaloTopoClusterConfig
import getTopoCalibMoments
298 PFMomentCalculatorTool.CaloCalibClusterMomentsMaker2 = getTopoCalibMoments(inputFlags)
300 result.setPrivateTools(PFMomentCalculatorTool)
306 PFLCCalibTool = CompFactory.PFUnifiedLCCalibTool
308 PFLCCalibTool = CompFactory.PFLCCalibTool
312 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
314 PFLCCalibTool.UseLocalWeight =
False
316 from CaloRec.CaloTopoClusterConfig
import getTopoClusterLocalCalibTools
317 lcCalibToolList = getTopoClusterLocalCalibTools(inputFlags)
319 PFLCCalibTool.CaloClusterLocalCalib=lcCalibToolList[0]
320 PFLCCalibTool.CaloClusterLocalCalibOOCC=lcCalibToolList[1]
321 PFLCCalibTool.CaloClusterLocalCalibOOCCPi0=lcCalibToolList[2]
322 PFLCCalibTool.CaloClusterLocalCalibDM=lcCalibToolList[3]
327 FlowElementChargedCreatorAlgorithmFactory = CompFactory.PFChargedFlowElementCreatorAlgorithm
328 FlowElementChargedCreatorAlgorithm = FlowElementChargedCreatorAlgorithmFactory(
"PFChargedFlowElementCreatorAlgorithm"+nameSuffix)
329 FlowElementChargedCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
330 if chargedFlowElementOutputName:
331 FlowElementChargedCreatorAlgorithm.FlowElementOutputName=chargedFlowElementOutputName
332 if(inputFlags.PF.EOverPMode):
333 FlowElementChargedCreatorAlgorithm.FlowElementOutputName=
"EOverPChargedParticleFlowObjects"
334 FlowElementChargedCreatorAlgorithm.EOverPMode =
True
335 if inputFlags.PF.addCPData:
336 FlowElementChargedCreatorAlgorithm.addCPData =
True
338 return FlowElementChargedCreatorAlgorithm
341 FlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFNeutralFlowElementCreatorAlgorithm
342 FlowElementNeutralCreatorAlgorithm = FlowElementNeutralCreatorAlgorithmFactory(
"PFNeutralFlowElementCreatorAlgorithm"+nameSuffix)
343 FlowElementNeutralCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
344 if neutralFlowElementOutputName:
345 FlowElementNeutralCreatorAlgorithm.FlowElementOutputName=neutralFlowElementOutputName
346 if(inputFlags.PF.EOverPMode):
347 FlowElementNeutralCreatorAlgorithm.FlowElementOutputName=
"EOverPNeutralParticleFlowObjects"
348 if(inputFlags.PF.useCalibHitTruthClusterMoments
and inputFlags.PF.addClusterMoments):
349 FlowElementNeutralCreatorAlgorithm.UseCalibHitTruth=
True
350 if inputFlags.PF.addCPData:
351 FlowElementNeutralCreatorAlgorithm.addCPData =
True
353 return FlowElementNeutralCreatorAlgorithm
356 LCFlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFLCNeutralFlowElementCreatorAlgorithm
357 LCFlowElementNeutralCreatorAlgorithm = LCFlowElementNeutralCreatorAlgorithmFactory(
"PFLCNeutralFlowElementCreatorAlgorithm")
358 if neutralFlowElementOutputName:
359 LCFlowElementNeutralCreatorAlgorithm.FELCOutputName=neutralFlowElementOutputName
360 if(inputFlags.PF.EOverPMode):
361 LCFlowElementNeutralCreatorAlgorithm.FEInputContainerName=
"EOverPNeutralParticleFlowObjects"
362 LCFlowElementNeutralCreatorAlgorithm.FELCOutputName=
"EOverPLCNeutralParticleFlowObjects"
364 return LCFlowElementNeutralCreatorAlgorithm
368 alg = CompFactory.PFOClusterMLCorrectionAlgorithm(
"PFOClusterMLCorrectionAlgorithm")
369 suffix =
"ParticleFlowObjects"
370 alg.NeutralPFlowInputContainer = inputNameBase +
"Neutral" + suffix
371 alg.ChargedPFlowInputContainer = inputNameBase +
"Charged" + suffix
372 alg.NeutralPFlowOutputContainer = outputNameBase +
"Neutral" + suffix
373 alg.ChargedPFlowOutputContainer = outputNameBase +
"Charged" + suffix
378 if toolName ==
"NeutralPFOClusterMLCorrectionTool":
379 tool = CompFactory.NeutralPFOClusterMLCorrectionTool(toolName, **kwargs)
381 raise ValueError(f
"Unknown tool name: {toolName}")
383 ca = ComponentAccumulator()
384 ca.setPrivateTools(tool)
392 kwargs.setdefault(
"neutral_FE_cont_name",
"")
393 kwargs.setdefault(
"charged_FE_cont_name",
"")
394 kwargs.setdefault(
"doTCC",
False)
395 kwargs.setdefault(
"useGlobal",
False)
397 PFEGamFlowElementLinkerAlgorithmFactory=CompFactory.PFEGamFlowElementAssoc
399 algName =
"PFEGamFlowElementAssoc"
400 PFEGamFlowElementLinkerAlgorithm=PFEGamFlowElementLinkerAlgorithmFactory(algName)
407 if kwargs[
'neutral_FE_cont_name']:
408 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs[
'neutral_FE_cont_name']
410 if kwargs[
'charged_FE_cont_name']:
411 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs[
'charged_FE_cont_name']
415 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=
"TrackCaloClustersNeutral"
416 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=
"TrackCaloClustersCharged"
420 EL_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey)
421 PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey=EL_NFE_Link.replace(
"FELinks",
"TCCLinks")
422 EL_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey)
423 PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey=EL_CFE_Link.replace(
"FELinks",
"TCCLinks")
426 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey=
"TCC_ElectronLinks"
427 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey=
"TCC_ElectronLinks"
431 PH_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey)
432 PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey=PH_NFE_Link.replace(
"FELinks",
"TCCLinks")
433 PH_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey)
434 PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey=PH_CFE_Link.replace(
"FELinks",
"TCCLinks")
437 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey=
"TCC_PhotonLinks"
438 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey=
"TCC_PhotonLinks"
440 if kwargs[
'useGlobal']:
442 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=
"GlobalNeutralParticleFlowObjects"
443 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=
"GlobalChargedParticleFlowObjects"
447 EL_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey)
448 PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey=EL_NFE_Link.replace(
"FELinks",
"GlobalFELinks")
449 EL_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey)
450 PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey=EL_CFE_Link.replace(
"FELinks",
"GlobalFELinks")
453 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey=
"GlobalFE_ElectronLinks"
454 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey=
"GlobalFE_ElectronLinks"
458 PH_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey)
459 PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey=PH_NFE_Link.replace(
"FELinks",
"GlobalFELinks")
460 PH_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey)
461 PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey=PH_CFE_Link.replace(
"FELinks",
"GlobalFELinks")
464 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey=
"TCC_PhotonLinks"
465 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey=
"TCC_PhotonLinks"
469 return PFEGamFlowElementLinkerAlgorithm
473 kwargs.setdefault(
"neutral_FE_cont_name",
"")
474 kwargs.setdefault(
"charged_FE_cont_name",
"")
475 kwargs.setdefault(
"LinkNeutralFEClusters",
True)
476 kwargs.setdefault(
"doTCC",
False)
477 kwargs.setdefault(
"useGlobal",
False)
479 useMuonTopoClusters =
False
480 from AthenaConfiguration.Enums
import ProductionStep
483 if inputFlags.Common.ProductionStep
in [ProductionStep.Derivation]
or inputFlags.DQ.Environment ==
"AOD":
484 useMuonTopoClusters =
True
487 PFMuonFlowElementLinkerAlgorithmFactory=CompFactory.PFMuonFlowElementAssoc
489 algName=
"PFMuonFlowElementAssoc"
490 PFMuonFlowElementLinkerAlgorithm=PFMuonFlowElementLinkerAlgorithmFactory(algName)
496 if kwargs[
'neutral_FE_cont_name']:
498 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs[
'neutral_FE_cont_name']
501 if kwargs[
'charged_FE_cont_name']:
502 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs[
'charged_FE_cont_name']
504 PFMuonFlowElementLinkerAlgorithm.LinkNeutralFEClusters = kwargs[
'LinkNeutralFEClusters']
505 PFMuonFlowElementLinkerAlgorithm.useMuonTopoClusters = useMuonTopoClusters
514 PFMuonFlowElementLinkerAlgorithm.MuonContainer=service_key+
"Muons"
515 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=service_key+
"TrackCaloClustersCharged"
516 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=service_key+
"TrackCaloClustersNeutral"
521 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks=
"chargedTCCLinks"
522 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks=
"neutralTCCLinks"
523 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks=
"TCC_MuonLinks"
524 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks=
"TCC_MuonLinks"
525 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon=
"TCC_efrac_matched_muon"
527 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons=
"TCC_nMatchedMuons"
528 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon=
"TCC_efrac_matched_muon"
530 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE=
"muon_efrac_matched_TCC"
532 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR=
"deltaR_muon_clus_TCCalg"
534 if kwargs[
'useGlobal']:
535 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=
"GlobalChargedParticleFlowObjects"
536 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=
"GlobalNeutralParticleFlowObjects"
538 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks=
"chargedGlobalFELinks"
539 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks=
"neutralGlobalFELinks"
541 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks=
"GlobalFE_MuonLinks"
542 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks=
"GlobalFE_MuonLinks"
543 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon=
"GlobalFE_efrac_matched_muon"
545 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons=
"GlobalFE_nMatchedMuons"
546 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon=
"GlobalFE_efrac_matched_muon"
548 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE=
"muon_efrac_matched_GlobalFE"
550 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR=
"deltaR_muon_clus_GlobalFEalg"
552 if kwargs[
'LinkNeutralFEClusters']
and not useMuonTopoClusters:
555 PFMuonFlowElementLinkerAlgorithm.ExtraInputs.add((
'CaloCellContainer', inputFlags.Egamma.Keys.Input.CaloCells))
557 if kwargs[
'LinkNeutralFEClusters']:
561 from AthenaCommon.Logging
import logging
562 msg=logging.getLogger(
"PFCfg.py::getMuonFlowElementAssocAlgorithm")
563 msg.error(
"Neutral FE from AOD configured to be linked with Muon. This link will fail due to missing CaloCells in the AOD")
564 msg.info(
"Terminating job")
568 return PFMuonFlowElementLinkerAlgorithm
572 kwargs.setdefault(
"neutral_FE_cont_name",
"")
573 kwargs.setdefault(
"charged_FE_cont_name",
"")
574 kwargs.setdefault(
"doTCC",
False)
575 kwargs.setdefault(
"useGlobal",
False)
577 PFTauFlowElementLinkerAlgorithmFactory=CompFactory.PFTauFlowElementAssoc
579 algName =
"PFTauFlowElementAssoc"
581 PFTauFlowElementLinkerAlgorithm=PFTauFlowElementLinkerAlgorithmFactory(algName)
588 if kwargs[
'neutral_FE_cont_name']:
589 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer = kwargs[
'neutral_FE_cont_name']
591 if kwargs[
'charged_FE_cont_name']:
592 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer = kwargs[
'charged_FE_cont_name']
595 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer=
"TrackCaloClustersNeutral"
596 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer=
"TrackCaloClustersCharged"
598 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey=
"neutralTCCLinks"
599 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey=
"chargedTCCLinks"
601 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey=
"TCC_TauLinks"
602 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey=
"TCC_TauLinks"
605 if kwargs[
'useGlobal']:
606 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer=
"GlobalNeutralParticleFlowObjects"
607 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer=
"GlobalChargedParticleFlowObjects"
609 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey=
"neutralGlobalFELinks"
610 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey=
"chargedGlobalFELinks"
612 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey=
"GlobalFE_TauLinks"
613 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey=
"GlobalFE_TauLinks"
615 return PFTauFlowElementLinkerAlgorithm
618 result=ComponentAccumulator()
620 PFAlgorithm=CompFactory.PFAlgorithm
623 if inputFlags.HeavyIon.Egamma.doSubtractedClusters:
624 PFAlgorithm.PFClusterSelectorTool =
getPFClusterSelectorTool(inputFlags,inputFlags.HeavyIon.Egamma.UncalibCaloTopoCluster,inputFlags.HeavyIon.Egamma.CaloTopoCluster,
"PFClusterSelectorTool")
626 topoClustersName=
"CaloTopoClusters"
627 PFAlgorithm.PFClusterSelectorTool =
getPFClusterSelectorTool(inputFlags,topoClustersName,
"CaloCalTopoClusters",
"PFClusterSelectorTool")
629 if inputFlags.PF.useUnified:
630 PFAlgorithm.useUnified =
True
633 if not inputFlags.PF.EOverPMode
and not inputFlags.PF.useTruthCheating:
638 PFAlgorithm.UnifiedBaseTools += [PFUnifiedMomentCalculatorTools]
639 PFAlgorithm.UnifiedBaseTools += [
getPFLCCalibTool(inputFlags, use_unified =
True)]
640 if inputFlags.PF.EOverPMode:
641 PFAlgorithm.UnifiedBaseTools += [CompFactory.PFUnifiedRadialEnergyCalculatorTool()]
646 if not inputFlags.PF.EOverPMode
and not inputFlags.PF.useTruthCheating:
650 PFAlgorithm.BaseToolList = [PFMomentCalculatorTools]
652 if inputFlags.PF.EOverPMode:
653 PFAlgorithm.BaseToolList += [CompFactory.PFRadialEnergyCalculatorTool()]
655 result.addEventAlgo(PFAlgorithm)
661 result=ComponentAccumulator()
663 kwargs.setdefault(
"useGlobal",
True)
getEGamFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
getPFUnifiedRecoverSplitShowersMatchingTool(inputFlags, toolName)
getTauFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
getPFRecoverSplitShowersTool(inputFlags, toolName)
getPFCellLevelSubtractionTool(inputFlags, toolName)
PFTrackSelectorAlgCfg(inputFlags, algName, useCaching=True)
getOfflinePFAlgorithm(inputFlags, **kwargs)
getPFTrackClusterMatchingTool(inputFlags, matchCut, distanceType, clusterPositionType, name)
getPFUnifiedRecoverSplitShowersSubtractionOnlyTool(inputFlags, toolName)
getLCNeutralFlowElementCreatorAlgorithm(inputFlags, neutralFlowElementOutputName)
getPFOClusterMLCorrectionAlgorithmCfg(inputFlags, inputNameBase="JetETMiss", outputNameBase="JetETMissClusterMLCorrected")
getPFClusterSelectorTool(inputFlags, clustersin, calclustersin, algName)
getMuonFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
getPFUnifiedCellLevelSubtractionOnlyTool(inputFlags, toolName)
getPFLCCalibTool(inputFlags, use_unified=False)
getNeutralFlowElementCreatorAlgorithm(inputFlags, neutralFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
getPFMomentCalculatorTool(inputFlags, momentsToCalculateList, use_unified=False)
PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs)
getChargedFlowElementCreatorAlgorithm(inputFlags, chargedFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
getNeutralPFOClusterMLCorrectionToolCfg(inputFlags, toolName="NeutralPFOClusterMLCorrectionTool", **kwargs)
getPFUnifiedCellLevelMatchingTool(inputFlags, toolName)