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