ATLAS Offline Software
Functions
PFCfg Namespace Reference

Functions

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

Function Documentation

◆ getChargedFlowElementCreatorAlgorithm()

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

Definition at line 182 of file PFCfg.py.

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

◆ getEGamFlowElementAssocAlgorithm()

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

Definition at line 246 of file PFCfg.py.

246 def 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="TrackCaloClustersCharged.TCC_ElectronLinks"
283  PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey="TrackCaloClustersNeutral.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="TrackCaloClustersCharged.TCC_PhotonLinks"
294  PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey="TrackCaloClustersNeutral.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="GlobalChargedParticleFlowObjects.GlobalFE_ElectronLinks"
310  PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey="GlobalNeutralParticleFlowObjects.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="GlobalChargedParticleFlowObjects.TCC_PhotonLinks"
321  PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey="GlobalNeutralParticleFlowObjects.TCC_PhotonLinks"
322 
323 
324 
325  return PFEGamFlowElementLinkerAlgorithm
326 

◆ getLCNeutralFlowElementCreatorAlgorithm()

def PFCfg.getLCNeutralFlowElementCreatorAlgorithm (   inputFlags,
  neutralFlowElementOutputName 
)

Definition at line 211 of file PFCfg.py.

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

◆ getMuonFlowElementAssocAlgorithm()

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

Definition at line 327 of file PFCfg.py.

327 def 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.JetEtMissChargedFlowElementContainer=service_key+"TrackCaloClustersCharged"
371  PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=service_key+"TrackCaloClustersNeutral"
372 
373  #Output
374  #rename the FE_MuonLinks as TCC_MuonLinks
375  #rename output containers
376  PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks=service_key+"Muons.chargedTCCLinks"
377  PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks=service_key+"Muons.neutralTCCLinks"
378  PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks=service_key+"TrackCaloClustersNeutral.TCC_MuonLinks"
379  PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks=service_key+"TrackCaloClustersCharged.TCC_MuonLinks"
380  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon="TrackCaloClustersCharged.TCC_efrac_matched_muon"
381  # several variables relating to Neutral Flow Elements/TCCs to Muons for debug. perhaps at some point these should be removed by default
382  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="TrackCaloClustersNeutral.TCC_nMatchedMuons"
383  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="TrackCaloClustersNeutral.TCC_efrac_matched_muon"
384 
385  PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="Muons.muon_efrac_matched_TCC"
386  # this is because the algorithm adds this debug container which we don't need
387  PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="Muons.deltaR_muon_clus_TCCalg"
388 
389  if kwargs['useGlobal']:
390  PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
391  PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
392 
393  PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks="Muons.chargedGlobalFELinks"
394  PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks="Muons.neutralGlobalFELinks"
395 
396  PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks="GlobalNeutralParticleFlowObjects.GlobalFE_MuonLinks"
397  PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks="GlobalChargedParticleFlowObjects.GlobalFE_MuonLinks"
398  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon="GlobalChargedParticleFlowObjects.GlobalFE_efrac_matched_muon"
399 
400  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="GlobalNeutralParticleFlowObjects.GlobalFE_nMatchedMuons"
401  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="GlobalNeutralParticleFlowObjects.GlobalFE_efrac_matched_muon"
402 
403  PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="Muons.muon_efrac_matched_GlobalFE"
404  # this is because the algorithm adds this debug container which we don't need
405  PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="Muons.deltaR_muon_clus_GlobalFEalg"
406 
407  if kwargs['LinkNeutralFEClusters'] and not useMuonTopoClusters:
408  # We dereference links to cells, so make sure we have the
409  # dependency.
410  PFMuonFlowElementLinkerAlgorithm.ExtraInputs.add(('CaloCellContainer', inputFlags.Egamma.Keys.Input.CaloCells))
411 
412  if kwargs['LinkNeutralFEClusters']:
413  if kwargs['doTCC']:
414  # 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.
415  # This is a known bug to rectify soon
416  from AthenaCommon.Logging import logging
417  msg=logging.getLogger("PFCfg.py::getMuonFlowElementAssocAlgorithm")
418  msg.error("Neutral FE from AOD configured to be linked with Muon. This link will fail due to missing CaloCells in the AOD")
419  msg.info("Terminating job")
420  exit(0)
421 
422 
423  return PFMuonFlowElementLinkerAlgorithm
424 

◆ getNeutralFlowElementCreatorAlgorithm()

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

Definition at line 196 of file PFCfg.py.

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

◆ getNeutralPFOClusterMLCorrectionToolCfg()

def PFCfg.getNeutralPFOClusterMLCorrectionToolCfg (   inputFlags,
  toolName = "NeutralPFOClusterMLCorrectionTool",
  clusterMLCorrectedEnergyDecorationKey = "clusterE_ML" 
)

Definition at line 233 of file PFCfg.py.

233 def getNeutralPFOClusterMLCorrectionToolCfg(inputFlags, toolName="NeutralPFOClusterMLCorrectionTool", clusterMLCorrectedEnergyDecorationKey="clusterE_ML"):
234  if toolName == "NeutralPFOClusterMLCorrectionTool":
235  tool = CompFactory.NeutralPFOClusterMLCorrectionTool(toolName)
236  tool.ClusterMLCorrectedEnergyDecorationKey = clusterMLCorrectedEnergyDecorationKey
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()

def PFCfg.getOfflinePFAlgorithm (   inputFlags)

Definition at line 472 of file PFCfg.py.

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

◆ getPFCellLevelSubtractionTool()

def PFCfg.getPFCellLevelSubtractionTool (   inputFlags,
  toolName 
)

Definition at line 70 of file PFCfg.py.

70 def getPFCellLevelSubtractionTool(inputFlags,toolName):
71  PFCellLevelSubtractionToolFactory = CompFactory.PFSubtractionTool
72  PFCellLevelSubtractionTool = PFCellLevelSubtractionToolFactory(toolName,useNNEnergy = inputFlags.PF.useMLEOverP)
73 
74  if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
75  eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
76  PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss()
77  else:
78  if inputFlags.PF.useLegacyEOverPRun4:
79  eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
80  PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
81  else:
82  PFCellEOverPTool = CompFactory.PFCellEOverPTool
83  PFCellLevelSubtractionTool.eflowCellEOverPTool = PFCellEOverPTool("PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
84  #this should always be false for any reference derived, except eflowCellEOverPTool_mc12_HLLHC.h or eflowCellEOverPTool_Run2_mc20_JetETMiss.h
85  PFCellLevelSubtractionTool.useLegacyEBinIndex=False
86 
87  if(inputFlags.PF.EOverPMode):
88  PFCellLevelSubtractionTool.CalcEOverP = True
89  PFCellLevelSubtractionTool.nClusterMatchesToUse = -1
90  else:
91  PFCellLevelSubtractionTool.nClusterMatchesToUse = 1
92 
93  if(inputFlags.PF.EOverPMode):
94  PFCellLevelSubtractionTool.PFTrackClusterMatchingTool = getPFTrackClusterMatchingTool(inputFlags,0.2,"EtaPhiSquareDistance","PlainEtaPhi","CalObjBldMatchingTool")
95  else:
96  PFCellLevelSubtractionTool.PFTrackClusterMatchingTool = getPFTrackClusterMatchingTool(inputFlags,1.64,"EtaPhiSquareSignificance","GeomCenterEtaPhi","CalObjBldMatchingTool")
97 
98  PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_015 = getPFTrackClusterMatchingTool(inputFlags,0.15,"EtaPhiSquareDistance","PlainEtaPhi","MatchingTool_Pull_015")
99  PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_02 = getPFTrackClusterMatchingTool(inputFlags,0.2,"EtaPhiSquareDistance","PlainEtaPhi","MatchingTool_Pull_02")
100 
101  if inputFlags.PF.useMLEOverP:
102  PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool("PFCellLevelEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
103  PFCellLevelSubtractionTool.NNEnergyPredictorTool = PFEnergyPredictorTool
104  PFCellLevelSubtractionTool.addCPData = inputFlags.PF.addCPData
105 
106  if inputFlags.PF.useTruthCheating:
107  if inputFlags.PF.useTrackClusterTruthMatching:
108  PFCellLevelSubtractionTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles = "CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
109  PFCellLevelSubtractionTool.useTrackClusterTruthMatching=True
110 
111  if inputFlags.PF.useTruthForChargedShowerSubtraction:
112  PFCellLevelSubtractionTool.useTruthForChargedShowerSubtraction = True
113  PFCellLevelSubtractionTool.PFSimulateTruthShowerTool = CompFactory.PFSimulateTruthShowerTool("PFSimulateTruthShowerTool")
114 
115  return PFCellLevelSubtractionTool
116 

◆ getPFClusterSelectorTool()

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

Definition at line 42 of file PFCfg.py.

42 def getPFClusterSelectorTool(inputFlags,clustersin,calclustersin,algName):
43 
44  PFClusterSelectorToolFactory = CompFactory.PFClusterSelectorTool
45  PFClusterSelectorTool = PFClusterSelectorToolFactory(algName)
46  if clustersin is not None:
47  PFClusterSelectorTool.clustersName = clustersin
48  if calclustersin is not None:
49  PFClusterSelectorTool.calClustersName = calclustersin
50 
51  if inputFlags.PF.useTruthCheating:
52  if inputFlags.PF.useTrackClusterTruthMatching:
53  PFClusterSelectorTool.CaloClusterReadDecorHandleKey_NLeadingTruthParticles = "CaloTopoClusters." + inputFlags.Calo.TopoCluster.CalibrationHitDecorationName
54 
55  if inputFlags.PF.useTopoTowers:
56  PFClusterSelectorTool.clustersName="CaloTopoSignal"
57  PFClusterSelectorTool.calClustersName="CaloCalTopoSignal"
58 
59  return PFClusterSelectorTool
60 

◆ getPFLCCalibTool()

def PFCfg.getPFLCCalibTool (   inputFlags)

Definition at line 164 of file PFCfg.py.

164 def getPFLCCalibTool(inputFlags):
165  PFLCCalibTool = CompFactory.PFLCCalibTool
166  PFLCCalibTool = PFLCCalibTool("PFLCCalibTool")
167 
168  PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
169  PFLCCalibTool.eflowRecClusterCollectionTool = PFClusterCollectionTool("PFClusterCollectionTool_LCCalib")
170  PFLCCalibTool.UseLocalWeight = False
171 
172  from CaloRec.CaloTopoClusterConfig import getTopoClusterLocalCalibTools
173  lcCalibToolList = getTopoClusterLocalCalibTools(inputFlags)
174 
175  PFLCCalibTool.CaloClusterLocalCalib=lcCalibToolList[0]
176  PFLCCalibTool.CaloClusterLocalCalibOOCC=lcCalibToolList[1]
177  PFLCCalibTool.CaloClusterLocalCalibOOCCPi0=lcCalibToolList[2]
178  PFLCCalibTool.CaloClusterLocalCalibDM=lcCalibToolList[3]
179 
180  return PFLCCalibTool
181 

◆ getPFMomentCalculatorTool()

def PFCfg.getPFMomentCalculatorTool (   inputFlags,
  momentsToCalculateList 
)

Definition at line 142 of file PFCfg.py.

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

◆ getPFOClusterMLCorrectionAlgorithmCfg()

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

Definition at line 223 of file PFCfg.py.

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

◆ getPFRecoverSplitShowersTool()

def PFCfg.getPFRecoverSplitShowersTool (   inputFlags,
  toolName 
)

Definition at line 117 of file PFCfg.py.

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

◆ getPFTrackClusterMatchingTool()

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

Definition at line 61 of file PFCfg.py.

61 def getPFTrackClusterMatchingTool(inputFlags,matchCut,distanceType,clusterPositionType,name):
62  PFTrackClusterMatchingTool = CompFactory.PFTrackClusterMatchingTool
63  MatchingTool = PFTrackClusterMatchingTool(name)
64  MatchingTool.ClusterPositionType = clusterPositionType
65  MatchingTool.DistanceType = distanceType
66  MatchingTool.MatchCut = matchCut*matchCut
67  return MatchingTool
68 
69 

◆ getTauFlowElementAssocAlgorithm()

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

Definition at line 425 of file PFCfg.py.

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

◆ PFGlobalFlowElementLinkingCfg()

def PFCfg.PFGlobalFlowElementLinkingCfg (   inputFlags,
**  kwargs 
)

Definition at line 499 of file PFCfg.py.

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

◆ PFTrackSelectorAlgCfg()

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

Definition at line 6 of file PFCfg.py.

6 def 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 InDetConfig.InDetTrackSelectionToolConfig import PFTrackSelectionToolCfg
23  PFTrackSelector.trackSelectionTool = result.popToolsAndMerge(PFTrackSelectionToolCfg(inputFlags))
24 
25  # P->T conversion extra dependencies
26  if inputFlags.Detector.GeometryITk:
27  PFTrackSelector.ExtraInputs = {
28  ("InDetDD::SiDetectorElementCollection", "ConditionStore+ITkPixelDetectorElementCollection"),
29  ("InDetDD::SiDetectorElementCollection", "ConditionStore+ITkStripDetectorElementCollection"),
30  }
31  else:
32  PFTrackSelector.ExtraInputs = {
33  ("InDetDD::SiDetectorElementCollection", "ConditionStore+PixelDetectorElementCollection"),
34  ("InDetDD::SiDetectorElementCollection", "ConditionStore+SCT_DetectorElementCollection"),
35  ("InDetDD::TRT_DetElementContainer", "ConditionStore+TRT_DetElementContainer"),
36  }
37 
38  result.addEventAlgo (PFTrackSelector, primary=True)
39 
40  return result
41 
PFCfg.getOfflinePFAlgorithm
def getOfflinePFAlgorithm(inputFlags)
Definition: PFCfg.py:472
PFAlgorithm
Definition: PFAlgorithm.h:22
python.CaloTopoClusterConfig.getTopoClusterLocalCalibTools
def getTopoClusterLocalCalibTools(flags)
Definition: CaloTopoClusterConfig.py:29
PFCfg.getPFLCCalibTool
def getPFLCCalibTool(inputFlags)
Definition: PFCfg.py:164
python.InDetTrackSelectionToolConfig.PFTrackSelectionToolCfg
def PFTrackSelectionToolCfg(flags, name="PFTrackSelectionTool", **kwargs)
Definition: InDetTrackSelectionToolConfig.py:83
eflowTrackCaloExtensionTool
Inherits from eflowTrackExtrapolatorBaseAlgTool and AthAlgTool.
Definition: eflowTrackCaloExtensionTool.h:38
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:342
PFCfg.getPFClusterSelectorTool
def getPFClusterSelectorTool(inputFlags, clustersin, calclustersin, algName)
Definition: PFCfg.py:42
PFTrackClusterMatchingTool
This is the tool, which inherits from AthAlgTool, which clients can use for track-cluster matching.
Definition: PFTrackClusterMatchingTool.h:32
python.CaloTopoClusterConfig.getTopoCalibMoments
def getTopoCalibMoments(flags)
Definition: CaloTopoClusterConfig.py:200
PFLCCalibTool
This tool can either use a series of CaloClusterProcessor to calibrate the modified xAOD::CaloCluster...
Definition: PFLCCalibTool.h:22
PFCfg.getNeutralFlowElementCreatorAlgorithm
def getNeutralFlowElementCreatorAlgorithm(inputFlags, neutralFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
Definition: PFCfg.py:196
PFCfg.getNeutralPFOClusterMLCorrectionToolCfg
def getNeutralPFOClusterMLCorrectionToolCfg(inputFlags, toolName="NeutralPFOClusterMLCorrectionTool", clusterMLCorrectedEnergyDecorationKey="clusterE_ML")
Definition: PFCfg.py:233
PFCfg.getPFRecoverSplitShowersTool
def getPFRecoverSplitShowersTool(inputFlags, toolName)
Definition: PFCfg.py:117
PFClusterCollectionTool
Inherits from IPFClusterCollectionTool and AthAlgTool.
Definition: PFClusterCollectionTool.h:14
PFCellEOverPTool
Class to store reference e/p mean and widths, as well as reference energy density radial profile fit ...
Definition: PFCellEOverPTool.h:15
PFCfg.PFTrackSelectorAlgCfg
def PFTrackSelectorAlgCfg(inputFlags, algName, useCaching=True)
Definition: PFCfg.py:6
PFCfg.getPFMomentCalculatorTool
def getPFMomentCalculatorTool(inputFlags, momentsToCalculateList)
Definition: PFCfg.py:142
PFCfg.getPFOClusterMLCorrectionAlgorithmCfg
def getPFOClusterMLCorrectionAlgorithmCfg(inputFlags, inputNameBase="JetETMiss", outputNameBase="JetETMissClusterMLCorrected")
Definition: PFCfg.py:223
PFCfg.getChargedFlowElementCreatorAlgorithm
def getChargedFlowElementCreatorAlgorithm(inputFlags, chargedFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
Definition: PFCfg.py:182
PFCfg.getEGamFlowElementAssocAlgorithm
def getEGamFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
Definition: PFCfg.py:246
calibdata.exit
exit
Definition: calibdata.py:235
PFCfg.getMuonFlowElementAssocAlgorithm
def getMuonFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
Definition: PFCfg.py:327
PFCfg.getPFCellLevelSubtractionTool
def getPFCellLevelSubtractionTool(inputFlags, toolName)
Definition: PFCfg.py:70
PFCfg.getLCNeutralFlowElementCreatorAlgorithm
def getLCNeutralFlowElementCreatorAlgorithm(inputFlags, neutralFlowElementOutputName)
Definition: PFCfg.py:211
PFCfg.getTauFlowElementAssocAlgorithm
def getTauFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
Definition: PFCfg.py:425
python.CaloTopoClusterConfig.getTopoMoments
def getTopoMoments(flags)
Definition: CaloTopoClusterConfig.py:96
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
eflowCellEOverPTool_Run2_mc20_JetETMiss
Class to store reference e/p mean and widths, as well as reference energy density radial profile fit ...
Definition: eflowCellEOverPTool_Run2_mc20_JetETMiss.h:24
str
Definition: BTagTrackIpAccessor.cxx:11
PFCfg.getPFTrackClusterMatchingTool
def getPFTrackClusterMatchingTool(inputFlags, matchCut, distanceType, clusterPositionType, name)
Definition: PFCfg.py:61
TrackToCaloConfig.ParticleCaloExtensionToolCfg
def ParticleCaloExtensionToolCfg(flags, name='ParticleCaloExtensionTool', **kwargs)
Definition: TrackToCaloConfig.py:10
PFCfg.PFGlobalFlowElementLinkingCfg
def PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs)
Definition: PFCfg.py:499