ATLAS Offline Software
StandardJetConstits.py
Go to the documentation of this file.
1 
2 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 
4 """
5  StandardJetConstits: A module containing standard definitions for jet inputs : external container and
6  constituents.
7  These can be copied and modified by users who want something a bit
8  different from what is provided.
9 
10  Author: TJ Khoo, P-A Delsart
11 
12 
13 """
14 
15 
16 from .JetDefinition import xAODType, JetInputConstitSeq, JetInputExternal, JetConstitModifier, JetInputConstit
17 from .StandardJetContext import inputsFromContext, propFromContext
18 from .JetRecConfig import isAnalysisRelease
19 from AthenaConfiguration.Enums import BeamType
20 
21 # Prepare dictionnaries to hold all of our standard definitions.
22 # They will be filled from the lists below
23 from .Utilities import ldict
24 stdInputExtDic = ldict()
25 stdConstitDic = ldict()
26 stdContitModifDic = ldict()
27 
28 
29 # This module contains the helper functions needed to instantiate the input container external
30 # to Jet domain
31 import JetRecConfig.JetInputConfig as inputcfg
32 try:
33  import JetRecTools.JetRecToolsConfig as jrtcfg
34 except ModuleNotFoundError:
35  # In some releases JetRecTools is not existing
36  pass
37 
38 try:
39  import TrackCaloClusterRecTools.TrackCaloClusterConfig as tcccfg
40 except ModuleNotFoundError:
41  # In some releases TrackCaloClusterRecTools is not existing
42  pass
43 
44 def isMC(flags):
45  """A simple filter function for testing if we're running in MC
46  returns (bool, str) where the str contains an explanation of why the bool is False.
47  (probably worth re-allocating somehere else)"""
48  return flags.Input.isMC or flags.Overlay.DataOverlay, "Input file is not MC"
49 
50 def standardReco(input):
51  """Returns a helper function which invokes the standard reco configuration for the container 'input'
52  (where input is external to the jet domain).
53 
54  We group the definition of functions here rather than separately, so that we can change them
55  automatically to a void function in case we're in an Analysis release and we can not import upstream packages.
56 
57  """
58 
59  doNothingFunc = lambda *l:None # noqa: E731
60  if isAnalysisRelease():
61  return doNothingFunc
62 
63 
64  if input=='CaloClusters':
65  def f(jetdef,spec):
66  from CaloRec.CaloRecoConfig import CaloRecoCfg
67  flags = jetdef._cflags
68  return CaloRecoCfg(flags) if flags.Jet.doUpstreamDependencies else None
69  elif input=='Tracks':
70  def f(jetdef,spec):
71  from InDetConfig.TrackRecoConfig import InDetTrackRecoCfg
72  flags = jetdef._cflags
73  return InDetTrackRecoCfg(flags) if flags.Jet.doUpstreamDependencies else None
74  elif input=="Muons":
75  def f(jetdef,spec):
76  from MuonConfig.MuonReconstructionConfig import MuonReconstructionCfg
77  flags = jetdef._cflags
78  return MuonReconstructionCfg(flags) if flags.Jet.doUpstreamDependencies else None
79  elif input=="PFlow":
80  def f(jetdef,spec):
81  if not jetdef._cflags.Jet.doUpstreamDependencies:
82  return None
83  from eflowRec.PFRun3Config import PFCfg
84  return PFCfg(jetdef._cflags)
85 
86  else:
87  f = doNothingFunc
88 
89  return f
90 
91 
92 
93 
95 
96 # Functions to check if upstream containers should exist. These are
97 # implemented as lambda functions in the simpler cases.
98 
100  warning = "Tracking is disabled and no InDetTrackParticles in input"
101  if "InDetTrackParticles" in flags.Input.Collections:
102  return True, warning
103  if isAnalysisRelease():
104  # we can't check reco flags in analysis release (and would not
105  # be building tracks anyway)
106  return False, warning
107  return flags.Reco.EnableTracking, warning
108 
110  warning = "Muon reco is disabled"
111  if "MuonSegments" in flags.Input.Collections:
112  return True, warning
113  if isAnalysisRelease():
114  # reco flags don't exist in analysis release
115  return False, warning
116  return flags.Reco.EnableCombinedMuon, warning
117 
119  warning = "UnAssociated muon segments not present"
120  if "UnAssocMuonSegments" in flags.Input.Collections:
121  return True, warning
122  if flags.Input.RunNumbers[0] < 410000:
123  # Unassociated containers only exist from Run 3 and mc23 onwards
124  return False, warning
125  if isAnalysisRelease():
126  # reco flags don't exist in analysis release
127  return False, warning
128  return flags.Reco.EnableCombinedMuon, warning
129 
131  warning = "Large radius tracking did not run"
132  if "InDetLargeD0TrackParticles" in flags.Input.Collections:
133  # the conditions here weren't the same as above: apparently we
134  # require _both_ the input condition _and_ the tracking
135  # flag. I don't know if this is what we want but it keeps with
136  # the existing behavior.
137  #
138  # Again, the isAnalysisRelease function is needed to short
139  # circuit the flag check, since flags.Tracking doesn't exist
140  # in analysis releases.
141  if isAnalysisRelease() or flags.Tracking.doLargeD0:
142  return True, warning
143  return False, warning
144 
145 
146 _stdInputList = [
147  # Format is :
148  # JetInputExternal( containername , containerType, ...optionnal parameters... )
149  # When defined, algoBuilder is a function returning the actual alg building the input.
150  # it will be called as : algoBuilder(jetdef, spec) where jetdef is the parent JetDefinition
151 
152  # *****************************
153  JetInputExternal("CaloCalTopoClusters", xAODType.CaloCluster, algoBuilder= standardReco("CaloClusters") ),
154 
155  JetInputExternal("HLT_TopoCaloClustersFS", xAODType.CaloCluster ),
156 
157  # *****************************
158  JetInputExternal("JetETMissParticleFlowObjects", xAODType.FlowElement, algoBuilder = standardReco("PFlow"),
159  prereqs = [inputsFromContext("Tracks"), "input:CaloCalTopoClusters"],
160  ),
161 
162  JetInputExternal("GlobalParticleFlowObjects", xAODType.FlowElement,
163  algoBuilder = inputcfg.buildPFlowSel,
164  prereqs = ["input:JetETMissParticleFlowObjects", ],
165  ),
166 
167  JetInputExternal("GlobalParticleFlowObjects_noElectrons", xAODType.FlowElement,
168  algoBuilder = inputcfg.buildPFlowSel_noElectrons,
169  prereqs = ["input:JetETMissParticleFlowObjects", ],
170  ),
171 
172  JetInputExternal("GlobalParticleFlowObjects_noMuons", xAODType.FlowElement,
173  algoBuilder = inputcfg.buildPFlowSel_noMuons,
174  prereqs = ["input:JetETMissParticleFlowObjects", ],
175  ),
176 
177  JetInputExternal("GlobalParticleFlowObjects_noLeptons", xAODType.FlowElement,
178  algoBuilder = inputcfg.buildPFlowSel_noLeptons,
179  prereqs = ["input:JetETMissParticleFlowObjects", ],
180  ),
181 
182  JetInputExternal("GlobalParticleFlowObjects_tauSeedEleRM", xAODType.FlowElement,
183  algoBuilder = inputcfg.buildPFlowSel_tauSeedEleRM,
184  prereqs = ["input:JetETMissParticleFlowObjects", ],
185  ),
186 
187  # *****************************
188  JetInputExternal("InDetTrackParticles", xAODType.TrackParticle,
189  algoBuilder = standardReco("Tracks"),
190  filterfn = _trackParticleInputsExist
191  ),
192  # alternative ID tracks for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
193  JetInputExternal("InDetTrackParticles_EleRM", xAODType.TrackParticle),
194 
195  JetInputExternal("PrimaryVertices", xAODType.Vertex,
196  prereqs = [inputsFromContext("Tracks")],
197  filterfn = lambda flags : (flags.Beam.Type == BeamType.Collisions, f"No vertexing with {flags.Beam.Type}"), # should be changed when a reliable "EnableVertexing" flag exists
198  ),
199  # No quality criteria are applied to the tracks, used for ghosts for example
200  JetInputExternal("JetSelectedTracks", xAODType.TrackParticle,
201  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
202  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=False )
203  ),
204  # alternative JetSelected tracks for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
205  JetInputExternal("JetSelectedTracks_EleRM", xAODType.TrackParticle,
206  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
207  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=False )
208  ),
209  # alternative ID tracks for ftf (FS HLT tracking)
210  JetInputExternal("JetSelectedTracks_ftf", xAODType.TrackParticle,
211  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
212  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=False )
213  ),
214  # alternative ID tracks for roiftf (jet super-RoI HLT tracking)
215  JetInputExternal("JetSelectedTracks_roiftf", xAODType.TrackParticle,
216  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
217  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=False )
218  ),
219 
220  # Apply quality criteria defined via trackSelOptions in jdef.context (used e.g. for track-jets)
221  JetInputExternal("JetSelectedTracks_trackSelOpt", xAODType.TrackParticle,
222  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
223  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=True )
224  ),
225  JetInputExternal("JetTrackUsedInFitDeco", xAODType.TrackParticle,
226  prereqs= [ inputsFromContext("Tracks") , # in std context, this is InDetTrackParticles (see StandardJetContext)
227  inputsFromContext("Vertices")],
228  algoBuilder = inputcfg.buildJetTrackUsedInFitDeco
229  ),
230  JetInputExternal("JetTrackVtxAssoc", xAODType.TrackParticle,
231  algoBuilder =
232  lambda jdef, _ : jrtcfg.getJetTrackVtxAlg(
233  jdef._contextDic,
234  algname="jetTVA" if jdef.context in ["HL_LHC", "default", "notrk", ""] else f"jetTVA_{jdef.context}",
235  WorkingPoint="Nonprompt_All_MaxWeight"
236  ),
237  # previous default for ttva : WorkingPoint="Custom", d0_cut= 2.0, dzSinTheta_cut= 2.0
238  prereqs = ["input:JetTrackUsedInFitDeco", inputsFromContext("Vertices")],
239  ),
240  # alternative JetTrackVtxAssoc for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
241  JetInputExternal("JetTrackVtxAssoc_EleRM", xAODType.TrackParticle,
242  algoBuilder = lambda jdef,_ : jrtcfg.getJetTrackVtxAlg(jdef._contextDic, algname="jetTVA_" + jdef.context, WorkingPoint="Nonprompt_All_MaxWeight"),
243  # previous default for ttva : WorkingPoint="Custom", d0_cut= 2.0, dzSinTheta_cut= 2.0
244  prereqs = ["input:JetTrackUsedInFitDeco", inputsFromContext("Vertices") ]
245  ),
246  JetInputExternal("JetTrackVtxAssoc_ftf", xAODType.TrackParticle,
247  algoBuilder = lambda jdef,_ : jrtcfg.getJetTrackVtxAlg(jdef._contextDic, algname="jetTVA_" + jdef.context, WorkingPoint="Nonprompt_All_MaxWeight"),
248  # previous default for ttva : WorkingPoint="Custom", d0_cut= 2.0, dzSinTheta_cut= 2.0
249  prereqs = ["input:JetTrackUsedInFitDeco", inputsFromContext("Vertices") ]
250  ),
251  JetInputExternal("JetTrackVtxAssoc_roiftf", xAODType.TrackParticle,
252  algoBuilder = lambda jdef,_ : jrtcfg.getJetTrackVtxAlg(jdef._contextDic, algname="jetTVA_" + jdef.context, WorkingPoint="Nonprompt_All_MaxWeight"),
253  # previous default for ttva : WorkingPoint="Custom", d0_cut= 2.0, dzSinTheta_cut= 2.0
254  prereqs = ["input:JetTrackUsedInFitDeco", inputsFromContext("Vertices") ]
255  ),
256  # *****************************
257  JetInputExternal("EventDensity", "EventShape", algoBuilder = inputcfg.buildEventShapeAlg,
258  containername = lambda jetdef, specs : (specs or "")+"Kt4"+jetdef.inputdef.label+"EventShape",
259  prereqs = lambda jetdef : ["input:"+jetdef.inputdef.name] # this will force the input to be build *before* the EventDensity alg.
260  ),
261  # alternative EventDensity for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
262  JetInputExternal("EleRM_EventDensity", "EventShape", algoBuilder = inputcfg.buildEventShapeAlg,
263  containername = lambda jetdef, specs : (specs or "")+"Kt4"+jetdef.inputdef.label+"EventShape",
264  prereqs = lambda jetdef : ["input:"+jetdef.inputdef.name],
265  specs = "EleRM_"
266  ),
267  JetInputExternal("HLT_EventDensity", "EventShape", algoBuilder = inputcfg.buildEventShapeAlg,
268  containername = lambda jetdef, specs : (specs or "")+"Kt4"+jetdef.inputdef.label+"EventShape",
269  prereqs = lambda jetdef : ["input:"+jetdef.inputdef.name], # this will force the input to be build *before* the EventDensity alg.
270  specs = 'HLT_'
271  ),
272 
273  # *****************************
274  JetInputExternal("MuonSegments", "MuonSegment", algoBuilder=standardReco("Muons"),
275  prereqs = [inputsFromContext("Tracks")], # most likely wrong : what exactly do we need to build muon segments ?? (and not necessarily full muons ...)
276  filterfn = _muonSegmentInputsExist
277  ),
278 
279  JetInputExternal("UnAssocMuonSegments", "UnAssocMuonSegment", algoBuilder=standardReco("Muons"),
280  prereqs = [inputsFromContext("Tracks")],
281  filterfn = _unassocMuonSegmentInputsExist
282  ),
283 
284 
285  # *****************************
286  # Truth particles from the hard scatter vertex prior to Geant4 simulation.
287  # Neutrinos and muons are omitted; all other stable particles are included.
288  JetInputExternal("JetInputTruthParticles", xAODType.TruthParticle,
289  algoBuilder = inputcfg.buildJetInputTruth, filterfn=isMC ),
290 
291  # Truth particles from the hard scatter vertex prior to Geant4 simulation.
292  # Prompt electrons, muons and neutrinos are excluded, all other stable particles
293  # are included, in particular leptons and neutrinos from hadron decays.
294  JetInputExternal("JetInputTruthParticlesNoWZ", xAODType.TruthParticle,
295  algoBuilder = inputcfg.buildJetInputTruth, filterfn=isMC,specs="NoWZ"),
296 
297  # Truth particles from the hard scatter vertex prior to Geant4 simulation.
298  # Similar configuration as for JetInputTruthParticlesNoWZ but with slightly
299  # different photon dressing option
300  JetInputExternal("JetInputTruthParticlesDressedWZ", xAODType.TruthParticle,
301  algoBuilder = inputcfg.buildJetInputTruth, filterfn=isMC,specs="DressedWZ"),
302 
303  # Truth particles from the hard scatter vertex prior to Geant4 simulation.
304  # Only charged truth particles are used
305  JetInputExternal("JetInputTruthParticlesCharged", xAODType.TruthParticle,
306  algoBuilder = inputcfg.buildJetInputTruth, filterfn=isMC,specs="Charged"),
307 
308 
309  #**************
310  # TEMPORARY : special inputs for EVTGEN jobs (as long as gen-level and reco-level definitions are not harmonized)
311  JetInputExternal("JetInputTruthParticlesGEN", xAODType.TruthParticle,
312  algoBuilder = inputcfg.buildJetInputTruthGEN, filterfn=isMC ),
313 
314  JetInputExternal("JetInputTruthParticlesGENNoWZ", xAODType.TruthParticle,
315  algoBuilder = inputcfg.buildJetInputTruthGEN, filterfn=isMC,specs="NoWZ"),
316  #**************
317 
318 
319  JetInputExternal("PV0JetSelectedTracks", xAODType.TrackParticle,
320  prereqs=["input:JetSelectedTracks_trackSelOpt", "input:JetTrackUsedInFitDeco"],
321  algoBuilder = inputcfg.buildPV0TrackSel ),
322 
323 
324  JetInputExternal("UFOCSSK", xAODType.FlowElement,
325  # in analysis releases, or if we have UFOCSSK in inputs don't declare unneeded dependencies which could fail the config.
326  prereqs =lambda parentjdef : [] if (isAnalysisRelease() or 'UFOCSSK' in parentjdef._cflags.Input.Collections ) else ['input:GPFlowCSSK'],
327  filterfn = lambda flag : ( (not isAnalysisRelease() or 'UFOCSSK' in flag.Input.Collections), "Can't build UFO in Analysis projects and not UFOCSSK in input") ,
328  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlowCSSK'])
329  ),
330 
331  JetInputExternal("UFOCSSK_noElectrons", xAODType.FlowElement,
332  prereqs =lambda parentjdef : [] if (isAnalysisRelease() or 'UFOCSSK_noElectrons' in parentjdef._cflags.Input.Collections ) else ['input:GPFlowCSSK_noElectrons'],
333  filterfn = lambda flag : ( (not isAnalysisRelease() or 'UFOCSSK_noElectrons' in flag.Input.Collections), "Can't build UFO in Analysis projects and not UFOCSSK in input") ,
334  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlowCSSK_noElectrons'])
335  ),
336 
337  JetInputExternal("UFOCSSK_noMuons", xAODType.FlowElement,
338  prereqs =lambda parentjdef : [] if (isAnalysisRelease() or 'UFOCSSK_noMuons' in parentjdef._cflags.Input.Collections ) else ['input:GPFlowCSSK_noMuons'],
339  filterfn = lambda flag : ( (not isAnalysisRelease() or 'UFOCSSK_noMuons' in flag.Input.Collections), "Can't build UFO in Analysis projects and not UFOCSSK in input") ,
340  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlowCSSK_noMuons'])
341  ),
342 
343  JetInputExternal("UFOCSSK_noLeptons", xAODType.FlowElement,
344  # in analysis releases, or if we have UFOCSSK in inputs don't declare unneeded dependencies which could fail the config.
345  prereqs =lambda parentjdef : [] if (isAnalysisRelease() or 'UFOCSSK_noLeptons' in parentjdef._cflags.Input.Collections ) else ['input:GPFlowCSSK_noLeptons'],
346  filterfn = lambda flag : ( (not isAnalysisRelease() or 'UFOCSSK_noLeptons' in flag.Input.Collections), "Can't build UFO in Analysis projects and not UFOCSSK in input") ,
347  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlowCSSK_noLeptons'])
348  ),
349 
350  JetInputExternal("UFO", xAODType.FlowElement,
351  prereqs = ['input:GPFlow'],
352  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlow'])
353  ),
354 
355 ]
356 
357 
358 _truthFlavours = ["BHadronsInitial", "BHadronsFinal", "BQuarksFinal",
359  "CHadronsInitial", "CHadronsFinal", "CQuarksFinal",
360  "TausFinal",
361  "WBosons", "ZBosons", "HBosons", "TQuarksFinal",
362  "Partons",]
363 for label in _truthFlavours:
364  # re-use the main truth input definition :
365  _stdInputList.append( JetInputExternal("TruthLabel"+label, xAODType.TruthParticle,
366  algoBuilder = inputcfg.buildLabelledTruth,
367  filterfn=isMC, specs = label ) )
368 
369 
370 
371 # Fill the stdInputExtDic from the above list
372 for ji in _stdInputList:
373  ji._locked = True # lock the definitions so we have unmutable references !
374  stdInputExtDic[ji.name] = ji
375 
376 
377 
378 
379 
380 
381 
382 
383 
386 _stdSeqList = [
387  # Format is typically :
388  # JetInputConstitSeq( name , input_cont_type, list_of_modifiers, inputcontainer, outputcontainer )
389  # or
390  # JetInputConstit( name, input_cont_type, containername)
391  # see JetDefinition.py for details.
392 
393  # *****************************
394  # Cluster constituents : the first one is a relic used for isolation, and might disappear soon
395  JetInputConstitSeq("EMTopo", xAODType.CaloCluster, ["EM"],
396  "CaloCalTopoClusters", "EMTopoClusters", jetinputtype="EMTopo",
397  ),
398  JetInputConstitSeq("LCTopo", xAODType.CaloCluster, ["LC"],
399  "CaloCalTopoClusters", "LCTopoClusters", jetinputtype="LCTopo",
400  ),
401  JetInputConstitSeq("EMTopoOrigin", xAODType.CaloCluster, ["EM","Origin"],
402  "CaloCalTopoClusters", "EMOriginTopoClusters", jetinputtype="EMTopo",
403  ),
404  JetInputConstitSeq("LCTopoOrigin",xAODType.CaloCluster, ["LC","Origin"],
405  "CaloCalTopoClusters", "LCOriginTopoClusters", jetinputtype="LCTopo",
406  ),
407  # alternative LCTopoOrigin for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
408  JetInputConstitSeq("LCTopoOrigin_EleRM",xAODType.CaloCluster, ["LC","Origin"],
409  "CaloCalTopoClusters_EleRM", "LCOriginTopoClusters_EleRM", jetinputtype="LCTopo",
410  ),
411  JetInputConstitSeq("LCTopoCSSK", xAODType.CaloCluster, ["LC","Origin","CS","SK"],
412  "CaloCalTopoClusters", "LCOriginTopoCSSK", jetinputtype="LCTopo",
413  ),
414 
415 
416 
417 
418  # *****************************
419  # EM-scale particle flow objects with charged hadron subtraction
420  # For now we don't specify a scale, as only one works well, but
421  # this could be incorporated into the naming scheme and config
422  JetInputConstitSeq("EMPFlow", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'JetETMissParticleFlowObjects', 'CHSParticleFlowObjects'),
423 
424  # GPFlow are the same than EMPFlow except they have pflow linked to elec or muons filtered out.
425  JetInputConstitSeq("GPFlow", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects', 'CHSGParticleFlowObjects',
426  label='EMPFlow'),
427 
428  JetInputConstitSeq("GPFlow_noElectrons", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects_noElectrons', 'CHSGParticleFlowObjects_noElectrons',
429  label='EMPFlow_noElectrons'),
430 
431  JetInputConstitSeq("GPFlow_noMuons", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects_noMuons', 'CHSGParticleFlowObjects_noMuons',
432  label='EMPFlow_noMuons'),
433 
434  JetInputConstitSeq("GPFlow_noLeptons", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects_noLeptons', 'CHSGParticleFlowObjects_noLeptons',
435  label='EMPFlow_noLeptons'),
436 
437  #GPFlow with tau seed electrons removed
438  JetInputConstitSeq("GPFlow_tauSeedEleRM", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects_tauSeedEleRM', 'CHSGParticleFlowObjects_tauSeedEleRM',
439  label='EMPFlow_tauSeedEleRM'),
440 
441 
442  # Particle Flow Objects with several neutral PFO copies for by-vertex reconstruction
443  JetInputConstitSeq("GPFlowByVtx", xAODType.FlowElement, ["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects', 'CHSByVtxGParticleFlowObjects',
444  label='EMPFlowByVertex', byVertex=True),
445 
446  # Particle Flow Objects with Constituent Subtraction + SoftKiller
447  JetInputConstitSeq("EMPFlowCSSK", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
448  'JetETMissParticleFlowObjects', 'CSSKParticleFlowObjects', jetinputtype="EMPFlow"),
449 
450  JetInputConstitSeq("GPFlowCSSK", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
451  'GlobalParticleFlowObjects', 'CSSKGParticleFlowObjects', jetinputtype="EMPFlow", label='EMPFlowCSSK'),
452 
453  JetInputConstitSeq("GPFlowCSSK_noElectrons", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
454  'GlobalParticleFlowObjects_noElectrons', 'CSSKGParticleFlowObjects_noElectrons', jetinputtype="EMPFlow", label='EMPFlowCSSK_noElectrons'),
455 
456  JetInputConstitSeq("GPFlowCSSK_noMuons", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
457  'GlobalParticleFlowObjects_noMuons', 'CSSKGParticleFlowObjects_noMuons', jetinputtype="EMPFlow", label='EMPFlowCSSK_noMuons'),
458 
459  JetInputConstitSeq("GPFlowCSSK_noLeptons", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
460  'GlobalParticleFlowObjects_noLeptons', 'CSSKGParticleFlowObjects_noLeptons', jetinputtype="EMPFlow", label='EMPFlowCSSK_noLeptons'),
461 
462  JetInputConstit("UFOCSSK", xAODType.FlowElement, "UFOCSSK" ),
463 
464  JetInputConstit("UFOCSSK_noElectrons", xAODType.FlowElement, "UFOCSSK_noElectrons" ),
465 
466  JetInputConstit("UFOCSSK_noMuons", xAODType.FlowElement, "UFOCSSK_noMuons" ),
467 
468  JetInputConstit("UFOCSSK_noLeptons", xAODType.FlowElement, "UFOCSSK_noLeptons" ),
469 
470  JetInputConstit("UFO", xAODType.FlowElement, "UFO" ),
471 
472  # *****************************
473  # Tower (used only as ghosts atm)
474  JetInputConstit("Tower", xAODType.CaloCluster, "CaloCalFwdTopoTowers",
475  filterfn = lambda flags : ("CaloCalFwdTopoTowers" in flags.Input.Collections, "Towers as ghosts disabled as CaloCalFwdTopoTowers are not in the input")),
476 
477  # *****************************
478  # Track constituents (e.g. ghosts, no quality criteria, no TTVA)
479  JetInputConstit("Track", xAODType.TrackParticle, inputsFromContext("JetTracks")),
480  # Track constituents (e.g. track-jets, trackSelOptions quality criteria, TTVA)
481  JetInputConstit("PV0Track", xAODType.TrackParticle, inputsFromContext("JetTracks", prefix="PV0")),
482 
483  # LRT. Only used as ghosts
484  JetInputConstit("TrackLRT", xAODType.TrackParticle, "InDetLargeD0TrackParticles",
485  filterfn = _largeRTracksExist),
486 
487  # *****************************
488  # Muon segments. Only used as ghosts
489  JetInputConstit("MuonSegment", "MuonSegment", "MuonSegments", ),
490  # In Run 3, the MuonSegment container is split into associated and unassociated segments
491  JetInputConstit("UnAssocMuonSegment", "UnAssocMuonSegment", "UnAssocMuonSegments", ),
492 
493  # *****************************
494  # VR track jets as ghosts for large-R jets
495  # this could work :
496  #JetInputConstit("AntiKtVR30Rmax4Rmin02PV0TrackJet", xAODType.Jet, "AntiKtVR30Rmax4Rmin02PV0TrackJets"),
497  # BUT a better solution is to call
498  # registerAsInputConstit(AntiKtVR30Rmax4Rmin02PV0Track)
499  # at the place where the jetdef 'AntiKtVR30Rmax4Rmin02PV0Track' is defined : see StandardSmallRJets.py
500 
501  # *****************************
502  # Truth particles (see JetInputExternal declarations above for more details)
503  JetInputConstit("Truth", xAODType.TruthParticle, "JetInputTruthParticles" ),
504 
505  JetInputConstit("TruthWZ", xAODType.TruthParticle, "JetInputTruthParticlesNoWZ", jetinputtype="TruthWZ"),
506 
507  JetInputConstit("TruthDressedWZ", xAODType.TruthParticle, "JetInputTruthParticlesDressedWZ", jetinputtype="TruthDressedWZ"),
508 
509  JetInputConstit("TruthCharged", xAODType.TruthParticle, "JetInputTruthParticlesCharged", jetinputtype="TruthCharged"),
510 
511  #**************
512  # TEMPORARY : special inputs for EVTGEN jobs (as long as gen-level and reco-level definitions are not harmonized)
513  JetInputConstit("TruthGEN", xAODType.TruthParticle, "JetInputTruthParticlesGEN" , label="Truth"),
514 
515  JetInputConstit("TruthGENWZ", xAODType.TruthParticle, "JetInputTruthParticlesGENNoWZ", jetinputtype="TruthWZ", label="TruthWZ"),
516 
517 ]
518 
519 # define JetInputConstit for each flavour type :
520 for label in _truthFlavours:
521  _stdSeqList.append( JetInputConstit(label, xAODType.TruthParticle, "TruthLabel"+label ) )
522 
523 # Fill the stdConstitDic from the above list
524 for jc in _stdSeqList:
525  jc._locked = True
526  stdConstitDic[jc.name] = jc
527 
528 
529 
530 
532 
533 def _getPFOTool(*l):
534  """One Property of the CorrectPFO constit modifier is a tool.
535  we use this function as a placeholder, allowing to delay the intantiation of this property tool
536  to the time the modifier itself is instantiated.
537  """
538  from AthenaConfiguration.ComponentFactory import CompFactory
539  return CompFactory.getComp("CP::WeightPFOTool")("weightPFO")
540 
541 
542 
543 vtxKey = "PrimaryVertices"
544 tvaKey = "JetTrackVtxAssoc"
545 _stdModList = [
546  # Format is :
547  # JetConstitModifier( name , toolType, dictionnary_of_tool_properties )
548  # (see JetDefinition.py for more details)
549 
550  JetConstitModifier("Origin", "CaloClusterConstituentsOrigin", prereqs=[inputsFromContext("Vertices")]),
551  JetConstitModifier("EM", "ClusterAtEMScaleTool", ),
552  JetConstitModifier("LC", "", ),
553  # Particle flow
554  JetConstitModifier("CorrectPFO", "CorrectPFOTool",
555  # get the track properties from the context with wich jet will be configured with propFromContext
556  # See StandardJetContext.py for the default values.
557  prereqs=[inputsFromContext("Vertices")],
558  properties=dict(VertexContainerKey=propFromContext("Vertices"),
559  WeightPFOTool= _getPFOTool,
560  DoByVertex = lambda jdef, _: jdef.byVertex) ),
561 
562  JetConstitModifier("CHS", "ChargedHadronSubtractionTool",
563  # get the track properties from the context with wich jet will be configured with propFromContext
564  # See StandardJetContext.py for the default values.
565  # Note : Jet trigger still needs an older CHS config, hence the cheks to jetdef.context below...
566  # When jet trigger migrate and follow the offline settings all this can be simplified.
567  prereqs= lambda parentjdef : [inputsFromContext("Vertices"),] + ( [inputsFromContext("TVA")] if parentjdef.context=='default' else []) ,
568  properties=dict(VertexContainerKey=propFromContext("Vertices"),
569  TrackVertexAssociation=propFromContext("TVA"),
570  UseTrackToVertexTool= lambda jdef,_: jdef.context in ['default', 'HL_LHC'],
571  DoByVertex = lambda jdef, _: jdef.byVertex
572  )),
573 
574  # Pileup suppression
575  JetConstitModifier("Vor", "VoronoiWeightTool", properties=dict(doSpread=False, nSigma=0) ),
576  JetConstitModifier("CS", "ConstituentSubtractorTool", properties=dict(MaxEta=4.5 ) ),
577  JetConstitModifier("SK", "SoftKillerWeightTool",),
578 
579 ]
580 
581 # Fill the stdContitModifDic from the above list
582 for ji in _stdModList:
583  ji._locked = True
584  stdContitModifDic[ji.name] = ji
python.CaloRecoConfig.CaloRecoCfg
def CaloRecoCfg(flags, clustersname=None)
Definition: CaloRecoConfig.py:9
python.StandardJetConstits.isMC
def isMC(flags)
Definition: StandardJetConstits.py:44
python.JetDefinition.JetConstitModifier
Definition: JetDefinition.py:626
python.StandardJetConstits._unassocMuonSegmentInputsExist
def _unassocMuonSegmentInputsExist(flags)
Definition: StandardJetConstits.py:118
python.JetDefinition.JetInputExternal
Definition: JetDefinition.py:347
python.StandardJetConstits._muonSegmentInputsExist
def _muonSegmentInputsExist(flags)
Definition: StandardJetConstits.py:109
python.StandardJetConstits.standardReco
def standardReco(input)
Definition: StandardJetConstits.py:50
python.StandardJetContext.inputsFromContext
def inputsFromContext(inputKey, prefix="", suffix="")
Definition: StandardJetContext.py:112
ParticleJetToolsConfig.isAnalysisRelease
def isAnalysisRelease()
Definition: ParticleJetToolsConfig.py:19
hist_file_dump.f
f
Definition: hist_file_dump.py:140
python.JetDefinition.JetInputConstitSeq
Definition: JetDefinition.py:570
python.StandardJetContext.propFromContext
def propFromContext(propName)
Definition: StandardJetContext.py:100
python.TrackRecoConfig.InDetTrackRecoCfg
def InDetTrackRecoCfg(flags)
Main ID tracking config #####################.
Definition: TrackRecoConfig.py:804
python.StandardJetConstits._trackParticleInputsExist
def _trackParticleInputsExist(flags)
List of standard input sources for jets.
Definition: StandardJetConstits.py:99
python.Utilities.ldict
Definition: Utilities.py:139
python.JetDefinition.JetInputConstit
Definition: JetDefinition.py:494
python.StandardJetConstits._largeRTracksExist
def _largeRTracksExist(flags)
Definition: StandardJetConstits.py:130
python.StandardJetConstits._getPFOTool
def _getPFOTool(*l)
List of standard constituent modifiers.
Definition: StandardJetConstits.py:533
MuonReconstructionConfig.MuonReconstructionCfg
def MuonReconstructionCfg(flags)
Definition: MuonReconstructionConfig.py:139
PFCfg
Definition: PFCfg.py:1