ATLAS Offline Software
Functions
PFCfg Namespace Reference

Functions

def PFTrackSelectorAlgCfg (inputFlags, algName, useCaching=True)
 
def getPFClusterSelectorTool (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 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 165 of file PFCfg.py.

165 def getChargedFlowElementCreatorAlgorithm(inputFlags,chargedFlowElementOutputName,nameSuffix="",eflowCaloObjectContainerName="eflowCaloObjects"):
166  FlowElementChargedCreatorAlgorithmFactory = CompFactory.PFChargedFlowElementCreatorAlgorithm
167  FlowElementChargedCreatorAlgorithm = FlowElementChargedCreatorAlgorithmFactory("PFChargedFlowElementCreatorAlgorithm"+nameSuffix)
168  FlowElementChargedCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
169  if chargedFlowElementOutputName:
170  FlowElementChargedCreatorAlgorithm.FlowElementOutputName=chargedFlowElementOutputName
171  if(inputFlags.PF.EOverPMode):
172  FlowElementChargedCreatorAlgorithm.FlowElementOutputName="EOverPChargedParticleFlowObjects"
173  FlowElementChargedCreatorAlgorithm.EOverPMode = True
174  if inputFlags.PF.addCPData:
175  FlowElementChargedCreatorAlgorithm.addCPData = True
176 
177  return FlowElementChargedCreatorAlgorithm
178 

◆ getEGamFlowElementAssocAlgorithm()

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

Definition at line 205 of file PFCfg.py.

205 def getEGamFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
206 
207  kwargs.setdefault("neutral_FE_cont_name", "")
208  kwargs.setdefault("charged_FE_cont_name", "")
209  kwargs.setdefault("doTCC", False)
210  kwargs.setdefault("useGlobal", False)
211 
212  PFEGamFlowElementLinkerAlgorithmFactory=CompFactory.PFEGamFlowElementAssoc
213  if not algName:
214  algName = "PFEGamFlowElementAssoc"
215  PFEGamFlowElementLinkerAlgorithm=PFEGamFlowElementLinkerAlgorithmFactory(algName)
216 
217  #set an an alternate name if needed
218  #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
219  #for a key of type SG::WriteDecorHandle<xAOD::SomeCont>someKey{this,"SpecificContainerName","myContainerName","other-labels"}
220  #setting algorithm.SpecificContainerName="myNewContainerName" changes parameter "myContainerName"
221  #(also applies to ReadHandles)
222  if kwargs['neutral_FE_cont_name']:
223  PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
224 
225  if kwargs['charged_FE_cont_name']:
226  PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
227 
228  if kwargs['doTCC']:
229  # ReadHandles to change
230  PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="TrackCaloClustersNeutral"
231  PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="TrackCaloClustersCharged"
232 
233  #Now to change the writeHandles
234  # first the Electron -> FE links
235  EL_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey)
236  PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey=EL_NFE_Link.replace("FELinks","TCCLinks")
237  EL_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey)
238  PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey=EL_CFE_Link.replace("FELinks","TCCLinks")
239  #then the converse case (FE -> Electron)
240 
241  PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey="TrackCaloClustersCharged.TCC_ElectronLinks"
242  PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey="TrackCaloClustersNeutral.TCC_ElectronLinks"
243 
244 
245  # first the Photon -> FE links
246  PH_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey)
247  PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey=PH_NFE_Link.replace("FELinks","TCCLinks")
248  PH_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey)
249  PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey=PH_CFE_Link.replace("FELinks","TCCLinks")
250  #then the converse case (FE -> Photons)
251 
252  PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey="TrackCaloClustersCharged.TCC_PhotonLinks"
253  PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey="TrackCaloClustersNeutral.TCC_PhotonLinks"
254 
255  if kwargs['useGlobal']:
256  # ReadHandles to change
257  PFEGamFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
258  PFEGamFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
259 
260  #Now to change the writeHandles
261  # first the Electron -> FE links
262  EL_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey)
263  PFEGamFlowElementLinkerAlgorithm.ElectronNeutralFEDecorKey=EL_NFE_Link.replace("FELinks","GlobalFELinks")
264  EL_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey)
265  PFEGamFlowElementLinkerAlgorithm.ElectronChargedFEDecorKey=EL_CFE_Link.replace("FELinks","GlobalFELinks")
266  #then the converse case (FE -> Electron)
267 
268  PFEGamFlowElementLinkerAlgorithm.ChargedFEElectronDecorKey="GlobalChargedParticleFlowObjects.GlobalFE_ElectronLinks"
269  PFEGamFlowElementLinkerAlgorithm.NeutralFEElectronDecorKey="GlobalNeutralParticleFlowObjects.GLobalFE_ElectronLinks"
270 
271 
272  # first the Photon -> FE links
273  PH_NFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey)
274  PFEGamFlowElementLinkerAlgorithm.PhotonNeutralFEDecorKey=PH_NFE_Link.replace("FELinks","GlobalFELinks")
275  PH_CFE_Link=str(PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey)
276  PFEGamFlowElementLinkerAlgorithm.PhotonChargedFEDecorKey=PH_CFE_Link.replace("FELinks","GlobalFELinks")
277  #then the converse case (FE -> Photons)
278 
279  PFEGamFlowElementLinkerAlgorithm.ChargedFEPhotonDecorKey="GlobalChargedParticleFlowObjects.TCC_PhotonLinks"
280  PFEGamFlowElementLinkerAlgorithm.NeutralFEPhotonDecorKey="GlobalNeutralParticleFlowObjects.TCC_PhotonLinks"
281 
282 
283 
284  return PFEGamFlowElementLinkerAlgorithm
285 

◆ getLCNeutralFlowElementCreatorAlgorithm()

def PFCfg.getLCNeutralFlowElementCreatorAlgorithm (   inputFlags,
  neutralFlowElementOutputName 
)

Definition at line 194 of file PFCfg.py.

194 def getLCNeutralFlowElementCreatorAlgorithm(inputFlags,neutralFlowElementOutputName):
195  LCFlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFLCNeutralFlowElementCreatorAlgorithm
196  LCFlowElementNeutralCreatorAlgorithm = LCFlowElementNeutralCreatorAlgorithmFactory("PFLCNeutralFlowElementCreatorAlgorithm")
197  if neutralFlowElementOutputName:
198  LCFlowElementNeutralCreatorAlgorithm.FELCOutputName=neutralFlowElementOutputName
199  if(inputFlags.PF.EOverPMode):
200  LCFlowElementNeutralCreatorAlgorithm.FEInputContainerName="EOverPNeutralParticleFlowObjects"
201  LCFlowElementNeutralCreatorAlgorithm.FELCOutputName="EOverPLCNeutralParticleFlowObjects"
202 
203  return LCFlowElementNeutralCreatorAlgorithm
204 

◆ getMuonFlowElementAssocAlgorithm()

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

Definition at line 286 of file PFCfg.py.

286 def getMuonFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
287 
288  kwargs.setdefault("neutral_FE_cont_name", "")
289  kwargs.setdefault("charged_FE_cont_name", "")
290  kwargs.setdefault("LinkNeutralFEClusters", True)
291  kwargs.setdefault("doTCC", False)
292  kwargs.setdefault("useGlobal", False)
293 
294  useMuonTopoClusters = False
295  from AthenaConfiguration.Enums import ProductionStep
296  # set 'useMuonTopoClusters=True' if running on AOD, as do not have calorimeter cells for CaloCalTopoCluster
297  # Assumes that in production workflows this only happens in "Derivation" or if DQ environment is AOD
298  if inputFlags.Common.ProductionStep in [ProductionStep.Derivation] or inputFlags.DQ.Environment == "AOD":
299  useMuonTopoClusters = True
300 
301 
302  PFMuonFlowElementLinkerAlgorithmFactory=CompFactory.PFMuonFlowElementAssoc
303  if not algName:
304  algName="PFMuonFlowElementAssoc"
305  PFMuonFlowElementLinkerAlgorithm=PFMuonFlowElementLinkerAlgorithmFactory(algName)
306 
307  #set an an alternate name if needed
308  #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
309  #for a key of type SG::WriteDecorHandle<xAOD::SomeCont>someKey{this,"SpecificContainerName","myContainerName","other-labels"}
310  #setting algorithm.SpecificContainerName="myNewContainerName" changes parameter "myContainerName" to "myNewContainerName"
311  if kwargs['neutral_FE_cont_name']:
312  #update the readhandle
313  PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
314  #update the write handle for the link
315 
316  if kwargs['charged_FE_cont_name']:
317  PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
318 
319  PFMuonFlowElementLinkerAlgorithm.LinkNeutralFEClusters = kwargs['LinkNeutralFEClusters']
320  PFMuonFlowElementLinkerAlgorithm.useMuonTopoClusters = useMuonTopoClusters
321 
322  #prototype on AOD with the linkers already defined - so need to rename the output links to something besides their default name.
323 
324  #Track Calo cluster (TCC) specific configuration. Input is differently named FE container, and in the AOD step specifically
325  if kwargs['doTCC']:
326  #input containers are TrackCaloClustersCharged and TrackCaloClustersNeutral, so rename them
327  #service_key="StoreGateSvc+"
328  service_key=""
329  PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=service_key+"TrackCaloClustersCharged"
330  PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=service_key+"TrackCaloClustersNeutral"
331 
332  #Output
333  #rename the FE_MuonLinks as TCC_MuonLinks
334  #rename output containers
335  PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks=service_key+"Muons.chargedTCCLinks"
336  PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks=service_key+"Muons.neutralTCCLinks"
337  PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks=service_key+"TrackCaloClustersNeutral.TCC_MuonLinks"
338  PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks=service_key+"TrackCaloClustersCharged.TCC_MuonLinks"
339  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon="TrackCaloClustersCharged.TCC_efrac_matched_muon"
340  # several variables relating to Neutral Flow Elements/TCCs to Muons for debug. perhaps at some point these should be removed by default
341  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="TrackCaloClustersNeutral.TCC_nMatchedMuons"
342  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="TrackCaloClustersNeutral.TCC_efrac_matched_muon"
343 
344  PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="Muons.muon_efrac_matched_TCC"
345  # this is because the algorithm adds this debug container which we don't need
346  PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="Muons.deltaR_muon_clus_TCCalg"
347 
348  if kwargs['useGlobal']:
349  PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
350  PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
351 
352  PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks="Muons.chargedGlobalFELinks"
353  PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks="Muons.neutralGlobalFELinks"
354 
355  PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks="GlobalNeutralParticleFlowObjects.GlobalFE_MuonLinks"
356  PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks="GlobalChargedParticleFlowObjects.GlobalFE_MuonLinks"
357  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon="GlobalChargedParticleFlowObjects.GlobalFE_efrac_matched_muon"
358 
359  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="GlobalNeutralParticleFlowObjects.GlobalFE_nMatchedMuons"
360  PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="GlobalNeutralParticleFlowObjects.GlobalFE_efrac_matched_muon"
361 
362  PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="Muons.muon_efrac_matched_GlobalFE"
363  # this is because the algorithm adds this debug container which we don't need
364  PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="Muons.deltaR_muon_clus_GlobalFEalg"
365 
366  if kwargs['LinkNeutralFEClusters'] and not useMuonTopoClusters:
367  # We dereference links to cells, so make sure we have the
368  # dependency.
369  PFMuonFlowElementLinkerAlgorithm.ExtraInputs.add(('CaloCellContainer', inputFlags.Egamma.Keys.Input.CaloCells))
370 
371  if kwargs['LinkNeutralFEClusters']:
372  if kwargs['doTCC']:
373  # 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.
374  # This is a known bug to rectify soon
375  from AthenaCommon.Logging import logging
376  msg=logging.getLogger("PFCfg.py::getMuonFlowElementAssocAlgorithm")
377  msg.error("Neutral FE from AOD configured to be linked with Muon. This link will fail due to missing CaloCells in the AOD")
378  msg.info("Terminating job")
379  exit(0)
380 
381 
382  return PFMuonFlowElementLinkerAlgorithm
383 

◆ getNeutralFlowElementCreatorAlgorithm()

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

Definition at line 179 of file PFCfg.py.

179 def getNeutralFlowElementCreatorAlgorithm(inputFlags,neutralFlowElementOutputName,nameSuffix="",eflowCaloObjectContainerName="eflowCaloObjects"):
180  FlowElementNeutralCreatorAlgorithmFactory = CompFactory.PFNeutralFlowElementCreatorAlgorithm
181  FlowElementNeutralCreatorAlgorithm = FlowElementNeutralCreatorAlgorithmFactory("PFNeutralFlowElementCreatorAlgorithm"+nameSuffix)
182  FlowElementNeutralCreatorAlgorithm.eflowCaloObjectContainerName = eflowCaloObjectContainerName
183  if neutralFlowElementOutputName:
184  FlowElementNeutralCreatorAlgorithm.FlowElementOutputName=neutralFlowElementOutputName
185  if(inputFlags.PF.EOverPMode):
186  FlowElementNeutralCreatorAlgorithm.FlowElementOutputName="EOverPNeutralParticleFlowObjects"
187  if(inputFlags.PF.useCalibHitTruthClusterMoments and inputFlags.PF.addClusterMoments):
188  FlowElementNeutralCreatorAlgorithm.useCalibHitTruth=True
189  if inputFlags.PF.addCPData:
190  FlowElementNeutralCreatorAlgorithm.addCPData = True
191 
192  return FlowElementNeutralCreatorAlgorithm
193 

◆ getOfflinePFAlgorithm()

def PFCfg.getOfflinePFAlgorithm (   inputFlags)

Definition at line 431 of file PFCfg.py.

431 def getOfflinePFAlgorithm(inputFlags):
432  result=ComponentAccumulator()
433 
434  PFAlgorithm=CompFactory.PFAlgorithm
435  PFAlgorithm = PFAlgorithm("PFAlgorithm")
436 
437 
438  if inputFlags.HeavyIon.Egamma.doSubtractedClusters:
439  PFAlgorithm.PFClusterSelectorTool = getPFClusterSelectorTool(inputFlags.HeavyIon.Egamma.UncalibCaloTopoCluster,inputFlags.HeavyIon.Egamma.CaloTopoCluster,"PFClusterSelectorTool")
440  else:
441  topoClustersName="CaloTopoClusters"
442  PFAlgorithm.PFClusterSelectorTool = getPFClusterSelectorTool(topoClustersName,"CaloCalTopoClusters","PFClusterSelectorTool")
443 
444  PFAlgorithm.SubtractionToolList = [getPFCellLevelSubtractionTool(inputFlags,"PFCellLevelSubtractionTool")]
445 
446  if(False is inputFlags.PF.EOverPMode):
447  PFAlgorithm.SubtractionToolList += [getPFRecoverSplitShowersTool(inputFlags,"PFRecoverSplitShowersTool")]
448 
449  PFMomentCalculatorTools=result.popToolsAndMerge(getPFMomentCalculatorTool(inputFlags,[]))
450  PFAlgorithm.BaseToolList = [PFMomentCalculatorTools]
451  PFAlgorithm.BaseToolList += [getPFLCCalibTool(inputFlags)]
452  result.addEventAlgo(PFAlgorithm)
453  return result
454 

◆ getPFCellLevelSubtractionTool()

def PFCfg.getPFCellLevelSubtractionTool (   inputFlags,
  toolName 
)

Definition at line 62 of file PFCfg.py.

62 def getPFCellLevelSubtractionTool(inputFlags,toolName):
63  PFCellLevelSubtractionToolFactory = CompFactory.PFSubtractionTool
64  PFCellLevelSubtractionTool = PFCellLevelSubtractionToolFactory(toolName,useNNEnergy = inputFlags.PF.useMLEOverP)
65 
66  if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
67  eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
68  PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss()
69  else:
70  if inputFlags.PF.useLegacyEOverPRun4:
71  eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
72  PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
73  else:
74  PFCellEOverPTool = CompFactory.PFCellEOverPTool
75  PFCellLevelSubtractionTool.eflowCellEOverPTool = PFCellEOverPTool("PFCellEOverPTool", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
76  #this should always be false for any reference derived, except eflowCellEOverPTool_mc12_HLLHC.h or eflowCellEOverPTool_Run2_mc20_JetETMiss.h
77  PFCellLevelSubtractionTool.useLegacyEBinIndex=False
78 
79  if(inputFlags.PF.EOverPMode):
80  PFCellLevelSubtractionTool.CalcEOverP = True
81  PFCellLevelSubtractionTool.nClusterMatchesToUse = -1
82  else:
83  PFCellLevelSubtractionTool.nClusterMatchesToUse = 1
84 
85  if(inputFlags.PF.EOverPMode):
86  PFCellLevelSubtractionTool.PFTrackClusterMatchingTool = getPFTrackClusterMatchingTool(inputFlags,0.2,"EtaPhiSquareDistance","PlainEtaPhi","CalObjBldMatchingTool")
87  else:
88  PFCellLevelSubtractionTool.PFTrackClusterMatchingTool = getPFTrackClusterMatchingTool(inputFlags,1.64,"EtaPhiSquareSignificance","GeomCenterEtaPhi","CalObjBldMatchingTool")
89 
90  PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_015 = getPFTrackClusterMatchingTool(inputFlags,0.15,"EtaPhiSquareDistance","PlainEtaPhi","MatchingTool_Pull_015")
91  PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_02 = getPFTrackClusterMatchingTool(inputFlags,0.2,"EtaPhiSquareDistance","PlainEtaPhi","MatchingTool_Pull_02")
92 
93  if inputFlags.PF.useMLEOverP:
94  PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool("PFCellLevelEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
95  PFCellLevelSubtractionTool.NNEnergyPredictorTool = PFEnergyPredictorTool
96  PFCellLevelSubtractionTool.addCPData = inputFlags.PF.addCPData
97 
98  return PFCellLevelSubtractionTool
99 

◆ getPFClusterSelectorTool()

def PFCfg.getPFClusterSelectorTool (   clustersin,
  calclustersin,
  algName 
)

Definition at line 42 of file PFCfg.py.

42 def getPFClusterSelectorTool(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  return PFClusterSelectorTool
52 

◆ getPFLCCalibTool()

def PFCfg.getPFLCCalibTool (   inputFlags)

Definition at line 147 of file PFCfg.py.

147 def getPFLCCalibTool(inputFlags):
148  PFLCCalibTool = CompFactory.PFLCCalibTool
149  PFLCCalibTool = PFLCCalibTool("PFLCCalibTool")
150 
151  PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
152  PFLCCalibTool.eflowRecClusterCollectionTool = PFClusterCollectionTool("PFClusterCollectionTool_LCCalib")
153  PFLCCalibTool.UseLocalWeight = False
154 
155  from CaloRec.CaloTopoClusterConfig import getTopoClusterLocalCalibTools
156  lcCalibToolList = getTopoClusterLocalCalibTools(inputFlags)
157 
158  PFLCCalibTool.CaloClusterLocalCalib=lcCalibToolList[0]
159  PFLCCalibTool.CaloClusterLocalCalibOOCC=lcCalibToolList[1]
160  PFLCCalibTool.CaloClusterLocalCalibOOCCPi0=lcCalibToolList[2]
161  PFLCCalibTool.CaloClusterLocalCalibDM=lcCalibToolList[3]
162 
163  return PFLCCalibTool
164 

◆ getPFMomentCalculatorTool()

def PFCfg.getPFMomentCalculatorTool (   inputFlags,
  momentsToCalculateList 
)

Definition at line 125 of file PFCfg.py.

125 def getPFMomentCalculatorTool(inputFlags, momentsToCalculateList):
126  result=ComponentAccumulator()
127  PFMomentCalculatorToolFactory = CompFactory.PFMomentCalculatorTool
128  PFMomentCalculatorTool = PFMomentCalculatorToolFactory("PFMomentCalculatorTool")
129 
130  from CaloRec.CaloTopoClusterConfig import getTopoMoments
131  PFClusterMomentsMaker = result.popToolsAndMerge(getTopoMoments(inputFlags))
132  if (len(momentsToCalculateList) > 0):
133  PFClusterMomentsMaker.MomentsNames = momentsToCalculateList
134  PFMomentCalculatorTool.CaloClusterMomentsMaker = PFClusterMomentsMaker
135 
136  PFClusterCollectionTool = CompFactory.PFClusterCollectionTool
137  PFMomentCalculatorTool.PFClusterCollectionTool = PFClusterCollectionTool("PFClusterCollectionTool")
138 
139  if(inputFlags.PF.useCalibHitTruthClusterMoments):
140  PFMomentCalculatorTool.UseCalibHitTruth=True
141  from CaloRec.CaloTopoClusterConfig import getTopoCalibMoments
142  PFMomentCalculatorTool.CaloCalibClusterMomentsMaker2 = getTopoCalibMoments(inputFlags)
143 
144  result.setPrivateTools(PFMomentCalculatorTool)
145  return result
146 

◆ getPFRecoverSplitShowersTool()

def PFCfg.getPFRecoverSplitShowersTool (   inputFlags,
  toolName 
)

Definition at line 100 of file PFCfg.py.

100 def getPFRecoverSplitShowersTool(inputFlags,toolName):
101  PFRecoverSplitShowersToolFactory = CompFactory.PFSubtractionTool
102  PFRecoverSplitShowersTool = PFRecoverSplitShowersToolFactory(toolName,useNNEnergy = inputFlags.PF.useMLEOverP)
103 
104  if inputFlags.GeoModel.Run <= LHCPeriod.Run3:
105  eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
106  PFRecoverSplitShowersTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss("eflowCellEOverPTool_Run2_mc20_JetETMiss_Recover")
107  else:
108  if inputFlags.PF.useLegacyEOverPRun4:
109  eflowCellEOverPTool_mc12_HLLHC = CompFactory.eflowCellEOverPTool_mc12_HLLHC
110  PFRecoverSplitShowersTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_HLLHC ()
111  else:
112  PFCellEOverPTool = CompFactory.PFCellEOverPTool
113  PFRecoverSplitShowersTool.eflowCellEOverPTool = PFCellEOverPTool("PFCellEOverPTool_Recover", referenceFileLocation = inputFlags.PF.EOverP_CellOrdering_ReferenceLocation)
114  #this should always be false for any reference derived, except eflowCellEOverPTool_mc12_HLLHC.h or eflowCellEOverPTool_Run2_mc20_JetETMiss.h
115  PFRecoverSplitShowersTool.useLegacyEBinIndex=False
116 
117  PFRecoverSplitShowersTool.RecoverSplitShowers = True
118 
119  if inputFlags.PF.useMLEOverP:
120  PFEnergyPredictorTool = CompFactory.PFEnergyPredictorTool("PFRecoverSplitShowersEnergyPredcictorTool",ModelPath = inputFlags.PF.EOverP_NN_Model)
121  PFRecoverSplitShowersTool.NNEnergyPredictorTool = PFEnergyPredictorTool
122 
123  return PFRecoverSplitShowersTool
124 

◆ getPFTrackClusterMatchingTool()

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

Definition at line 53 of file PFCfg.py.

53 def getPFTrackClusterMatchingTool(inputFlags,matchCut,distanceType,clusterPositionType,name):
54  PFTrackClusterMatchingTool = CompFactory.PFTrackClusterMatchingTool
55  MatchingTool = PFTrackClusterMatchingTool(name)
56  MatchingTool.ClusterPositionType = clusterPositionType
57  MatchingTool.DistanceType = distanceType
58  MatchingTool.MatchCut = matchCut*matchCut
59  return MatchingTool
60 
61 

◆ getTauFlowElementAssocAlgorithm()

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

Definition at line 384 of file PFCfg.py.

384 def getTauFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
385 
386  kwargs.setdefault("neutral_FE_cont_name", "")
387  kwargs.setdefault("charged_FE_cont_name", "")
388  kwargs.setdefault("doTCC", False)
389  kwargs.setdefault("useGlobal", False)
390 
391  PFTauFlowElementLinkerAlgorithmFactory=CompFactory.PFTauFlowElementAssoc
392  if not algName:
393  algName = "PFTauFlowElementAssoc"
394 
395  PFTauFlowElementLinkerAlgorithm=PFTauFlowElementLinkerAlgorithmFactory(algName)
396 
397  #set an an alternate name if needed
398  #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
399  #for a key of type SG::WriteDecorHandle<xAOD::SomeCont>someKey{this,"SpecificContainerName","myContainerName","other-labels"}
400  #setting algorithm.SpecificContainerName="myNewContainerName" changes parameter "myContainerName"
401  #(also applies to ReadHandles)
402  if kwargs['neutral_FE_cont_name']:
403  PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
404 
405  if kwargs['charged_FE_cont_name']:
406  PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
407 
408  if kwargs['doTCC']:
409  PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer="TrackCaloClustersNeutral"
410  PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer="TrackCaloClustersCharged"
411 
412  PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey="TauJets.neutralTCCLinks"
413  PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey="TauJets.chargedTCCLinks"
414 
415  PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey="TrackCaloClustersNeutral.TCC_TauLinks"
416  PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey="TrackCaloClustersCharged.TCC_TauLinks"
417 
418  #This allows to set the links on the global particle flow containers created by JetPFlowSelectionAlg in JetRecTools
419  if kwargs['useGlobal']:
420  PFTauFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
421  PFTauFlowElementLinkerAlgorithm.JetETMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
422 
423  PFTauFlowElementLinkerAlgorithm.TauNeutralFEDecorKey="TauJets.neutralGlobalFELinks"
424  PFTauFlowElementLinkerAlgorithm.TauChargedFEDecorKey="TauJets.chargedGlobalFELinks"
425 
426  PFTauFlowElementLinkerAlgorithm.NeutralFETauDecorKey="GlobalNeutralParticleFlowObjects.GlobalFE_TauLinks"
427  PFTauFlowElementLinkerAlgorithm.ChargedFETauDecorKey="GlobalChargedParticleFlowObjects.GlobalFE_TauLinks"
428 
429  return PFTauFlowElementLinkerAlgorithm
430 

◆ PFGlobalFlowElementLinkingCfg()

def PFCfg.PFGlobalFlowElementLinkingCfg (   inputFlags,
**  kwargs 
)

Definition at line 455 of file PFCfg.py.

455 def PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs):
456  result=ComponentAccumulator()
457 
458  kwargs.setdefault("useGlobal", True)
459 
460  result.addEventAlgo(getTauFlowElementAssocAlgorithm(inputFlags, algName="PFTauGlobalFlowElementAssoc", **kwargs))
461  result.addEventAlgo(getMuonFlowElementAssocAlgorithm(inputFlags, algName="PFMuonGlobalFlowElementAssoc", **kwargs))
462  result.addEventAlgo(getEGamFlowElementAssocAlgorithm(inputFlags, algName="PFEGamGlobalFlowElementAssoc", **kwargs))
463  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:431
PFAlgorithm
Definition: PFAlgorithm.h:22
python.CaloTopoClusterConfig.getTopoClusterLocalCalibTools
def getTopoClusterLocalCalibTools(flags)
Definition: CaloTopoClusterConfig.py:29
PFCfg.getPFLCCalibTool
def getPFLCCalibTool(inputFlags)
Definition: PFCfg.py:147
python.InDetTrackSelectionToolConfig.PFTrackSelectionToolCfg
def PFTrackSelectionToolCfg(flags, name="PFTrackSelectionTool", **kwargs)
Definition: InDetTrackSelectionToolConfig.py:73
eflowTrackCaloExtensionTool
Inherits from eflowTrackExtrapolatorBaseAlgTool and AthAlgTool.
Definition: eflowTrackCaloExtensionTool.h:38
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
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:179
PFCfg.getPFRecoverSplitShowersTool
def getPFRecoverSplitShowersTool(inputFlags, toolName)
Definition: PFCfg.py:100
PFCfg.getPFClusterSelectorTool
def getPFClusterSelectorTool(clustersin, calclustersin, algName)
Definition: PFCfg.py:42
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:125
PFCfg.getChargedFlowElementCreatorAlgorithm
def getChargedFlowElementCreatorAlgorithm(inputFlags, chargedFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
Definition: PFCfg.py:165
PFCfg.getEGamFlowElementAssocAlgorithm
def getEGamFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
Definition: PFCfg.py:205
calibdata.exit
exit
Definition: calibdata.py:236
PFCfg.getMuonFlowElementAssocAlgorithm
def getMuonFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
Definition: PFCfg.py:286
PFCfg.getPFCellLevelSubtractionTool
def getPFCellLevelSubtractionTool(inputFlags, toolName)
Definition: PFCfg.py:62
PFCfg.getLCNeutralFlowElementCreatorAlgorithm
def getLCNeutralFlowElementCreatorAlgorithm(inputFlags, neutralFlowElementOutputName)
Definition: PFCfg.py:194
PFCfg.getTauFlowElementAssocAlgorithm
def getTauFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
Definition: PFCfg.py:384
python.CaloTopoClusterConfig.getTopoMoments
def getTopoMoments(flags)
Definition: CaloTopoClusterConfig.py:96
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
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:53
TrackToCaloConfig.ParticleCaloExtensionToolCfg
def ParticleCaloExtensionToolCfg(flags, name='ParticleCaloExtensionTool', **kwargs)
Definition: TrackToCaloConfig.py:10
PFCfg.PFGlobalFlowElementLinkingCfg
def PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs)
Definition: PFCfg.py:455