ATLAS Offline Software
StandardJetConstits.py
Go to the documentation of this file.
1 
2 # Copyright (C) 2002-2023 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 relase
115  return False, warning
116  return flags.Reco.EnableCombinedMuon, warning
117 
119  warning = "Large radius tracking did not run"
120  if "InDetLargeD0TrackParticles" in flags.Input.Collections:
121  # the conditions here weren't the same as above: apparently we
122  # require _both_ the input condition _and_ the tracking
123  # flag. I don't know if this is what we want but it keeps with
124  # the existing behavior.
125  #
126  # Again, the isAnalysisRelease function is needed to short
127  # circuit the flag check, since flags.Tracking doesn't exist
128  # in analysis releases.
129  if isAnalysisRelease() or flags.Tracking.doLargeD0:
130  return True, warning
131  return False, warning
132 
133 
134 _stdInputList = [
135  # Format is :
136  # JetInputExternal( containername , containerType, ...optionnal parameters... )
137  # When defined, algoBuilder is a function returning the actual alg building the input.
138  # it will be called as : algoBuilder(jetdef, spec) where jetdef is the parent JetDefinition
139 
140  # *****************************
141  JetInputExternal("CaloCalTopoClusters", xAODType.CaloCluster, algoBuilder= standardReco("CaloClusters") ),
142 
143  JetInputExternal("HLT_TopoCaloClustersFS", xAODType.CaloCluster ),
144 
145  # *****************************
146  JetInputExternal("JetETMissParticleFlowObjects", xAODType.FlowElement, algoBuilder = standardReco("PFlow"),
147  prereqs = [inputsFromContext("Tracks"), "input:CaloCalTopoClusters"],
148  ),
149 
150  JetInputExternal("GlobalParticleFlowObjects", xAODType.FlowElement,
151  algoBuilder = inputcfg.buildPFlowSel,
152  prereqs = ["input:JetETMissParticleFlowObjects", ],
153  ),
154 
155  JetInputExternal("GlobalParticleFlowObjects_noElectrons", xAODType.FlowElement,
156  algoBuilder = inputcfg.buildPFlowSel_noElectrons,
157  prereqs = ["input:JetETMissParticleFlowObjects", ],
158  ),
159 
160  JetInputExternal("GlobalParticleFlowObjects_noMuons", xAODType.FlowElement,
161  algoBuilder = inputcfg.buildPFlowSel_noMuons,
162  prereqs = ["input:JetETMissParticleFlowObjects", ],
163  ),
164 
165  JetInputExternal("GlobalParticleFlowObjects_noLeptons", xAODType.FlowElement,
166  algoBuilder = inputcfg.buildPFlowSel_noLeptons,
167  prereqs = ["input:JetETMissParticleFlowObjects", ],
168  ),
169 
170  JetInputExternal("GlobalParticleFlowObjects_tauSeedEleRM", xAODType.FlowElement,
171  algoBuilder = inputcfg.buildPFlowSel_tauSeedEleRM,
172  prereqs = ["input:JetETMissParticleFlowObjects", ],
173  ),
174 
175  # *****************************
176  JetInputExternal("InDetTrackParticles", xAODType.TrackParticle,
177  algoBuilder = standardReco("Tracks"),
178  filterfn = _trackParticleInputsExist
179  ),
180  # alternative ID tracks for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
181  JetInputExternal("InDetTrackParticles_EleRM", xAODType.TrackParticle),
182 
183  JetInputExternal("PrimaryVertices", xAODType.Vertex,
184  prereqs = [inputsFromContext("Tracks")],
185  filterfn = lambda flags : (flags.Beam.Type == BeamType.Collisions, f"No vertexing with {flags.Beam.Type}"), # should be changed when a reliable "EnableVertexing" flag exists
186  ),
187  # No quality criteria are applied to the tracks, used for ghosts for example
188  JetInputExternal("JetSelectedTracks", xAODType.TrackParticle,
189  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
190  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=False )
191  ),
192  # alternative JetSelected tracks for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
193  JetInputExternal("JetSelectedTracks_EleRM", xAODType.TrackParticle,
194  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
195  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=False )
196  ),
197  # alternative ID tracks for ftf (FS HLT tracking)
198  JetInputExternal("JetSelectedTracks_ftf", xAODType.TrackParticle,
199  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
200  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=False )
201  ),
202  # alternative ID tracks for roiftf (jet super-RoI HLT tracking)
203  JetInputExternal("JetSelectedTracks_roiftf", xAODType.TrackParticle,
204  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
205  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=False )
206  ),
207 
208  # Apply quality criteria defined via trackSelOptions in jdef.context (used e.g. for track-jets)
209  JetInputExternal("JetSelectedTracks_trackSelOpt", xAODType.TrackParticle,
210  prereqs= [ inputsFromContext("Tracks") ], # in std context, this is InDetTrackParticles (see StandardJetContext)
211  algoBuilder = lambda jdef,_ : jrtcfg.getTrackSelAlg(jdef, trackSelOpt=True )
212  ),
213  JetInputExternal("JetTrackUsedInFitDeco", xAODType.TrackParticle,
214  prereqs= [ inputsFromContext("Tracks") , # in std context, this is InDetTrackParticles (see StandardJetContext)
215  inputsFromContext("Vertices")],
216  algoBuilder = inputcfg.buildJetTrackUsedInFitDeco
217  ),
218  JetInputExternal("JetTrackVtxAssoc", xAODType.TrackParticle,
219  algoBuilder =
220  lambda jdef, _ : jrtcfg.getJetTrackVtxAlg(
221  jdef._contextDic,
222  algname="jetTVA" if jdef.context in ["HL_LHC", "default", "notrk", ""] else f"jetTVA_{jdef.context}",
223  WorkingPoint="Nonprompt_All_MaxWeight"
224  ),
225  # previous default for ttva : WorkingPoint="Custom", d0_cut= 2.0, dzSinTheta_cut= 2.0
226  prereqs = ["input:JetTrackUsedInFitDeco", inputsFromContext("Vertices")],
227  ),
228  # alternative JetTrackVtxAssoc for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
229  JetInputExternal("JetTrackVtxAssoc_EleRM", xAODType.TrackParticle,
230  algoBuilder = lambda jdef,_ : jrtcfg.getJetTrackVtxAlg(jdef._contextDic, algname="jetTVA_" + jdef.context, WorkingPoint="Nonprompt_All_MaxWeight"),
231  # previous default for ttva : WorkingPoint="Custom", d0_cut= 2.0, dzSinTheta_cut= 2.0
232  prereqs = ["input:JetTrackUsedInFitDeco", inputsFromContext("Vertices") ]
233  ),
234  JetInputExternal("JetTrackVtxAssoc_ftf", xAODType.TrackParticle,
235  algoBuilder = lambda jdef,_ : jrtcfg.getJetTrackVtxAlg(jdef._contextDic, algname="jetTVA_" + jdef.context, WorkingPoint="Nonprompt_All_MaxWeight"),
236  # previous default for ttva : WorkingPoint="Custom", d0_cut= 2.0, dzSinTheta_cut= 2.0
237  prereqs = ["input:JetTrackUsedInFitDeco", inputsFromContext("Vertices") ]
238  ),
239  JetInputExternal("JetTrackVtxAssoc_roiftf", xAODType.TrackParticle,
240  algoBuilder = lambda jdef,_ : jrtcfg.getJetTrackVtxAlg(jdef._contextDic, algname="jetTVA_" + jdef.context, WorkingPoint="Nonprompt_All_MaxWeight"),
241  # previous default for ttva : WorkingPoint="Custom", d0_cut= 2.0, dzSinTheta_cut= 2.0
242  prereqs = ["input:JetTrackUsedInFitDeco", inputsFromContext("Vertices") ]
243  ),
244  # *****************************
245  JetInputExternal("EventDensity", "EventShape", algoBuilder = inputcfg.buildEventShapeAlg,
246  containername = lambda jetdef, specs : (specs or "")+"Kt4"+jetdef.inputdef.label+"EventShape",
247  prereqs = lambda jetdef : ["input:"+jetdef.inputdef.name] # this will force the input to be build *before* the EventDensity alg.
248  ),
249  # alternative EventDensity for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
250  JetInputExternal("EleRM_EventDensity", "EventShape", algoBuilder = inputcfg.buildEventShapeAlg,
251  containername = lambda jetdef, specs : (specs or "")+"Kt4"+jetdef.inputdef.label+"EventShape",
252  prereqs = lambda jetdef : ["input:"+jetdef.inputdef.name],
253  specs = "EleRM_"
254  ),
255  JetInputExternal("HLT_EventDensity", "EventShape", algoBuilder = inputcfg.buildEventShapeAlg,
256  containername = lambda jetdef, specs : (specs or "")+"Kt4"+jetdef.inputdef.label+"EventShape",
257  prereqs = lambda jetdef : ["input:"+jetdef.inputdef.name], # this will force the input to be build *before* the EventDensity alg.
258  specs = 'HLT_'
259  ),
260 
261  # *****************************
262  JetInputExternal("MuonSegments", "MuonSegment", algoBuilder=standardReco("Muons"),
263  prereqs = [inputsFromContext("Tracks")], # most likely wrong : what exactly do we need to build muon segments ?? (and not necessarily full muons ...)
264  filterfn = _muonSegmentInputsExist
265  ),
266 
267 
268  # *****************************
269  # Truth particles from the hard scatter vertex prior to Geant4 simulation.
270  # Neutrinos and muons are omitted; all other stable particles are included.
271  JetInputExternal("JetInputTruthParticles", xAODType.TruthParticle,
272  algoBuilder = inputcfg.buildJetInputTruth, filterfn=isMC ),
273 
274  # Truth particles from the hard scatter vertex prior to Geant4 simulation.
275  # Prompt electrons, muons and neutrinos are excluded, all other stable particles
276  # are included, in particular leptons and neutrinos from hadron decays.
277  JetInputExternal("JetInputTruthParticlesNoWZ", xAODType.TruthParticle,
278  algoBuilder = inputcfg.buildJetInputTruth, filterfn=isMC,specs="NoWZ"),
279 
280  # Truth particles from the hard scatter vertex prior to Geant4 simulation.
281  # Similar configuration as for JetInputTruthParticlesNoWZ but with slightly
282  # different photon dressing option
283  JetInputExternal("JetInputTruthParticlesDressedWZ", xAODType.TruthParticle,
284  algoBuilder = inputcfg.buildJetInputTruth, filterfn=isMC,specs="DressedWZ"),
285 
286  # Truth particles from the hard scatter vertex prior to Geant4 simulation.
287  # Only charged truth particles are used
288  JetInputExternal("JetInputTruthParticlesCharged", xAODType.TruthParticle,
289  algoBuilder = inputcfg.buildJetInputTruth, filterfn=isMC,specs="Charged"),
290 
291 
292  #**************
293  # TEMPORARY : special inputs for EVTGEN jobs (as long as gen-level and reco-level definitions are not harmonized)
294  JetInputExternal("JetInputTruthParticlesGEN", xAODType.TruthParticle,
295  algoBuilder = inputcfg.buildJetInputTruthGEN, filterfn=isMC ),
296 
297  JetInputExternal("JetInputTruthParticlesGENNoWZ", xAODType.TruthParticle,
298  algoBuilder = inputcfg.buildJetInputTruthGEN, filterfn=isMC,specs="NoWZ"),
299  #**************
300 
301 
302  JetInputExternal("PV0JetSelectedTracks", xAODType.TrackParticle,
303  prereqs=["input:JetSelectedTracks_trackSelOpt", "input:JetTrackUsedInFitDeco"],
304  algoBuilder = inputcfg.buildPV0TrackSel ),
305 
306 
307  JetInputExternal("UFOCSSK", xAODType.FlowElement,
308  # in analysis releases, or if we have UFOCSSK in inputs don't declare unneeded dependencies which could fail the config.
309  prereqs =lambda parentjdef : [] if (isAnalysisRelease() or 'UFOCSSK' in parentjdef._cflags.Input.Collections ) else ['input:GPFlowCSSK'],
310  filterfn = lambda flag : ( (not isAnalysisRelease() or 'UFOCSSK' in flag.Input.Collections), "Can't build UFO in Analysis projects and not UFOCSSK in input") ,
311  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlowCSSK'])
312  ),
313 
314  JetInputExternal("UFOCSSK_noElectrons", xAODType.FlowElement,
315  prereqs =lambda parentjdef : [] if (isAnalysisRelease() or 'UFOCSSK_noElectrons' in parentjdef._cflags.Input.Collections ) else ['input:GPFlowCSSK_noElectrons'],
316  filterfn = lambda flag : ( (not isAnalysisRelease() or 'UFOCSSK_noElectrons' in flag.Input.Collections), "Can't build UFO in Analysis projects and not UFOCSSK in input") ,
317  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlowCSSK_noElectrons'])
318  ),
319 
320  JetInputExternal("UFOCSSK_noMuons", xAODType.FlowElement,
321  prereqs =lambda parentjdef : [] if (isAnalysisRelease() or 'UFOCSSK_noMuons' in parentjdef._cflags.Input.Collections ) else ['input:GPFlowCSSK_noMuons'],
322  filterfn = lambda flag : ( (not isAnalysisRelease() or 'UFOCSSK_noMuons' in flag.Input.Collections), "Can't build UFO in Analysis projects and not UFOCSSK in input") ,
323  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlowCSSK_noMuons'])
324  ),
325 
326  JetInputExternal("UFOCSSK_noLeptons", xAODType.FlowElement,
327  # in analysis releases, or if we have UFOCSSK in inputs don't declare unneeded dependencies which could fail the config.
328  prereqs =lambda parentjdef : [] if (isAnalysisRelease() or 'UFOCSSK_noLeptons' in parentjdef._cflags.Input.Collections ) else ['input:GPFlowCSSK_noLeptons'],
329  filterfn = lambda flag : ( (not isAnalysisRelease() or 'UFOCSSK_noLeptons' in flag.Input.Collections), "Can't build UFO in Analysis projects and not UFOCSSK in input") ,
330  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlowCSSK_noLeptons'])
331  ),
332 
333  JetInputExternal("UFO", xAODType.FlowElement,
334  prereqs = ['input:GPFlow'],
335  algoBuilder = lambda jdef,_ : tcccfg.runUFOReconstruction(jdef._cflags, stdConstitDic['GPFlow'])
336  ),
337 
338 ]
339 
340 
341 _truthFlavours = ["BHadronsInitial", "BHadronsFinal", "BQuarksFinal",
342  "CHadronsInitial", "CHadronsFinal", "CQuarksFinal",
343  "TausFinal",
344  "WBosons", "ZBosons", "HBosons", "TQuarksFinal",
345  "Partons",]
346 for label in _truthFlavours:
347  # re-use the main truth input definition :
348  _stdInputList.append( JetInputExternal("TruthLabel"+label, xAODType.TruthParticle,
349  algoBuilder = inputcfg.buildLabelledTruth,
350  filterfn=isMC, specs = label ) )
351 
352 
353 
354 # Fill the stdInputExtDic from the above list
355 for ji in _stdInputList:
356  ji._locked = True # lock the definitions so we have unmutable references !
357  stdInputExtDic[ji.name] = ji
358 
359 
360 
361 
362 
363 
364 
365 
366 
369 _stdSeqList = [
370  # Format is typically :
371  # JetInputConstitSeq( name , input_cont_type, list_of_modifiers, inputcontainer, outputcontainer )
372  # or
373  # JetInputConstit( name, input_cont_type, containername)
374  # see JetDefinition.py for details.
375 
376  # *****************************
377  # Cluster constituents : the first one is a relic used for isolation, and might disappear soon
378  JetInputConstitSeq("EMTopo", xAODType.CaloCluster, ["EM"],
379  "CaloCalTopoClusters", "EMTopoClusters", jetinputtype="EMTopo",
380  ),
381  JetInputConstitSeq("LCTopo", xAODType.CaloCluster, ["LC"],
382  "CaloCalTopoClusters", "LCTopoClusters", jetinputtype="LCTopo",
383  ),
384  JetInputConstitSeq("EMTopoOrigin", xAODType.CaloCluster, ["EM","Origin"],
385  "CaloCalTopoClusters", "EMOriginTopoClusters", jetinputtype="EMTopo",
386  ),
387  JetInputConstitSeq("LCTopoOrigin",xAODType.CaloCluster, ["LC","Origin"],
388  "CaloCalTopoClusters", "LCOriginTopoClusters", jetinputtype="LCTopo",
389  ),
390  # alternative LCTopoOrigin for AntiKt4LCTopo_EleRM jets used for the electron removed tau reconstruction
391  JetInputConstitSeq("LCTopoOrigin_EleRM",xAODType.CaloCluster, ["LC","Origin"],
392  "CaloCalTopoClusters_EleRM", "LCOriginTopoClusters_EleRM", jetinputtype="LCTopo",
393  ),
394  JetInputConstitSeq("LCTopoCSSK", xAODType.CaloCluster, ["LC","Origin","CS","SK"],
395  "CaloCalTopoClusters", "LCOriginTopoCSSK", jetinputtype="LCTopo",
396  ),
397 
398 
399 
400 
401  # *****************************
402  # EM-scale particle flow objects with charged hadron subtraction
403  # For now we don't specify a scale, as only one works well, but
404  # this could be incorporated into the naming scheme and config
405  JetInputConstitSeq("EMPFlow", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'JetETMissParticleFlowObjects', 'CHSParticleFlowObjects'),
406 
407  # GPFlow are the same than EMPFlow except they have pflow linked to elec or muons filtered out.
408  JetInputConstitSeq("GPFlow", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects', 'CHSGParticleFlowObjects',
409  label='EMPFlow'),
410 
411  JetInputConstitSeq("GPFlow_noElectrons", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects_noElectrons', 'CHSGParticleFlowObjects_noElectrons',
412  label='EMPFlow_noElectrons'),
413 
414  JetInputConstitSeq("GPFlow_noMuons", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects_noMuons', 'CHSGParticleFlowObjects_noMuons',
415  label='EMPFlow_noMuons'),
416 
417  JetInputConstitSeq("GPFlow_noLeptons", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects_noLeptons', 'CHSGParticleFlowObjects_noLeptons',
418  label='EMPFlow_noLeptons'),
419 
420  #GPFlow with tau seed electrons removed
421  JetInputConstitSeq("GPFlow_tauSeedEleRM", xAODType.FlowElement,["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects_tauSeedEleRM', 'CHSGParticleFlowObjects_tauSeedEleRM',
422  label='EMPFlow_tauSeedEleRM'),
423 
424 
425  # Particle Flow Objects with several neutral PFO copies for by-vertex reconstruction
426  JetInputConstitSeq("GPFlowByVtx", xAODType.FlowElement, ["CorrectPFO", "CHS"] , 'GlobalParticleFlowObjects', 'CHSByVtxGParticleFlowObjects',
427  label='EMPFlowByVertex', byVertex=True),
428 
429  # Particle Flow Objects with Constituent Subtraction + SoftKiller
430  JetInputConstitSeq("EMPFlowCSSK", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
431  'JetETMissParticleFlowObjects', 'CSSKParticleFlowObjects', jetinputtype="EMPFlow"),
432 
433  JetInputConstitSeq("GPFlowCSSK", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
434  'GlobalParticleFlowObjects', 'CSSKGParticleFlowObjects', jetinputtype="EMPFlow", label='EMPFlowCSSK'),
435 
436  JetInputConstitSeq("GPFlowCSSK_noElectrons", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
437  'GlobalParticleFlowObjects_noElectrons', 'CSSKGParticleFlowObjects_noElectrons', jetinputtype="EMPFlow", label='EMPFlowCSSK_noElectrons'),
438 
439  JetInputConstitSeq("GPFlowCSSK_noMuons", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
440  'GlobalParticleFlowObjects_noMuons', 'CSSKGParticleFlowObjects_noMuons', jetinputtype="EMPFlow", label='EMPFlowCSSK_noMuons'),
441 
442  JetInputConstitSeq("GPFlowCSSK_noLeptons", xAODType.FlowElement,["CorrectPFO", "CS","SK", "CHS"] ,
443  'GlobalParticleFlowObjects_noLeptons', 'CSSKGParticleFlowObjects_noLeptons', jetinputtype="EMPFlow", label='EMPFlowCSSK_noLeptons'),
444 
445  JetInputConstit("UFOCSSK", xAODType.FlowElement, "UFOCSSK" ),
446 
447  JetInputConstit("UFOCSSK_noElectrons", xAODType.FlowElement, "UFOCSSK_noElectrons" ),
448 
449  JetInputConstit("UFOCSSK_noMuons", xAODType.FlowElement, "UFOCSSK_noMuons" ),
450 
451  JetInputConstit("UFOCSSK_noLeptons", xAODType.FlowElement, "UFOCSSK_noLeptons" ),
452 
453  JetInputConstit("UFO", xAODType.FlowElement, "UFO" ),
454 
455  # *****************************
456  # Tower (used only as ghosts atm)
457  JetInputConstit("Tower", xAODType.CaloCluster, "CaloCalFwdTopoTowers",
458  filterfn = lambda flags : ("CaloCalFwdTopoTowers" in flags.Input.Collections, "Towers as ghosts disabled as CaloCalFwdTopoTowers are not in the input")),
459 
460  # *****************************
461  # Track constituents (e.g. ghosts, no quality criteria, no TTVA)
462  JetInputConstit("Track", xAODType.TrackParticle, inputsFromContext("JetTracks")),
463  # Track constituents (e.g. track-jets, trackSelOptions quality criteria, TTVA)
464  JetInputConstit("PV0Track", xAODType.TrackParticle, inputsFromContext("JetTracks", prefix="PV0")),
465 
466  # LRT. Only used as ghosts
467  JetInputConstit("TrackLRT", xAODType.TrackParticle, "InDetLargeD0TrackParticles",
468  filterfn = _largeRTracksExist),
469 
470  # *****************************
471  # Muon segments. Only used as ghosts
472  JetInputConstit("MuonSegment", "MuonSegment", "MuonSegments", ),
473 
474  # *****************************
475  # VR track jets as ghosts for large-R jets
476  # this could work :
477  #JetInputConstit("AntiKtVR30Rmax4Rmin02PV0TrackJet", xAODType.Jet, "AntiKtVR30Rmax4Rmin02PV0TrackJets"),
478  # BUT a better solution is to call
479  # registerAsInputConstit(AntiKtVR30Rmax4Rmin02PV0Track)
480  # at the place where the jetdef 'AntiKtVR30Rmax4Rmin02PV0Track' is defined : see StandardSmallRJets.py
481 
482  # *****************************
483  # Truth particles (see JetInputExternal declarations above for more details)
484  JetInputConstit("Truth", xAODType.TruthParticle, "JetInputTruthParticles" ),
485 
486  JetInputConstit("TruthWZ", xAODType.TruthParticle, "JetInputTruthParticlesNoWZ", jetinputtype="TruthWZ"),
487 
488  JetInputConstit("TruthDressedWZ", xAODType.TruthParticle, "JetInputTruthParticlesDressedWZ", jetinputtype="TruthDressedWZ"),
489 
490  JetInputConstit("TruthCharged", xAODType.TruthParticle, "JetInputTruthParticlesCharged", jetinputtype="TruthCharged"),
491 
492  #**************
493  # TEMPORARY : special inputs for EVTGEN jobs (as long as gen-level and reco-level definitions are not harmonized)
494  JetInputConstit("TruthGEN", xAODType.TruthParticle, "JetInputTruthParticlesGEN" , label="Truth"),
495 
496  JetInputConstit("TruthGENWZ", xAODType.TruthParticle, "JetInputTruthParticlesGENNoWZ", jetinputtype="TruthWZ", label="TruthWZ"),
497 
498 ]
499 
500 # define JetInputConstit for each flavour type :
501 for label in _truthFlavours:
502  _stdSeqList.append( JetInputConstit(label, xAODType.TruthParticle, "TruthLabel"+label ) )
503 
504 # Fill the stdConstitDic from the above list
505 for jc in _stdSeqList:
506  jc._locked = True
507  stdConstitDic[jc.name] = jc
508 
509 
510 
511 
513 
514 def _getPFOTool(*l):
515  """One Property of the CorrectPFO constit modifier is a tool.
516  we use this function as a placeholder, allowing to delay the intantiation of this property tool
517  to the time the modifier itself is instantiated.
518  """
519  from AthenaConfiguration.ComponentFactory import CompFactory
520  return CompFactory.getComp("CP::WeightPFOTool")("weightPFO")
521 
522 
523 
524 vtxKey = "PrimaryVertices"
525 tvaKey = "JetTrackVtxAssoc"
526 _stdModList = [
527  # Format is :
528  # JetConstitModifier( name , toolType, dictionnary_of_tool_properties )
529  # (see JetDefinition.py for more details)
530 
531  JetConstitModifier("Origin", "CaloClusterConstituentsOrigin", prereqs=[inputsFromContext("Vertices")]),
532  JetConstitModifier("EM", "ClusterAtEMScaleTool", ),
533  JetConstitModifier("LC", "", ),
534  # Particle flow
535  JetConstitModifier("CorrectPFO", "CorrectPFOTool",
536  # get the track properties from the context with wich jet will be configured with propFromContext
537  # See StandardJetContext.py for the default values.
538  prereqs=[inputsFromContext("Vertices")],
539  properties=dict(VertexContainerKey=propFromContext("Vertices"),
540  WeightPFOTool= _getPFOTool,
541  DoByVertex = lambda jdef, _: jdef.byVertex) ),
542 
543  JetConstitModifier("CHS", "ChargedHadronSubtractionTool",
544  # get the track properties from the context with wich jet will be configured with propFromContext
545  # See StandardJetContext.py for the default values.
546  # Note : Jet trigger still needs an older CHS config, hence the cheks to jetdef.context below...
547  # When jet trigger migrate and follow the offline settings all this can be simplified.
548  prereqs= lambda parentjdef : [inputsFromContext("Vertices"),] + ( [inputsFromContext("TVA")] if parentjdef.context=='default' else []) ,
549  properties=dict(VertexContainerKey=propFromContext("Vertices"),
550  TrackVertexAssociation=propFromContext("TVA"),
551  UseTrackToVertexTool= lambda jdef,_: jdef.context in ['default', 'HL_LHC'],
552  DoByVertex = lambda jdef, _: jdef.byVertex
553  )),
554 
555  # Pileup suppression
556  JetConstitModifier("Vor", "VoronoiWeightTool", properties=dict(doSpread=False, nSigma=0) ),
557  JetConstitModifier("CS", "ConstituentSubtractorTool", properties=dict(MaxEta=4.5 ) ),
558  JetConstitModifier("SK", "SoftKillerWeightTool",),
559 
560 ]
561 
562 # Fill the stdContitModifDic from the above list
563 for ji in _stdModList:
564  ji._locked = True
565  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.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:118
python.StandardJetConstits._getPFOTool
def _getPFOTool(*l)
List of standard constituent modifiers.
Definition: StandardJetConstits.py:514
MuonReconstructionConfig.MuonReconstructionCfg
def MuonReconstructionCfg(flags)
Definition: MuonReconstructionConfig.py:139
PFCfg
Definition: PFCfg.py:1