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)
 getPFUnifiedCellLevelMatchingTool (inputFlags, toolName)
 getPFUnifiedCellLevelSubtractionOnlyTool (inputFlags, toolName)
 getPFUnifiedRecoverSplitShowersMatchingTool (inputFlags, toolName)
 getPFUnifiedRecoverSplitShowersSubtractionOnlyTool (inputFlags, toolName)
 getPFUnifiedMomentCalculatorTool (inputFlags, momentsToCalculateList=None)
 getPFUnifiedLCCalibTool (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, **kwargs)
 PFGlobalFlowElementLinkingCfg (inputFlags, **kwargs)

Function Documentation

◆ getChargedFlowElementCreatorAlgorithm()

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

Definition at line 230 of file PFCfg.py.

230def getChargedFlowElementCreatorAlgorithm(inputFlags,chargedFlowElementOutputName,nameSuffix="",eflowCaloObjectContainerName="eflowCaloObjects"):
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
241
242 return FlowElementChargedCreatorAlgorithm
243
if(pathvar)

◆ getEGamFlowElementAssocAlgorithm()

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

Definition at line 294 of file PFCfg.py.

294def getEGamFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
295
296 kwargs.setdefault("neutral_FE_cont_name", "")
297 kwargs.setdefault("charged_FE_cont_name", "")
298 kwargs.setdefault("doTCC", False)
299 kwargs.setdefault("useGlobal", False)
300
301 PFEGamFlowElementLinkerAlgorithmFactory=CompFactory.PFEGamFlowElementAssoc
302 if not algName:
303 algName = "PFEGamFlowElementAssoc"
304 PFEGamFlowElementLinkerAlgorithm=PFEGamFlowElementLinkerAlgorithmFactory(algName)
305
306 #set an an alternate name if needed
307 #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
308 #for a key of type SG::WriteDecorHandle<xAOD::SomeCont>someKey{this,"SpecificContainerName","myContainerName","other-labels"}
309 #setting algorithm.SpecificContainerName="myNewContainerName" changes parameter "myContainerName"
310 #(also applies to ReadHandles)
311 if kwargs['neutral_FE_cont_name']:
312 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
313
314 if kwargs['charged_FE_cont_name']:
315 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
316
317 if kwargs['doTCC']:
318 # ReadHandles to change
319 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="TrackCaloClustersNeutral"
320 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="TrackCaloClustersCharged"
321
322 #Now to change the writeHandles
323 # first the Electron -> FE links
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")
328 #then the converse case (FE -> Electron)
329
330 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey="TCC_ElectronLinks"
331 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey="TCC_ElectronLinks"
332
333
334 # first the Photon -> FE links
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")
339 #then the converse case (FE -> Photons)
340
341 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey="TCC_PhotonLinks"
342 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey="TCC_PhotonLinks"
343
344 if kwargs['useGlobal']:
345 # ReadHandles to change
346 PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
347 PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
348
349 #Now to change the writeHandles
350 # first the Electron -> FE links
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")
355 #then the converse case (FE -> Electron)
356
357 PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey="GlobalFE_ElectronLinks"
358 PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey="GlobalFE_ElectronLinks"
359
360
361 # first the Photon -> FE links
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")
366 #then the converse case (FE -> Photons)
367
368 PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey="TCC_PhotonLinks"
369 PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey="TCC_PhotonLinks"
370
371
372
373 return PFEGamFlowElementLinkerAlgorithm
374

◆ getLCNeutralFlowElementCreatorAlgorithm()

getLCNeutralFlowElementCreatorAlgorithm ( inputFlags,
neutralFlowElementOutputName )

Definition at line 259 of file PFCfg.py.

259def getLCNeutralFlowElementCreatorAlgorithm(inputFlags,neutralFlowElementOutputName):
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"
267
268 return LCFlowElementNeutralCreatorAlgorithm
269
270# Factory function to create the ML-based neutral flow element creator algorithm

◆ getMuonFlowElementAssocAlgorithm()

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

Definition at line 375 of file PFCfg.py.

375def getMuonFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
376
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)
382
383 useMuonTopoClusters = False
384 from AthenaConfiguration.Enums import ProductionStep
385 # set 'useMuonTopoClusters=True' if running on AOD, as do not have calorimeter cells for CaloCalTopoCluster
386 # Assumes that in production workflows this only happens in "Derivation" or if DQ environment is AOD
387 if inputFlags.Common.ProductionStep in [ProductionStep.Derivation] or inputFlags.DQ.Environment == "AOD":
388 useMuonTopoClusters = True
389
390
391 PFMuonFlowElementLinkerAlgorithmFactory=CompFactory.PFMuonFlowElementAssoc
392 if not algName:
393 algName="PFMuonFlowElementAssoc"
394 PFMuonFlowElementLinkerAlgorithm=PFMuonFlowElementLinkerAlgorithmFactory(algName)
395
396 #set an an alternate name if needed
397 #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
398 #for a key of type SG::WriteDecorHandle<xAOD::SomeCont>someKey{this,"SpecificContainerName","myContainerName","other-labels"}
399 #setting algorithm.SpecificContainerName="myNewContainerName" changes parameter "myContainerName" to "myNewContainerName"
400 if kwargs['neutral_FE_cont_name']:
401 #update the readhandle
402 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
403 #update the write handle for the link
404
405 if kwargs['charged_FE_cont_name']:
406 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
407
408 PFMuonFlowElementLinkerAlgorithm.LinkNeutralFEClusters = kwargs['LinkNeutralFEClusters']
409 PFMuonFlowElementLinkerAlgorithm.useMuonTopoClusters = useMuonTopoClusters
410
411 #prototype on AOD with the linkers already defined - so need to rename the output links to something besides their default name.
412
413 #Track Calo cluster (TCC) specific configuration. Input is differently named FE container, and in the AOD step specifically
414 if kwargs['doTCC']:
415 #input containers are TrackCaloClustersCharged and TrackCaloClustersNeutral, so rename them
416 #service_key="StoreGateSvc+"
417 service_key=""
418 PFMuonFlowElementLinkerAlgorithm.MuonContainer=service_key+"Muons"
419 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=service_key+"TrackCaloClustersCharged"
420 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=service_key+"TrackCaloClustersNeutral"
421
422 #Output
423 #rename the FE_MuonLinks as TCC_MuonLinks
424 #rename output containers
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"
430 # several variables relating to Neutral Flow Elements/TCCs to Muons for debug. perhaps at some point these should be removed by default
431 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="TCC_nMatchedMuons"
432 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="TCC_efrac_matched_muon"
433
434 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="muon_efrac_matched_TCC"
435 # this is because the algorithm adds this debug container which we don't need
436 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="deltaR_muon_clus_TCCalg"
437
438 if kwargs['useGlobal']:
439 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
440 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
441
442 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks="chargedGlobalFELinks"
443 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks="neutralGlobalFELinks"
444
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"
448
449 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="GlobalFE_nMatchedMuons"
450 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="GlobalFE_efrac_matched_muon"
451
452 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="muon_efrac_matched_GlobalFE"
453 # this is because the algorithm adds this debug container which we don't need
454 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="deltaR_muon_clus_GlobalFEalg"
455
456 if kwargs['LinkNeutralFEClusters'] and not useMuonTopoClusters:
457 # We dereference links to cells, so make sure we have the
458 # dependency.
459 PFMuonFlowElementLinkerAlgorithm.ExtraInputs.add(('CaloCellContainer', inputFlags.Egamma.Keys.Input.CaloCells))
460
461 if kwargs['LinkNeutralFEClusters']:
462 if kwargs['doTCC']:
463 # 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.
464 # This is a known bug to rectify soon
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")
469 exit(0)
470
471
472 return PFMuonFlowElementLinkerAlgorithm
473

◆ getNeutralFlowElementCreatorAlgorithm()

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

Definition at line 244 of file PFCfg.py.

244def getNeutralFlowElementCreatorAlgorithm(inputFlags,neutralFlowElementOutputName,nameSuffix="",eflowCaloObjectContainerName="eflowCaloObjects"):
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
256
257 return FlowElementNeutralCreatorAlgorithm
258

◆ getNeutralPFOClusterMLCorrectionToolCfg()

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

Definition at line 281 of file PFCfg.py.

281def getNeutralPFOClusterMLCorrectionToolCfg(inputFlags, toolName="NeutralPFOClusterMLCorrectionTool", **kwargs):
282 if toolName == "NeutralPFOClusterMLCorrectionTool":
283 tool = CompFactory.NeutralPFOClusterMLCorrectionTool(toolName, **kwargs)
284 else:
285 raise ValueError(f"Unknown tool name: {toolName}")
286
287 ca = ComponentAccumulator()
288 ca.setPrivateTools(tool)
289 return ca
290
291
292
293

◆ getOfflinePFAlgorithm()

getOfflinePFAlgorithm ( inputFlags,
** kwargs )

Definition at line 521 of file PFCfg.py.

521def getOfflinePFAlgorithm(inputFlags, **kwargs):
522 result=ComponentAccumulator()
523
524 PFAlgorithm=CompFactory.PFAlgorithm
525 PFAlgorithm = PFAlgorithm("PFAlgorithm")
526
527 if inputFlags.HeavyIon.Egamma.doSubtractedClusters:
528 PFAlgorithm.PFClusterSelectorTool = getPFClusterSelectorTool(inputFlags,inputFlags.HeavyIon.Egamma.UncalibCaloTopoCluster,inputFlags.HeavyIon.Egamma.CaloTopoCluster,"PFClusterSelectorTool")
529 else:
530 topoClustersName="CaloTopoClusters"
531 PFAlgorithm.PFClusterSelectorTool = getPFClusterSelectorTool(inputFlags,topoClustersName,"CaloCalTopoClusters","PFClusterSelectorTool")
532
533 PFAlgorithm.useUnified = True
534 PFAlgorithm.UnifiedBaseTools = [getPFUnifiedCellLevelMatchingTool(inputFlags, "PFUnifiedCellLevelMatchingTool")]
535 PFAlgorithm.UnifiedBaseTools += [getPFUnifiedCellLevelSubtractionOnlyTool(inputFlags, "PFUnifiedCellLevelSubtractionOnlyTool")]
536 if not inputFlags.PF.EOverPMode and not inputFlags.PF.useTruthCheating:
537 PFAlgorithm.UnifiedBaseTools += [getPFUnifiedRecoverSplitShowersMatchingTool(inputFlags, "PFUnifiedRecoverSplitShowersMatchingTool")]
538 PFAlgorithm.UnifiedBaseTools += [getPFUnifiedRecoverSplitShowersSubtractionOnlyTool(inputFlags, "PFUnifiedRecoverSplitShowersSubtractionOnlyTool")]
539
540 PFUnifiedMomentCalculatorTools=result.popToolsAndMerge(getPFUnifiedMomentCalculatorTool(inputFlags))
541 PFAlgorithm.UnifiedBaseTools += [PFUnifiedMomentCalculatorTools]
542 PFAlgorithm.UnifiedBaseTools += [getPFUnifiedLCCalibTool(inputFlags)]
543 if inputFlags.PF.EOverPMode:
544 PFAlgorithm.UnifiedBaseTools += [CompFactory.PFUnifiedRadialEnergyCalculatorTool()]
545
546 result.addEventAlgo(PFAlgorithm)
547 return result
548
549
550

◆ getPFClusterSelectorTool()

getPFClusterSelectorTool ( inputFlags,
clustersin,
calclustersin,
algName )

Definition at line 49 of file PFCfg.py.

49def getPFClusterSelectorTool(inputFlags,clustersin,calclustersin,algName):
50
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
57
58 if inputFlags.PF.useTruthCheating:
59 if inputFlags.PF.useTrackClusterTruthMatching:
60 PFClusterSelectorTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles = "CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
61
62 if inputFlags.PF.useTopoTowers:
63 PFClusterSelectorTool.clustersName="CaloTopoSignal"
64 PFClusterSelectorTool.calClustersName="CaloCalTopoSignal"
65
66 return PFClusterSelectorTool
67

◆ getPFOClusterMLCorrectionAlgorithmCfg()

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

Definition at line 271 of file PFCfg.py.

271def getPFOClusterMLCorrectionAlgorithmCfg(inputFlags, inputNameBase = "JetETMiss", outputNameBase = "JetETMissClusterMLCorrected"):
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
278
279 return alg
280

◆ getPFTrackClusterMatchingTool()

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

Definition at line 68 of file PFCfg.py.

68def getPFTrackClusterMatchingTool(inputFlags,matchCut,distanceType,clusterPositionType,name):
69 PFTrackClusterMatchingTool = CompFactory.PFTrackClusterMatchingTool
70 MatchingTool = PFTrackClusterMatchingTool(name)
71 MatchingTool.ClusterPositionType = clusterPositionType
72 MatchingTool.DistanceType = distanceType
73 MatchingTool.MatchCut = matchCut*matchCut
74 return MatchingTool
75
76
This is the tool, which inherits from AthAlgTool, which clients can use for track-cluster matching.

◆ getPFUnifiedCellLevelMatchingTool()

getPFUnifiedCellLevelMatchingTool ( inputFlags,
toolName )

Definition at line 77 of file PFCfg.py.

77def getPFUnifiedCellLevelMatchingTool(inputFlags,toolName):
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
82 else:
83 PFUnifiedCellLevelMatchingToolFactory = CompFactory.PFUnifiedMatchingTool
84 PFUnifiedCellLevelMatchingTool = PFUnifiedCellLevelMatchingToolFactory(toolName)
85
86 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
87 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
88 PFUnifiedCellLevelMatchingTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss()
89 else:
90 PFCellEOverPTool = CompFactory.PFCellEOverPTool
91 PFUnifiedCellLevelMatchingTool.eflowCellEOverPTool = PFCellEOverPTool("PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
92 #this should always be false for any reference derived, except eflowCellEOverPTool_mc12_HLLHC.h or eflowCellEOverPTool_Run2_mc20_JetETMiss.h
93 PFUnifiedCellLevelMatchingTool.useLegacyEBinIndex=False
94
95 if(inputFlags.PF.EOverPMode):
96 PFUnifiedCellLevelMatchingTool.nClusterMatchesToUse = -1
97 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool = getPFTrackClusterMatchingTool(inputFlags,0.2,"EtaPhiSquareDistance","PlainEtaPhi","CalObjBldMatchingTool")
98 else:
99 PFUnifiedCellLevelMatchingTool.nClusterMatchesToUse = 1
100 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool = getPFTrackClusterMatchingTool(inputFlags,1.64,"EtaPhiSquareSignificance","GeomCenterEtaPhi","CalObjBldMatchingTool")
101
102 PFUnifiedCellLevelMatchingTool.PFTrackClusterMatchingTool_02 = getPFTrackClusterMatchingTool(inputFlags,0.2,"EtaPhiSquareDistance","PlainEtaPhi","MatchingTool_Pull_02")
103
104 PFUnifiedCellLevelMatchingTool.addCPData = inputFlags.PF.addCPData
105
106 return PFUnifiedCellLevelMatchingTool
107
108
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 ...

◆ getPFUnifiedCellLevelSubtractionOnlyTool()

getPFUnifiedCellLevelSubtractionOnlyTool ( inputFlags,
toolName )

Definition at line 109 of file PFCfg.py.

109def getPFUnifiedCellLevelSubtractionOnlyTool(inputFlags,toolName):
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")
114 else:
115 PFUnifiedCellLevelSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTool
116 PFUnifiedCellLevelSubtractionOnlyTool = PFUnifiedCellLevelSubtractionOnlyToolFactory(toolName, useNNEnergy = inputFlags.PF.useMLEOverP)
117
118 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
119 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
120 PFUnifiedCellLevelSubtractionOnlyTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss()
121 else:
122 PFCellEOverPTool = CompFactory.PFCellEOverPTool
123 PFUnifiedCellLevelSubtractionOnlyTool.eflowCellEOverPTool = PFCellEOverPTool("PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
124 #this should always be false for any reference derived, except eflowCellEOverPTool_mc12_HLLHC.h or eflowCellEOverPTool_Run2_mc20_JetETMiss.h
125 PFUnifiedCellLevelSubtractionOnlyTool.useLegacyEBinIndex=False
126
127 if(inputFlags.PF.EOverPMode):
128 PFUnifiedCellLevelSubtractionOnlyTool.CalcEOverP = True
129
130 PFUnifiedCellLevelSubtractionOnlyTool.addCPData = inputFlags.PF.addCPData
131
132 if inputFlags.PF.useMLEOverP:
133 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool("PFCellLevelEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
134 PFUnifiedCellLevelSubtractionOnlyTool.NNEnergyPredictorTool = PFEnergyPredictorTool
135
136
137 return PFUnifiedCellLevelSubtractionOnlyTool
138
139
140
141

◆ getPFUnifiedLCCalibTool()

getPFUnifiedLCCalibTool ( inputFlags)

Definition at line 212 of file PFCfg.py.

212def getPFUnifiedLCCalibTool(inputFlags):
213
214 PFLCCalibTool = CompFactory.PFUnifiedLCCalibTool("PFLCCalibTool")
215
216 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
217 PFLCCalibTool.eflowRecClusterCollectionTool = PFClusterCollectionTool("PFClusterCollectionTool_LCCalib")
218 PFLCCalibTool.UseLocalWeight = False
219
220 from CaloRec.CaloTopoClusterConfig import getTopoClusterLocalCalibTools
221 lcCalibToolList = getTopoClusterLocalCalibTools(inputFlags)
222
223 PFLCCalibTool.CaloClusterLocalCalib=lcCalibToolList[0]
224 PFLCCalibTool.CaloClusterLocalCalibOOCC=lcCalibToolList[1]
225 PFLCCalibTool.CaloClusterLocalCalibOOCCPi0=lcCalibToolList[2]
226 PFLCCalibTool.CaloClusterLocalCalibDM=lcCalibToolList[3]
227
228 return PFLCCalibTool
229
Inherits from IPFClusterCollectionTool and AthAlgTool.

◆ getPFUnifiedMomentCalculatorTool()

getPFUnifiedMomentCalculatorTool ( inputFlags,
momentsToCalculateList = None )

Definition at line 188 of file PFCfg.py.

188def getPFUnifiedMomentCalculatorTool(inputFlags, momentsToCalculateList = None):
189 result=ComponentAccumulator()
190 PFMomentCalculatorToolFactory = CompFactory.PFUnifiedMomentCalculatorTool
191
192 PFMomentCalculatorTool = PFMomentCalculatorToolFactory("PFMomentCalculatorTool")
193
194 from CaloRec.CaloTopoClusterConfig import getTopoMoments
195 PFClusterMomentsMaker = result.popToolsAndMerge(getTopoMoments(inputFlags))
196 #the offline configuration takes the default moment list, the HLT passes its own
197 if momentsToCalculateList:
198 PFClusterMomentsMaker.MomentsNames = momentsToCalculateList
199 PFMomentCalculatorTool.CaloClusterMomentsMaker = PFClusterMomentsMaker
200
201 PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
202 PFMomentCalculatorTool.PFClusterCollectionTool = PFClusterCollectionTool("PFClusterCollectionTool")
203
204 if(inputFlags.PF.useCalibHitTruthClusterMoments):
205 PFMomentCalculatorTool.UseCalibHitTruth=True
206 from CaloRec.CaloTopoClusterConfig import getTopoCalibMoments
207 PFMomentCalculatorTool.CaloCalibClusterMomentsMaker2 = getTopoCalibMoments(inputFlags)
208
209 result.setPrivateTools(PFMomentCalculatorTool)
210 return result
211

◆ getPFUnifiedRecoverSplitShowersMatchingTool()

getPFUnifiedRecoverSplitShowersMatchingTool ( inputFlags,
toolName )

Definition at line 142 of file PFCfg.py.

142def getPFUnifiedRecoverSplitShowersMatchingTool(inputFlags,toolName):
143 # RecoverSplitShowers is gated off when useTruthCheating is set (see getOfflinePFAlgorithm),
144 # so the truth-matching variant of this factory is unreachable by construction.
145 PFUnifiedRecoverSplitShowersMatchingToolFactory = CompFactory.PFUnifiedMatchingTool
146 PFUnifiedRecoverSplitShowersMatchingTool = PFUnifiedRecoverSplitShowersMatchingToolFactory(toolName)
147
148 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
149 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
150 PFUnifiedRecoverSplitShowersMatchingTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss("eflowCellEOverPTool_Run2_mc20_JetETMiss_Recover")
151 else:
152 PFCellEOverPTool = CompFactory.PFCellEOverPTool
153 PFUnifiedRecoverSplitShowersMatchingTool.eflowCellEOverPTool = PFCellEOverPTool("PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
154 #this should always be false for any reference derived, except eflowCellEOverPTool_mc12_HLLHC.h or eflowCellEOverPTool_Run2_mc20_JetETMiss.h
155 PFUnifiedRecoverSplitShowersMatchingTool.useLegacyEBinIndex=False
156
157 PFUnifiedRecoverSplitShowersMatchingTool.RecoverSplitShowers = True
158
159 return PFUnifiedRecoverSplitShowersMatchingTool
160
161
162

◆ getPFUnifiedRecoverSplitShowersSubtractionOnlyTool()

getPFUnifiedRecoverSplitShowersSubtractionOnlyTool ( inputFlags,
toolName )

Definition at line 163 of file PFCfg.py.

163def getPFUnifiedRecoverSplitShowersSubtractionOnlyTool(inputFlags,toolName):
164 # RecoverSplitShowers is gated off when useTruthCheating is set (see getOfflinePFAlgorithm),
165 # so the truth-cheating variant of this factory is unreachable by construction.
166 PFUnifiedRecoverSplitShowersSubtractionOnlyToolFactory = CompFactory.PFUnifiedSubtractionOnlyTool
167 PFUnifiedRecoverSplitShowersSubtractionOnlyTool = PFUnifiedRecoverSplitShowersSubtractionOnlyToolFactory(toolName, useNNEnergy = inputFlags.PF.useMLEOverP)
168
169 if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
170 eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
171 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss("eflowCellEOverPTool_Run2_mc20_JetETMiss_Recover")
172 else:
173 PFCellEOverPTool = CompFactory.PFCellEOverPTool
174 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.eflowCellEOverPTool = PFCellEOverPTool("PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
175 #this should always be false for any reference derived, except eflowCellEOverPTool_mc12_HLLHC.h or eflowCellEOverPTool_Run2_mc20_JetETMiss.h
176 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.useLegacyEBinIndex=False
177
178 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.RecoverSplitShowers = True
179
180 if inputFlags.PF.useMLEOverP:
181 PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool("PFRecoverSplitShowersEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
182 PFUnifiedRecoverSplitShowersSubtractionOnlyTool.NNEnergyPredictorTool = PFEnergyPredictorTool
183
184 return PFUnifiedRecoverSplitShowersSubtractionOnlyTool
185
186
187

◆ getTauFlowElementAssocAlgorithm()

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

Definition at line 474 of file PFCfg.py.

474def getTauFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
475
476 kwargs.setdefault("neutral_FE_cont_name", "")
477 kwargs.setdefault("charged_FE_cont_name", "")
478 kwargs.setdefault("doTCC", False)
479 kwargs.setdefault("useGlobal", False)
480
481 PFTauFlowElementLinkerAlgorithmFactory=CompFactory.PFTauFlowElementAssoc
482 if not algName:
483 algName = "PFTauFlowElementAssoc"
484
485 PFTauFlowElementLinkerAlgorithm=PFTauFlowElementLinkerAlgorithmFactory(algName)
486
487 #set an an alternate name if needed
488 #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
489 #for a key of type SG::WriteDecorHandle<xAOD::SomeCont>someKey{this,"SpecificContainerName","myContainerName","other-labels"}
490 #setting algorithm.SpecificContainerName="myNewContainerName" changes parameter "myContainerName"
491 #(also applies to ReadHandles)
492 if kwargs['neutral_FE_cont_name']:
493 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
494
495 if kwargs['charged_FE_cont_name']:
496 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
497
498 if kwargs['doTCC']:
499 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer="TrackCaloClustersNeutral"
500 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer="TrackCaloClustersCharged"
501
502 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey="neutralTCCLinks"
503 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey="chargedTCCLinks"
504
505 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey="TCC_TauLinks"
506 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey="TCC_TauLinks"
507
508 #This allows to set the links on the global particle flow containers created by JetPFlowSelectionAlg in JetRecTools
509 if kwargs['useGlobal']:
510 PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
511 PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
512
513 PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey="neutralGlobalFELinks"
514 PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey="chargedGlobalFELinks"
515
516 PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey="GlobalFE_TauLinks"
517 PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey="GlobalFE_TauLinks"
518
519 return PFTauFlowElementLinkerAlgorithm
520

◆ PFGlobalFlowElementLinkingCfg()

PFGlobalFlowElementLinkingCfg ( inputFlags,
** kwargs )

Definition at line 551 of file PFCfg.py.

551def PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs):
552 result=ComponentAccumulator()
553
554 kwargs.setdefault("useGlobal", True)
555
556 result.addEventAlgo(getTauFlowElementAssocAlgorithm(inputFlags, algName="PFTauGlobalFlowElementAssoc", **kwargs))
557 result.addEventAlgo(getMuonFlowElementAssocAlgorithm(inputFlags, algName="PFMuonGlobalFlowElementAssoc", **kwargs))
558 result.addEventAlgo(getEGamFlowElementAssocAlgorithm(inputFlags, algName="PFEGamGlobalFlowElementAssoc", **kwargs))
559 return result

◆ PFTrackSelectorAlgCfg()

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 if inputFlags.PF.useActsExtrapolation:
13 PFTrackCaloExtensionTool=CompFactory.PFTrackCaloExtensionTool
14 TrackCaloExtensionTool=PFTrackCaloExtensionTool("PFTrackCaloExtensionTool_ACTS")
15 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
16 else:
17
18 from TrackToCalo.TrackToCaloConfig import ParticleCaloExtensionToolCfg
19 pcExtensionTool = result.popToolsAndMerge(ParticleCaloExtensionToolCfg(inputFlags))
20
21 eflowTrackCaloExtensionTool=CompFactory.eflowTrackCaloExtensionTool
22 TrackCaloExtensionTool=eflowTrackCaloExtensionTool(TrackCaloExtensionTool=pcExtensionTool)
23 if (not useCaching):
24 TrackCaloExtensionTool.PFParticleCache = ""
25
26 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
27
28 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
29 PFTrackSelectionToolCfg)
30 PFTrackSelector.trackSelectionTool = result.popToolsAndMerge(PFTrackSelectionToolCfg(inputFlags))
31
32 # P->T conversion extra dependencies
33 if inputFlags.Detector.GeometryITk:
34 PFTrackSelector.ExtraInputs = {
35 ("InDetDD::SiDetectorElementCollection", "ConditionStore+ITkPixelDetectorElementCollection"),
36 ("InDetDD::SiDetectorElementCollection", "ConditionStore+ITkStripDetectorElementCollection"),
37 }
38 else:
39 PFTrackSelector.ExtraInputs = {
40 ("InDetDD::SiDetectorElementCollection", "ConditionStore+PixelDetectorElementCollection"),
41 ("InDetDD::SiDetectorElementCollection", "ConditionStore+SCT_DetectorElementCollection"),
42 ("InDetDD::TRT_DetElementContainer", "ConditionStore+TRT_DetElementContainer"),
43 }
44
45 result.addEventAlgo (PFTrackSelector, primary=True)
46
47 return result
48
Inherits from eflowTrackExtrapolatorBaseAlgTool and AthAlgTool.
Inherits from eflowTrackExtrapolatorBaseAlgTool and AthAlgTool.