ATLAS Offline Software
Loading...
Searching...
No Matches
PFCfg Namespace Reference

Functions

 PFTrackSelectorAlgCfg (inputFlags, algName, useCaching=True)
 getPFClusterSelectorTool (inputFlags, clustersin, calclustersin, algName)
 getPFTrackClusterMatchingTool (inputFlags, matchCut, distanceType, clusterPositionType, name)
 getPFCellLevelSubtractionTool (inputFlags, toolName)
 getPFRecoverSplitShowersTool (inputFlags, toolName)
 getPFMomentCalculatorTool (inputFlags, momentsToCalculateList)
 getPFLCCalibTool (inputFlags)
 getChargedFlowElementCreatorAlgorithm (inputFlags, chargedFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
 getNeutralFlowElementCreatorAlgorithm (inputFlags, neutralFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
 getLCNeutralFlowElementCreatorAlgorithm (inputFlags, neutralFlowElementOutputName)
 getPFOClusterMLCorrectionAlgorithmCfg (inputFlags, inputNameBase="JetETMiss", outputNameBase="JetETMissClusterMLCorrected")
 getNeutralPFOClusterMLCorrectionToolCfg (inputFlags, toolName="NeutralPFOClusterMLCorrectionTool", **kwargs)
 getEGamFlowElementAssocAlgorithm (inputFlags, algName="", **kwargs)
 getMuonFlowElementAssocAlgorithm (inputFlags, algName="", **kwargs)
 getTauFlowElementAssocAlgorithm (inputFlags, algName="", **kwargs)
 getOfflinePFAlgorithm (inputFlags)
 PFGlobalFlowElementLinkingCfg (inputFlags, **kwargs)

Function Documentation

◆ getChargedFlowElementCreatorAlgorithm()

PFCfg.getChargedFlowElementCreatorAlgorithm ( inputFlags,
chargedFlowElementOutputName,
nameSuffix = "",
eflowCaloObjectContainerName = "eflowCaloObjects" )

Definition at line 183 of file PFCfg.py.

183def getChargedFlowElementCreatorAlgorithm(inputFlags,chargedFlowElementOutputName,nameSuffix="",eflowCaloObjectContainerName="eflowCaloObjects"):
184 FlowElementChargedCreatorAlgorithmFactory = CompFactory.PFChargedFlowElementCreatorAlgorithm
185 FlowElementChargedCreatorAlgorithm = FlowElementChargedCreatorAlgorithmFactory("PFChargedFlowElementCreatorAlgorithm"+nameSuffix)
186 FlowElementChargedCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
187 if chargedFlowElementOutputName:
188 FlowElementChargedCreatorAlgorithm.FlowElementOutputName=chargedFlowElementOutputName
189 if(inputFlags.PF.EOverPMode):
190 FlowElementChargedCreatorAlgorithm.FlowElementOutputName="EOverPChargedParticleFlowObjects"
191 FlowElementChargedCreatorAlgorithm.EOverPMode = True
192 if inputFlags.PF.addCPData:
193 FlowElementChargedCreatorAlgorithm.addCPData = True
194
195 return FlowElementChargedCreatorAlgorithm
196
if(pathvar)

◆ getEGamFlowElementAssocAlgorithm()

PFCfg.getEGamFlowElementAssocAlgorithm ( inputFlags,
algName = "",
** kwargs )

Definition at line 246 of file PFCfg.py.

246def getEGamFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
247
248 kwargs.setdefault("neutral_FE_cont_name", "")
249 kwargs.setdefault("charged_FE_cont_name", "")
250 kwargs.setdefault("doTCC", False)
251 kwargs.setdefault("useGlobal", False)
252
253 PFEGamFlowElementLinkerAlgorithmFactory=CompFactory.PFEGamFlowElementAssoc
254 if not algName:
255 algName = "PFEGamFlowElementAssoc"
256 PFEGamFlowElementLinkerAlgorithm=PFEGamFlowElementLinkerAlgorithmFactory(algName)
257
258 #set an an alternate name if needed
259 #this uses some gaudi core magic, namely that you can change the name of the handle as it is a callable attribute, despite the attribute not being explicitly listed in the header
260 #for a key of type SG::WriteDecorHandle<xAOD::SomeCont>someKey{this,"SpecificContainerName","myContainerName","other-labels"}
261 #setting algorithm.SpecificContainerName="myNewContainerName" changes parameter "myContainerName"
262 #(also applies to ReadHandles)
263 if kwargs['neutral_FE_cont_name']:
264 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
265
266 if kwargs['charged_FE_cont_name']:
267 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
268
269 if kwargs['doTCC']:
270 # ReadHandles to change
271 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="TrackCaloClustersNeutral"
272 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="TrackCaloClustersCharged"
273
274 #Now to change the writeHandles
275 # first the Electron -> FE links
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")
280 #then the converse case (FE -> Electron)
281
282 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey="TCC_ElectronLinks"
283 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey="TCC_ElectronLinks"
284
285
286 # first the Photon -> FE links
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")
291 #then the converse case (FE -> Photons)
292
293 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey="TCC_PhotonLinks"
294 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey="TCC_PhotonLinks"
295
296 if kwargs['useGlobal']:
297 # ReadHandles to change
298 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
299 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
300
301 #Now to change the writeHandles
302 # first the Electron -> FE links
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")
307 #then the converse case (FE -> Electron)
308
309 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey="GlobalFE_ElectronLinks"
310 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey="GlobalFE_ElectronLinks"
311
312
313 # first the Photon -> FE links
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")
318 #then the converse case (FE -> Photons)
319
320 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey="TCC_PhotonLinks"
321 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey="TCC_PhotonLinks"
322
323
324
325 return PFEGamFlowElementLinkerAlgorithm
326

◆ getLCNeutralFlowElementCreatorAlgorithm()

PFCfg.getLCNeutralFlowElementCreatorAlgorithm ( inputFlags,
neutralFlowElementOutputName )

Definition at line 212 of file PFCfg.py.

212def getLCNeutralFlowElementCreatorAlgorithm(inputFlags,neutralFlowElementOutputName):
213 LCFlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFLCNeutralFlowElementCreatorAlgorithm
214 LCFlowElementNeutralCreatorAlgorithm = LCFlowElementNeutralCreatorAlgorithmFactory("PFLCNeutralFlowElementCreatorAlgorithm")
215 if neutralFlowElementOutputName:
216 LCFlowElementNeutralCreatorAlgorithm.FELCOutputName=neutralFlowElementOutputName
217 if(inputFlags.PF.EOverPMode):
218 LCFlowElementNeutralCreatorAlgorithm.FEInputContainerName="EOverPNeutralParticleFlowObjects"
219 LCFlowElementNeutralCreatorAlgorithm.FELCOutputName="EOverPLCNeutralParticleFlowObjects"
220
221 return LCFlowElementNeutralCreatorAlgorithm
222
223# Factory function to create the ML-based neutral flow element creator algorithm

◆ getMuonFlowElementAssocAlgorithm()

PFCfg.getMuonFlowElementAssocAlgorithm ( inputFlags,
algName = "",
** kwargs )

Definition at line 327 of file PFCfg.py.

327def getMuonFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
328
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)
334
335 useMuonTopoClusters = False
336 from AthenaConfiguration.Enums import ProductionStep
337 # set 'useMuonTopoClusters=True' if running on AOD, as do not have calorimeter cells for CaloCalTopoCluster
338 # Assumes that in production workflows this only happens in "Derivation" or if DQ environment is AOD
339 if inputFlags.Common.ProductionStep in [ProductionStep.Derivation] or inputFlags.DQ.Environment == "AOD":
340 useMuonTopoClusters = True
341
342
343 PFMuonFlowElementLinkerAlgorithmFactory=CompFactory.PFMuonFlowElementAssoc
344 if not algName:
345 algName="PFMuonFlowElementAssoc"
346 PFMuonFlowElementLinkerAlgorithm=PFMuonFlowElementLinkerAlgorithmFactory(algName)
347
348 #set an an alternate name if needed
349 #this uses some gaudi core magic, namely that you can change the name of the handle as it is a callable attribute, despite the attribute not being explicitly listed in the header as such
350 #for a key of type SG::WriteDecorHandle<xAOD::SomeCont>someKey{this,"SpecificContainerName","myContainerName","other-labels"}
351 #setting algorithm.SpecificContainerName="myNewContainerName" changes parameter "myContainerName" to "myNewContainerName"
352 if kwargs['neutral_FE_cont_name']:
353 #update the readhandle
354 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
355 #update the write handle for the link
356
357 if kwargs['charged_FE_cont_name']:
358 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
359
360 PFMuonFlowElementLinkerAlgorithm.LinkNeutralFEClusters = kwargs['LinkNeutralFEClusters']
361 PFMuonFlowElementLinkerAlgorithm.useMuonTopoClusters = useMuonTopoClusters
362
363 #prototype on AOD with the linkers already defined - so need to rename the output links to something besides their default name.
364
365 #Track Calo cluster (TCC) specific configuration. Input is differently named FE container, and in the AOD step specifically
366 if kwargs['doTCC']:
367 #input containers are TrackCaloClustersCharged and TrackCaloClustersNeutral, so rename them
368 #service_key="StoreGateSvc+"
369 service_key=""
370 PFMuonFlowElementLinkerAlgorithm.MuonContainer=service_key+"Muons"
371 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=service_key+"TrackCaloClustersCharged"
372 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=service_key+"TrackCaloClustersNeutral"
373
374 #Output
375 #rename the FE_MuonLinks as TCC_MuonLinks
376 #rename output containers
377 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks="chargedTCCLinks"
378 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks="neutralTCCLinks"
379 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks="TCC_MuonLinks"
380 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks="TCC_MuonLinks"
381 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon="TCC_efrac_matched_muon"
382 # several variables relating to Neutral Flow Elements/TCCs to Muons for debug. perhaps at some point these should be removed by default
383 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="TCC_nMatchedMuons"
384 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="TCC_efrac_matched_muon"
385
386 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="muon_efrac_matched_TCC"
387 # this is because the algorithm adds this debug container which we don't need
388 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="deltaR_muon_clus_TCCalg"
389
390 if kwargs['useGlobal']:
391 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
392 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
393
394 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks="chargedGlobalFELinks"
395 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks="neutralGlobalFELinks"
396
397 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks="GlobalFE_MuonLinks"
398 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks="GlobalFE_MuonLinks"
399 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon="GlobalFE_efrac_matched_muon"
400
401 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="GlobalFE_nMatchedMuons"
402 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="GlobalFE_efrac_matched_muon"
403
404 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="muon_efrac_matched_GlobalFE"
405 # this is because the algorithm adds this debug container which we don't need
406 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="deltaR_muon_clus_GlobalFEalg"
407
408 if kwargs['LinkNeutralFEClusters'] and not useMuonTopoClusters:
409 # We dereference links to cells, so make sure we have the
410 # dependency.
411 PFMuonFlowElementLinkerAlgorithm.ExtraInputs.add(('CaloCellContainer', inputFlags.Egamma.Keys.Input.CaloCells))
412
413 if kwargs['LinkNeutralFEClusters']:
414 if kwargs['doTCC']:
415 # since the cells are deleted on AOD, if you try to run the link between NFE and Muon on AOD, it will crash. Terminate to catch this.
416 # This is a known bug to rectify soon
417 from AthenaCommon.Logging import logging
418 msg=logging.getLogger("PFCfg.py::getMuonFlowElementAssocAlgorithm")
419 msg.error("Neutral FE from AOD configured to be linked with Muon. This link will fail due to missing CaloCells in the AOD")
420 msg.info("Terminating job")
421 exit(0)
422
423
424 return PFMuonFlowElementLinkerAlgorithm
425

◆ getNeutralFlowElementCreatorAlgorithm()

PFCfg.getNeutralFlowElementCreatorAlgorithm ( inputFlags,
neutralFlowElementOutputName,
nameSuffix = "",
eflowCaloObjectContainerName = "eflowCaloObjects" )

Definition at line 197 of file PFCfg.py.

197def getNeutralFlowElementCreatorAlgorithm(inputFlags,neutralFlowElementOutputName,nameSuffix="",eflowCaloObjectContainerName="eflowCaloObjects"):
198 FlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFNeutralFlowElementCreatorAlgorithm
199 FlowElementNeutralCreatorAlgorithm = FlowElementNeutralCreatorAlgorithmFactory("PFNeutralFlowElementCreatorAlgorithm"+nameSuffix)
200 FlowElementNeutralCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
201 if neutralFlowElementOutputName:
202 FlowElementNeutralCreatorAlgorithm.FlowElementOutputName=neutralFlowElementOutputName
203 if(inputFlags.PF.EOverPMode):
204 FlowElementNeutralCreatorAlgorithm.FlowElementOutputName="EOverPNeutralParticleFlowObjects"
205 if(inputFlags.PF.useCalibHitTruthClusterMoments and inputFlags.PF.addClusterMoments):
206 FlowElementNeutralCreatorAlgorithm.UseCalibHitTruth=True
207 if inputFlags.PF.addCPData:
208 FlowElementNeutralCreatorAlgorithm.addCPData = True
209
210 return FlowElementNeutralCreatorAlgorithm
211

◆ getNeutralPFOClusterMLCorrectionToolCfg()

PFCfg.getNeutralPFOClusterMLCorrectionToolCfg ( inputFlags,
toolName = "NeutralPFOClusterMLCorrectionTool",
** kwargs )

Definition at line 234 of file PFCfg.py.

234def getNeutralPFOClusterMLCorrectionToolCfg(inputFlags, toolName="NeutralPFOClusterMLCorrectionTool", **kwargs):
235 if toolName == "NeutralPFOClusterMLCorrectionTool":
236 tool = CompFactory.NeutralPFOClusterMLCorrectionTool(toolName, **kwargs)
237 else:
238 raise ValueError(f"Unknown tool name: {toolName}")
239
240 ca = ComponentAccumulator()
241 ca.setPrivateTools(tool)
242 return ca
243
244
245

◆ getOfflinePFAlgorithm()

PFCfg.getOfflinePFAlgorithm ( inputFlags)

Definition at line 473 of file PFCfg.py.

473def getOfflinePFAlgorithm(inputFlags):
474 result=ComponentAccumulator()
475
476 PFAlgorithm=CompFactory.PFAlgorithm
477 PFAlgorithm = PFAlgorithm("PFAlgorithm")
478
479
480 if inputFlags.HeavyIon.Egamma.doSubtractedClusters:
481 PFAlgorithm.PFClusterSelectorTool = getPFClusterSelectorTool(inputFlags,inputFlags.HeavyIon.Egamma.UncalibCaloTopoCluster,inputFlags.HeavyIon.Egamma.CaloTopoCluster,"PFClusterSelectorTool")
482 else:
483 topoClustersName="CaloTopoClusters"
484 PFAlgorithm.PFClusterSelectorTool = getPFClusterSelectorTool(inputFlags,topoClustersName,"CaloCalTopoClusters","PFClusterSelectorTool")
485
486 PFAlgorithm.SubtractionToolList = [getPFCellLevelSubtractionTool(inputFlags,"PFCellLevelSubtractionTool")]
487
488 if(False is inputFlags.PF.EOverPMode and False is inputFlags.PF.useTruthCheating):
489 PFAlgorithm.SubtractionToolList += [getPFRecoverSplitShowersTool(inputFlags,"PFRecoverSplitShowersTool")]
490
491 PFMomentCalculatorTools=result.popToolsAndMerge(getPFMomentCalculatorTool(inputFlags,[]))
492 PFAlgorithm.BaseToolList = [PFMomentCalculatorTools]
493 PFAlgorithm.BaseToolList += [getPFLCCalibTool(inputFlags)]
494 if inputFlags.PF.EOverPMode:
495 PFAlgorithm.BaseToolList += [CompFactory.PFRadialEnergyCalculatorTool()]
496
497 result.addEventAlgo(PFAlgorithm)
498 return result
499

◆ getPFCellLevelSubtractionTool()

PFCfg.getPFCellLevelSubtractionTool ( inputFlags,
toolName )

Definition at line 71 of file PFCfg.py.

71def getPFCellLevelSubtractionTool(inputFlags,toolName):
72 PFCellLevelSubtractionToolFactory = CompFactory.PFSubtractionTool
73 PFCellLevelSubtractionTool = PFCellLevelSubtractionToolFactory(toolName,useNNEnergy = inputFlags.PF.useMLEOverP)
74
75 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
76 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
77 PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss()
78 else:
79 if inputFlags.PF.useLegacyEOverPRun4:
80 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
81 PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
82 else:
83 PFCellEOverPTool = CompFactory.PFCellEOverPTool
84 PFCellLevelSubtractionTool.eflowCellEOverPTool = PFCellEOverPTool("PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
85 #this should always be false for any reference derived, except eflowCellEOverPTool_mc12_HLLHC.h or eflowCellEOverPTool_Run2_mc20_JetETMiss.h
86 PFCellLevelSubtractionTool.useLegacyEBinIndex=False
87
88 if(inputFlags.PF.EOverPMode):
89 PFCellLevelSubtractionTool.CalcEOverP = True
90 PFCellLevelSubtractionTool.nClusterMatchesToUse = -1
91 else:
92 PFCellLevelSubtractionTool.nClusterMatchesToUse = 1
93
94 if(inputFlags.PF.EOverPMode):
95 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool = getPFTrackClusterMatchingTool(inputFlags,0.2,"EtaPhiSquareDistance","PlainEtaPhi","CalObjBldMatchingTool")
96 else:
97 PFCellLevelSubtractionTool.PFTrackClusterMatchingTool = getPFTrackClusterMatchingTool(inputFlags,1.64,"EtaPhiSquareSignificance","GeomCenterEtaPhi","CalObjBldMatchingTool")
98
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")
101
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
106
107 if inputFlags.PF.useTruthCheating:
108 if inputFlags.PF.useTrackClusterTruthMatching:
109 PFCellLevelSubtractionTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles = "CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
110 PFCellLevelSubtractionTool.useTrackClusterTruthMatching=True
111
112 if inputFlags.PF.useTruthForChargedShowerSubtraction:
113 PFCellLevelSubtractionTool.useTruthForChargedShowerSubtraction = True
114 PFCellLevelSubtractionTool.PFSimulateTruthShowerTool = CompFactory.PFSimulateTruthShowerTool("PFSimulateTruthShowerTool")
115
116 return PFCellLevelSubtractionTool
117
Class to store reference e/p mean and widths, as well as reference energy density radial profile fit ...
Class to store reference e/p mean and widths, as well as reference energy density radial profile fit ...

◆ getPFClusterSelectorTool()

PFCfg.getPFClusterSelectorTool ( inputFlags,
clustersin,
calclustersin,
algName )

Definition at line 43 of file PFCfg.py.

43def getPFClusterSelectorTool(inputFlags,clustersin,calclustersin,algName):
44
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
51
52 if inputFlags.PF.useTruthCheating:
53 if inputFlags.PF.useTrackClusterTruthMatching:
54 PFClusterSelectorTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles = "CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
55
56 if inputFlags.PF.useTopoTowers:
57 PFClusterSelectorTool.clustersName="CaloTopoSignal"
58 PFClusterSelectorTool.calClustersName="CaloCalTopoSignal"
59
60 return PFClusterSelectorTool
61

◆ getPFLCCalibTool()

PFCfg.getPFLCCalibTool ( inputFlags)

Definition at line 165 of file PFCfg.py.

165def getPFLCCalibTool(inputFlags):
166 PFLCCalibTool = CompFactory.PFLCCalibTool
167 PFLCCalibTool = PFLCCalibTool("PFLCCalibTool")
168
169 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
170 PFLCCalibTool.eflowRecClusterCollectionTool = PFClusterCollectionTool("PFClusterCollectionTool_LCCalib")
171 PFLCCalibTool.UseLocalWeight = False
172
173 from CaloRec.CaloTopoClusterConfig import getTopoClusterLocalCalibTools
174 lcCalibToolList = getTopoClusterLocalCalibTools(inputFlags)
175
176 PFLCCalibTool.CaloClusterLocalCalib=lcCalibToolList[0]
177 PFLCCalibTool.CaloClusterLocalCalibOOCC=lcCalibToolList[1]
178 PFLCCalibTool.CaloClusterLocalCalibOOCCPi0=lcCalibToolList[2]
179 PFLCCalibTool.CaloClusterLocalCalibDM=lcCalibToolList[3]
180
181 return PFLCCalibTool
182
Inherits from IPFClusterCollectionTool and AthAlgTool.
This tool can either use a series of CaloClusterProcessor to calibrate the modified xAOD::CaloCluster...

◆ getPFMomentCalculatorTool()

PFCfg.getPFMomentCalculatorTool ( inputFlags,
momentsToCalculateList )

Definition at line 143 of file PFCfg.py.

143def getPFMomentCalculatorTool(inputFlags, momentsToCalculateList):
144 result=ComponentAccumulator()
145 PFMomentCalculatorToolFactory = CompFactory.PFMomentCalculatorTool
146 PFMomentCalculatorTool = PFMomentCalculatorToolFactory("PFMomentCalculatorTool")
147
148 from CaloRec.CaloTopoClusterConfig import getTopoMoments
149 PFClusterMomentsMaker = result.popToolsAndMerge(getTopoMoments(inputFlags))
150 if (len(momentsToCalculateList) > 0):
151 PFClusterMomentsMaker.MomentsNames = momentsToCalculateList
152 PFMomentCalculatorTool.CaloClusterMomentsMaker = PFClusterMomentsMaker
153
154 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
155 PFMomentCalculatorTool.PFClusterCollectionTool = PFClusterCollectionTool("PFClusterCollectionTool")
156
157 if(inputFlags.PF.useCalibHitTruthClusterMoments):
158 PFMomentCalculatorTool.UseCalibHitTruth=True
159 from CaloRec.CaloTopoClusterConfig import getTopoCalibMoments
160 PFMomentCalculatorTool.CaloCalibClusterMomentsMaker2 = getTopoCalibMoments(inputFlags)
161
162 result.setPrivateTools(PFMomentCalculatorTool)
163 return result
164

◆ getPFOClusterMLCorrectionAlgorithmCfg()

PFCfg.getPFOClusterMLCorrectionAlgorithmCfg ( inputFlags,
inputNameBase = "JetETMiss",
outputNameBase = "JetETMissClusterMLCorrected" )

Definition at line 224 of file PFCfg.py.

224def getPFOClusterMLCorrectionAlgorithmCfg(inputFlags, inputNameBase = "JetETMiss", outputNameBase = "JetETMissClusterMLCorrected"):
225 alg = CompFactory.PFOClusterMLCorrectionAlgorithm("PFOClusterMLCorrectionAlgorithm")
226 suffix = "ParticleFlowObjects"
227 alg.NeutralPFlowInputContainer = inputNameBase + "Neutral" + suffix
228 alg.ChargedPFlowInputContainer = inputNameBase + "Charged" + suffix
229 alg.NeutralPFlowOutputContainer = outputNameBase + "Neutral" + suffix
230 alg.ChargedPFlowOutputContainer = outputNameBase + "Charged" + suffix
231
232 return alg
233

◆ getPFRecoverSplitShowersTool()

PFCfg.getPFRecoverSplitShowersTool ( inputFlags,
toolName )

Definition at line 118 of file PFCfg.py.

118def getPFRecoverSplitShowersTool(inputFlags,toolName):
119 PFRecoverSplitShowersToolFactory = CompFactory.PFSubtractionTool
120 PFRecoverSplitShowersTool = PFRecoverSplitShowersToolFactory(toolName,useNNEnergy = inputFlags.PF.useMLEOverP)
121
122 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
123 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
124 PFRecoverSplitShowersTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss("eflowCellEOverPTool_Run2_mc20_JetETMiss_Recover")
125 else:
126 if inputFlags.PF.useLegacyEOverPRun4:
127 eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
128 PFRecoverSplitShowersTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
129 else:
130 PFCellEOverPTool = CompFactory.PFCellEOverPTool
131 PFRecoverSplitShowersTool.eflowCellEOverPTool = PFCellEOverPTool("PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
132 #this should always be false for any reference derived, except eflowCellEOverPTool_mc12_HLLHC.h or eflowCellEOverPTool_Run2_mc20_JetETMiss.h
133 PFRecoverSplitShowersTool.useLegacyEBinIndex=False
134
135 PFRecoverSplitShowersTool.RecoverSplitShowers = True
136
137 if inputFlags.PF.useMLEOverP:
138 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool("PFRecoverSplitShowersEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
139 PFRecoverSplitShowersTool.NNEnergyPredictorTool = PFEnergyPredictorTool
140
141 return PFRecoverSplitShowersTool
142

◆ getPFTrackClusterMatchingTool()

PFCfg.getPFTrackClusterMatchingTool ( inputFlags,
matchCut,
distanceType,
clusterPositionType,
name )

Definition at line 62 of file PFCfg.py.

62def getPFTrackClusterMatchingTool(inputFlags,matchCut,distanceType,clusterPositionType,name):
63 PFTrackClusterMatchingTool = CompFactory.PFTrackClusterMatchingTool
64 MatchingTool = PFTrackClusterMatchingTool(name)
65 MatchingTool.ClusterPositionType = clusterPositionType
66 MatchingTool.DistanceType = distanceType
67 MatchingTool.MatchCut = matchCut*matchCut
68 return MatchingTool
69
70
This is the tool, which inherits from AthAlgTool, which clients can use for track-cluster matching.

◆ getTauFlowElementAssocAlgorithm()

PFCfg.getTauFlowElementAssocAlgorithm ( inputFlags,
algName = "",
** kwargs )

Definition at line 426 of file PFCfg.py.

426def getTauFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
427
428 kwargs.setdefault("neutral_FE_cont_name", "")
429 kwargs.setdefault("charged_FE_cont_name", "")
430 kwargs.setdefault("doTCC", False)
431 kwargs.setdefault("useGlobal", False)
432
433 PFTauFlowElementLinkerAlgorithmFactory=CompFactory.PFTauFlowElementAssoc
434 if not algName:
435 algName = "PFTauFlowElementAssoc"
436
437 PFTauFlowElementLinkerAlgorithm=PFTauFlowElementLinkerAlgorithmFactory(algName)
438
439 #set an an alternate name if needed
440 #this uses some gaudi core magic, namely that you can change the name of the handle as it is a callable attribute, despite the attribute not being explicitly listed in the header
441 #for a key of type SG::WriteDecorHandle<xAOD::SomeCont>someKey{this,"SpecificContainerName","myContainerName","other-labels"}
442 #setting algorithm.SpecificContainerName="myNewContainerName" changes parameter "myContainerName"
443 #(also applies to ReadHandles)
444 if kwargs['neutral_FE_cont_name']:
445 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
446
447 if kwargs['charged_FE_cont_name']:
448 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
449
450 if kwargs['doTCC']:
451 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer="TrackCaloClustersNeutral"
452 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer="TrackCaloClustersCharged"
453
454 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey="neutralTCCLinks"
455 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey="chargedTCCLinks"
456
457 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey="TCC_TauLinks"
458 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey="TCC_TauLinks"
459
460 #This allows to set the links on the global particle flow containers created by JetPFlowSelectionAlg in JetRecTools
461 if kwargs['useGlobal']:
462 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
463 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
464
465 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey="neutralGlobalFELinks"
466 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey="chargedGlobalFELinks"
467
468 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey="GlobalFE_TauLinks"
469 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey="GlobalFE_TauLinks"
470
471 return PFTauFlowElementLinkerAlgorithm
472

◆ PFGlobalFlowElementLinkingCfg()

PFCfg.PFGlobalFlowElementLinkingCfg ( inputFlags,
** kwargs )

Definition at line 500 of file PFCfg.py.

500def PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs):
501 result=ComponentAccumulator()
502
503 kwargs.setdefault("useGlobal", True)
504
505 result.addEventAlgo(getTauFlowElementAssocAlgorithm(inputFlags, algName="PFTauGlobalFlowElementAssoc", **kwargs))
506 result.addEventAlgo(getMuonFlowElementAssocAlgorithm(inputFlags, algName="PFMuonGlobalFlowElementAssoc", **kwargs))
507 result.addEventAlgo(getEGamFlowElementAssocAlgorithm(inputFlags, algName="PFEGamGlobalFlowElementAssoc", **kwargs))
508 return result

◆ PFTrackSelectorAlgCfg()

PFCfg.PFTrackSelectorAlgCfg ( inputFlags,
algName,
useCaching = True )

Definition at line 6 of file PFCfg.py.

6def PFTrackSelectorAlgCfg(inputFlags,algName,useCaching=True):
7 PFTrackSelectorFactory=CompFactory.PFTrackSelector
8 PFTrackSelector=PFTrackSelectorFactory(algName)
9
10 result = ComponentAccumulator()
11
12 from TrackToCalo.TrackToCaloConfig import ParticleCaloExtensionToolCfg
13 pcExtensionTool = result.popToolsAndMerge(ParticleCaloExtensionToolCfg(inputFlags))
14
15 eflowTrackCaloExtensionTool=CompFactory.eflowTrackCaloExtensionTool
16 TrackCaloExtensionTool=eflowTrackCaloExtensionTool(TrackCaloExtensionTool=pcExtensionTool)
17 if (not useCaching):
18 TrackCaloExtensionTool.PFParticleCache = ""
19
20 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
21
22 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
23 PFTrackSelectionToolCfg)
24 PFTrackSelector.trackSelectionTool = result.popToolsAndMerge(PFTrackSelectionToolCfg(inputFlags))
25
26 # P->T conversion extra dependencies
27 if inputFlags.Detector.GeometryITk:
28 PFTrackSelector.ExtraInputs = {
29 ("InDetDD::SiDetectorElementCollection", "ConditionStore+ITkPixelDetectorElementCollection"),
30 ("InDetDD::SiDetectorElementCollection", "ConditionStore+ITkStripDetectorElementCollection"),
31 }
32 else:
33 PFTrackSelector.ExtraInputs = {
34 ("InDetDD::SiDetectorElementCollection", "ConditionStore+PixelDetectorElementCollection"),
35 ("InDetDD::SiDetectorElementCollection", "ConditionStore+SCT_DetectorElementCollection"),
36 ("InDetDD::TRT_DetElementContainer", "ConditionStore+TRT_DetElementContainer"),
37 }
38
39 result.addEventAlgo (PFTrackSelector, primary=True)
40
41 return result
42
Inherits from eflowTrackExtrapolatorBaseAlgTool and AthAlgTool.