4 JetRecConfig: A helper module for configuring jet reconstruction
6 The functions defined here turn JetDefinition object into ComponentAccumulator or list of algs fully configured
7 and ready to be inserted in the framework sequence.
9 Author: TJ Khoo, P-A Delsart
13 from AthenaCommon
import Logging
14 jetlog = Logging.logging.getLogger(
'JetRecConfig')
16 from ROOT
import xAODType
19 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
20 from AthenaConfiguration.ComponentFactory
import CompFactory
23 from JetRecConfig.JetDefinition
import JetDefinition, JetInputConstitSeq, JetInputConstit, JetInputExternal
24 from JetRecConfig.JetGrooming
import GroomingDefinition
25 from JetRecConfig.DependencyHelper
import solveDependencies, solveGroomingDependencies, aliasToModDef
26 from JetRecConfig.JetConfigFlags
import jetInternalFlags
29 __all__ = [
"JetRecCfg",
"JetInputCfg"]
37 def JetRecCfg( flags, jetdef, returnConfiguredDef=False):
38 """Top-level function for running jet finding or grooming.
40 This returns a ComponentAccumulator that can be merged with others
41 from elsewhere in the job and which provides everything needed to
42 reconstruct one jet collection.
45 - jetdef : jet or grooming definition
46 - flags : the configuration flags instance, mainly for input file
47 peeking such that we don't attempt to reproduce stuff that's already
48 in the input file. And also to be able to invoke building of inputs outside of Jet domain during reco from RAW/RDO.
49 - returnConfiguredDef : is for debugging. It will also returns the cloned JetDefinition which contains the calculated dependencies.
53 sequenceName = jetdef.fullname()
54 jetlog.info(
"******************")
55 jetlog.info(
"Setting up to find {0}".
format(sequenceName))
58 from AthenaCommon.CFElements
import parOR
59 components.addSequence(
parOR(sequenceName) )
62 if isinstance(jetdef, JetDefinition):
64 elif isinstance(jetdef, GroomingDefinition):
68 if flags.Concurrency.NumThreads <= 0:
69 jetlog.info(
"Reordering algorithms in sequence {0}".
format(sequenceName))
75 if isinstance(a, ComponentAccumulator):
78 components.addEventAlgo( a , sequenceName = sequenceName )
80 if returnConfiguredDef:
return components, jetdef_i
85 """Returns a ComponentAccumulator containing algs needed to build inputs to jet finding as defined by jetOrConstitdef
87 jetOrConstitdef can either be
88 * a JetDefinition : this happens when called from JetRecCfg, then the jetdef._prereqDic/Order are used.
89 * a JetInputConstit : to allow scheduling the corresponding constituents algs independently of any jet alg.
91 context is only used if jetOrConstitdef is not a JetDefinition and must refer to a context in StandardJetContext
99 if isinstance(a, ComponentAccumulator):
102 components.addEventAlgo(a)
107 """Builds a ComponentAccumulator for creating PseudoJetContainer needed by jetdef.
108 THIS updates jetdef._internalAtt['finalPJContainer']
112 for pjalg
in pjalglist:
113 components.addEventAlgo(pjalg)
124 """ Create the algorithms necessary to build the jet collection defined by jetdef.
126 This internally finds all the dependencies declared into jetdef (through input, ghosts & modifiers)
127 and returns a list of all necessary algs.
129 if returnConfiguredDef==True, also returns the fully configured clone of jetdef containing solved dependencies (debugging)
131 monTool is to allow the trigger config to pass a monitoring tool.
133 returns a list containing either algs or ComponentAccumulator
134 (ComponentAccumulator occurs only (?) in reco from RDO/RAW when we need to build externals such as clusters or tracks : in this case we call the main config functions from external packages)
148 if returnConfiguredDef:
165 jetlog.info(
"Scheduled JetAlgorithm instance \"jetalg_{0}\"".
format(jetdef_i.fullname()))
167 if returnConfiguredDef:
168 return algs, jetdef_i
172 """Instantiate and schedule all the algorithms needed to run the grooming alg 'groomdef' and
173 add them in the ComponentAccumulator 'components'
175 This function is meant to be called from the top-level JetRecConfig.JetRecCfg
176 (groomdef is expected to be non locked and will be modified).
178 monTool is to allow the trigger config to pass a monitoring tool.
187 for prereq
in groomdef_i._prereqOrder:
189 if len(prereq.split(
':')) > 2:
191 reqType, reqKey = prereq.split(
':')
193 groomdef_i.ungroomeddef.ghostdefs.append(reqKey)
194 elif reqType.endswith(
'input:') :
195 groomdef_i.ungroomeddef.extrainputs.append(reqKey)
197 jetlog.info(
"Scheduling parent alg {} for {} ".
format(groomdef.ungroomeddef.fullname(), groomdef.fullname()))
202 algs, ungroomeddef_i =
getJetDefAlgs(flags, groomdef_i.ungroomeddef ,
True)
203 groomdef_i._ungroomeddef = ungroomeddef_i
211 jetlog.info(
"Scheduled JetAlgorithm instance \"jetalg_{0}\"".
format(groomdef_i.fullname()))
213 if returnConfiguredDef:
return algs, groomdef_i
217 def getJetAlgs(flags, jetdef, returnConfiguredDef=False, monTool=None):
219 if isinstance(jetdef, JetDefinition):
221 elif isinstance(jetdef, GroomingDefinition):
222 func = getJetGroomAlgs
224 return func(flags, jetdef, returnConfiguredDef, monTool)
235 """ Builds the list of configured PseudoJetAlgorithm needed for this jetdef.
236 THIS updates jetdef._internalAtt['finalPJContainer']
237 (this function is factorized out of PseudoJetCfg so it can be used standalone in the trigger config)
240 constitpjalg =
getConstitPJGAlg(jetdef.inputdef , suffix=
None , flags=jetdef._cflags, parent_jetdef = jetdef)
242 finalPJContainer =
str(constitpjalg.OutputContainer)
243 pjalglist = [constitpjalg]
246 ghostlist = [ key
for key
in jetdef._prereqOrder
if key.startswith(
'ghost:')]
249 pjContNames = [finalPJContainer]
250 for ghostkey
in sorted(ghostlist):
251 ghostdef = jetdef._prereqDic[ghostkey]
253 pjalglist.append(ghostpjalg)
254 pjContNames.append(
str(ghostpjalg.OutputContainer) )
258 finalPJContainer =
str(finalPJContainer)+
"_merged"+mergeId
259 mergerName =
"PJMerger_id"+mergeId
260 mergeAlg =CompFactory.PseudoJetMerger(
262 InputPJContainers = pjContNames,
263 OutputContainer = finalPJContainer,
265 pjalglist.append(mergeAlg)
268 jetdef._internalAtt[
'finalPJContainer'] = finalPJContainer
272 _mergedPJContainers = dict()
274 """returns a simple unique ID for the list of PseudoJet container in pjList"""
275 t = tuple(
str(n)
for n
in pjList)
276 currentSize = len(_mergedPJContainers)
277 return str(_mergedPJContainers.setdefault(t, currentSize))
280 def getInputAlgs(jetOrConstitdef, flags, context="default", monTool=None):
281 """Returns the list of configured algs needed to build inputs to jet finding as defined by jetOrConstitdef
283 jetOrConstitdef can either be
284 * a JetDefinition : this happens when called from JetRecCfg or getJetDefAlgs then the jetdef._prereqDic/Order are used.
285 * a JetInputConstit : to allow scheduling the corresponding constituents algs independently of any jet alg.
287 context is only used if jetOrConstitdef is not a JetDefinition and must refer to a context in StandardJetContext.
289 The returned list may contain several algs, including constituent modifications algs, track selection, copying of
290 input truth particles and event density calculations
291 It may also contain ComponentAccumulator, only (?) in reco from RDO/RAW when we need to build externals such as clusters or tracks : in this case we call the main config functions from external packages)
295 from .JetDefinition
import JetInputConstit, JetDefinition
296 if isinstance(jetOrConstitdef, JetInputConstit):
298 jetlog.info(
"Setting up jet inputs from JetInputConstit : "+jetOrConstitdef.name)
299 jetdef =
solveDependencies( JetDefinition(
'Kt', 0., jetOrConstitdef, context=context), flags )
304 jetdef = jetOrConstitdef
306 jetlog.info(
"Inspecting input file contents")
310 filecontents = jetdef._cflags.Input.Collections
315 cname = c.containername
if isinstance(c, JetInputConstit)
else c.containername(jetdef,c.specs)
316 return cname
in filecontents
319 inputdeps = [ inputkey
for inputkey
in jetdef._prereqOrder
if inputkey.startswith(
'input:')
or inputkey.startswith(
'extinput:') ]
321 for inputfull
in inputdeps:
322 inputInstance = jetdef._prereqDic[inputfull]
323 if isInInput( inputInstance ):
324 jetlog.info(f
"Input container for {inputInstance} already in input file.")
328 if isinstance(inputInstance, JetInputConstit):
331 alg = inputInstance.algoBuilder( jetdef, inputInstance.specs )
343 """Construct the name of the PseudoJetContainer defined by the given JetDef or JetInputConstit.
344 This name has to be constructed from various places, so we factorize the definition here.
346 cdef = jetOrConstitdef
if isinstance(jetOrConstitdef, JetInputConstit)
else jetOrConstitdef.inputdef
347 _str_containername = cdef.containername(parent_jetdef).
split(
':')[-1]
if callable(cdef.containername)
else cdef.containername
348 end =
'' if suffix
is None else f
'_{suffix}'
349 return f
'PseudoJet{_str_containername}{end}'
352 """returns a configured PseudoJetAlgorithm which converts the inputs defined by constitdef into fastjet::PseudoJet
354 IMPORTANT : constitdef must have its dependencies solved (i.e. it must result from a solveDependencies() call)
356 the flags argument is TEMPORARY and will be removed once further dev on PseudoJetAlgorithm is done (see comment below)
358 _str_containername = constitdef.containername(parent_jetdef).
split(
':')[-1]
if callable(constitdef.containername)
else constitdef.containername
359 jetlog.debug(
"Getting PseudoJetAlg for label {0} from {1}".
format(constitdef.name,constitdef.inputname))
360 end =
'' if suffix
is None else f
'_{suffix}'
361 full_label = constitdef.label + end
362 pjgalg = CompFactory.PseudoJetAlgorithm(
363 "pjgalg_"+_str_containername+end,
364 InputContainer = _str_containername,
365 OutputContainer =
getPJContName(constitdef, suffix = suffix, parent_jetdef = parent_jetdef),
367 SkipNegativeEnergy=
True,
368 DoByVertex=constitdef.byVertex
375 if flags
is not None:
376 from AthenaConfiguration.Enums
import BeamType
377 pjgalg.UseChargedPV = (flags.Beam.Type == BeamType.Collisions)
380 pjgalg.UseChargedPV=
False
381 pjgalg.UseChargedPUsideband=
True
382 elif suffix ==
'Neut':
383 pjgalg.UseCharged=
False
389 """returns a configured PseudoJetAlgorithm which converts the inputs defined by constitdef into fastjet::PseudoJet
391 The difference for the above is this is dedicated to ghosts which need variations for the Label and the muon segment cases.
393 IMPORTANT : ghostdef must have its dependencies solved (i.e. it must result from a solveDependencies() call)
395 label =
"Ghost"+ghostdef.label
396 _container_name = ghostdef.containername(parentjetdef).
split(
":")[1]
if callable(ghostdef.containername)
else ghostdef.containername
397 _output_cont_name_suffix =
"" if parentjetdef.context ==
"default" or _container_name.endswith(parentjetdef.context)
else (
"_" + parentjetdef.context)
400 InputContainer = _container_name,
401 OutputContainer=
"PseudoJetGhost"+_container_name + _output_cont_name_suffix,
403 SkipNegativeEnergy=
True,
406 pjaclass = CompFactory.PseudoJetAlgorithm
407 if ghostdef.basetype==
"MuonSegment":
409 pjaclass = CompFactory.MuonSegmentPseudoJetAlgorithm
410 kwargs.update( Pt =1e-20 )
411 kwargs.pop(
'SkipNegativeEnergy')
413 pjgalg = pjaclass(
"pjgalg_" + label +
"_" + parentjetdef.context, **kwargs )
418 """Returns the configured JetRecAlg instance corresponding to jetdef
420 IMPORTANT : jetdef must have its dependencies solved (i.e. it must result from solveDependencies() )
422 pjContNames = jetdef._internalAtt[
'finalPJContainer']
425 "JetAlgorithm": jetdef.algorithm,
426 "JetRadius": jetdef.radius,
427 "PtMin": jetdef.ptmin,
428 "InputPseudoJets": pjContNames,
429 "GhostArea": jetdef.ghostarea,
430 "JetInputType":
int(jetdef.inputdef.jetinputtype),
432 "VariableRMinRadius": jetdef.VRMinRadius,
433 "VariableRMassScale": jetdef.VRMassScale
436 jetname = jetdef.fullname()
438 jclust = CompFactory.JetClustererByVertex(
443 jclust = CompFactory.JetClusterer(
450 jra = CompFactory.JetRecAlg(
451 "jetrecalg_"+jetname+ftf_suffix,
454 OutputContainer = jetname+ftf_suffix,
458 jra.MonTool = monTool
464 """Returns a configured JetRecAlg set-up to perform the grooming defined by 'groomdef'
465 ('monTool' is a temporary placeholder, it is expected to be used in the trigger in the future)
467 jetlog.debug(
"Configuring grooming alg \"jetalg_{0}\"".
format(groomdef.fullname()))
471 groomClass = CompFactory.getComp(groomdef.tooltype)
472 groomer = groomClass(groomdef.groomalg,
473 UngroomedJets = groomdef.ungroomeddef.fullname(),
474 ParentPseudoJets = groomdef.ungroomeddef._internalAtt[
'finalPJContainer'],
475 **groomdef.properties)
481 jetname = groomdef.fullname()
482 jra = CompFactory.JetRecAlg(
483 "jetrecalg_"+jetname,
486 OutputContainer = jetname)
489 jra.MonTool = monTool
495 def getJetCopyAlg(jetsin, jetsoutdef, decorations=[], shallowcopy=True, shallowIO=True, monTool=None):
497 Get a JetRecAlg set up to copy a jet collection and apply mods
498 In this setup we do not resolve dependencies because typically
499 these may be set up already in the original jet collection
500 In future we may wish to add a toggle.
502 The decoration list can be set in order for the decorations
503 (jet moments) on the original jets to be propagated to the
504 copy collection. Beware of circular dependencies!
506 jcopy = CompFactory.JetCopier(
509 DecorDeps=decorations,
510 ShallowCopy=shallowcopy,
515 for mod
in jetsoutdef.modifiers:
517 mods.append(
getModifier(jetsoutdef,moddef,moddef.modspec))
519 jetsoutname = jetsoutdef.fullname()
520 jra = CompFactory.JetRecAlg(
521 "jetrecalg_copy_"+jetsoutname,
524 OutputContainer = jetsoutname)
526 jra.MonTool = monTool
534 """returns a configured JetConstituentModSequence or None if constit.modifiers == []
536 The JetConstituentModSequence is determined by the JetInputConstitSeq constitSeq .
537 However, details of the configuration of the JetConstituentModSequence may depends on which JetDefinition
538 this JetConstituentModSequence is intended for. Thus the function also requires a parentjetdef JetDefinition input
540 IMPORTANT : parentjetdef & constitSeq must have their dependencies solved (i.e. they must result from solveDependencies() )
542 See also getConstitModAlg_nojetdef
547 if not isinstance(constitSeq, JetInputConstitSeq):
return
550 inputtype = constitSeq.basetype
552 sequence = constitSeq.modifiers
557 if constitSeq.inputname == constitSeq.containername:
return
559 for step
in sequence:
560 modInstance = parentjetdef._prereqDic[ f
'cmod:{step}' ]
561 if not modInstance.tooltype:
continue
563 toolclass = getattr( CompFactory, modInstance.tooltype)
566 for k,v
in modInstance.properties.items():
568 modInstance.properties[k ] =
v(parentjetdef, constitSeq )
570 tool = toolclass(modInstance.name,**modInstance.properties)
572 if (inputtype == xAODType.FlowElement
or inputtype == xAODType.ParticleFlow)
and modInstance.tooltype
not in [
"CorrectPFOTool",
"ChargedHadronSubtractionTool"]:
573 tool.IgnoreChargedPFO=
True
574 tool.ApplyToChargedPFO=
False
575 tool.InputType = inputtype
578 sequenceshort =
"".
join(sequence)
579 seqname =
"ConstitMod{0}_{1}".
format(sequenceshort,constitSeq.name)
580 inputcontainer =
str(constitSeq.inputname)
581 outputcontainer =
str(constitSeq.containername)
583 if (inputtype == xAODType.FlowElement
or inputtype == xAODType.ParticleFlow):
586 def chopPFO(thestring):
587 pfostr =
"ParticleFlowObjects"
588 if thestring.endswith(pfostr):
589 return thestring[:-len(pfostr)]
591 inputcontainer = chopPFO(inputcontainer)
592 outputcontainer = chopPFO(outputcontainer)
594 doByVertex = constitSeq.byVertex
596 inChargedFEDecorKeys = []
597 inNeutralFEDecorKeys = []
611 inChargedFEDecorKeys += [
"cellCPData",
"FE_ElectronLinks",
"FE_PhotonLinks",
"FE_MuonLinks"]
612 inNeutralFEDecorKeys += [
"calpfo_NLeadingTruthParticleBarcodeEnergyPairs",
"FE_ElectronLinks",
"FE_PhotonLinks",
"FE_MuonLinks"]
614 modseq = CompFactory.JetConstituentModSequence(seqname,
616 OutputContainer = outputcontainer,
617 InputContainer= inputcontainer,
618 InChargedFEDecorKeys = inChargedFEDecorKeys,
619 InNeutralFEDecorKeys = inNeutralFEDecorKeys,
621 DoByVertex = doByVertex
624 modseq.MonTool = monTool
626 constitmodalg = CompFactory.JetAlgorithm(
"jetalg_{0}".
format(modseq.getName()))
627 constitmodalg.Tools = [modseq]
632 """Same as getConstitModAlg.
633 This is a convenient function to obtain a JetConstituentModSequence when it is certain, no JetDef is needed.
634 This function just builds a dummy JetDefinition then calls getConstitModAlg
635 Needed in the trigger config.
637 jetdef =
solveDependencies( JetDefinition(
'Kt', 0., constitSeq, context=context) , flags)
638 constitSeq = jetdef._prereqDic[
'input:'+constitSeq.name]
643 """returns the list of configured JetModifier tools needed by this jetdef.
644 This is done by instantiating the actual C++ tool as ordered in jetdef._prereqOrder
646 modlist = [ key
for key
in jetdef._prereqOrder
if key.startswith(
'mod:')]
649 for modkey
in modlist:
650 moddef = jetdef._prereqDic[modkey]
652 modspec =
'' if ':' not in modkey
else modkey.split(
':',1)[1]
660 """Translate JetModifier into a concrete tool"""
661 jetlog.verbose(
"Retrieving modifier {0}".
format(
str(moddef)))
663 if flags
is not None:
665 jetdef = jetdef.clone()
666 jetdef._cflags = flags
667 jetdef._contextDic = flags.Jet.Context[jetdef.context]
671 modtool = moddef.createfn(jetdef, modspec)
672 except Exception
as e:
673 jetlog.error( f
"Unhandled modifier specification {modspec} for mod {moddef} acting on jet def {jetdef.basetype}!")
674 jetlog.error( f
"Received exception \"{e}\"" )
675 jetlog.error( f
"Helper function is \"{moddef.createfn}\"" )
676 raise ValueError( f
"JetModConfig unable to handle mod {moddef} with spec \"{modspec}\"")
681 for k,v
in moddef.properties.items():
684 v =
v(jetdef, modspec)
685 setattr(modtool, k, v)
693 """Filters the lists jetdef.modifiers and jetdef.ghosts (and jetdef._prereqOrder), so only the components
694 comptatible with flags are selected.
695 If flags==None : assume jetdef._cflags is properly set (this is done by higher-level functions)
696 The compatibility is ultimately tested using the component 'filterfn' attributes.
697 Internally calls the function isComponentPassingConditions() (see below)
699 jetlog.info(
"Standard Reco mode : filtering components in "+
str(jetdef))
701 if jetdef._cflags
is None:
702 jetdef._cflags = flags
713 raise Exception(f
"JetDefinition {jetdef} can NOT be scheduled. Failure of input {jetdef.inputdef.name} reason={reason}" )
714 jetlog.info(f
"IMPORTANT : removing {jetdef} because input incompatible with job conditions. Reason={reason} ")
717 if isinstance( jetdef.inputdef, JetInputConstitSeq):
719 jetdef.inputdef.modifiers =
filterJetDefList(jetdef, jetdef.inputdef.modifiers,
'cmod', raiseOnFailure, jetdef._cflags)
724 jetdef.ghostdefs =
filterJetDefList(jetdef, jetdef.ghostdefs,
"ghost", raiseOnFailure, jetdef._cflags)
725 jetdef.modifiers =
filterJetDefList(jetdef, jetdef.modifiers,
"mod", raiseOnFailure, jetdef._cflags)
734 groomdef.modifiers =
filterJetDefList(groomdef, groomdef.modifiers,
"mod", raiseOnFailure, flags)
744 basekey= compType+
':' if compType!=
"" else ""
746 fullname = jetdef.fullname()
750 fullkey = basekey+comp
751 cInstance = jetdef._prereqDic[fullkey]
755 raise Exception(
"JetDefinition {} can NOT be scheduled. Failure of {} {} reason={}".
format(
756 jetdef, compType, comp, reason) )
759 jetlog.info(f
"{fullname} : removing {compType} {comp} reason={reason}")
760 if fullkey
in jetdef._prereqOrder:
761 jetdef._prereqOrder.remove(fullkey)
762 if compType==
'ghost':
768 jetlog.info(
" *** Number of {} filtered components = {} final list={}".
format(compType, nOut, outList) )
776 """Test if component is compatible with flags.
777 This is done by calling component.filterfn AND testing all its prereqs.
779 for req
in component.prereqs:
780 _str_req = req(jetdef)
if callable(req)
else req
781 if _str_req
not in jetdef._prereqDic:
782 return False,
"prereq "+_str_req+
" not available"
783 reqInstance = jetdef._prereqDic[_str_req]
786 return False,
"prereq "+
str(reqInstance)+
" failed because : "+reason
788 ok, reason = component.filterfn(flags)
793 from AthenaConfiguration.Enums
import Project
794 return Project.determine() in( Project.AnalysisBase, Project.AthAnalysis)
798 """In runIII the scheduler automatically orders algs, so the JetRecConfig helpers do not try to enforce the correct ordering.
799 This is not the case in runII config for which this jobO is intended --> This function makes sure some jet-related algs are well ordered.
801 def _flatten_CA(cfg, sequence_name="AthAlgSeq"):
802 from AthenaConfiguration.ComponentAccumulator
import ConfigurationError
803 if not isinstance(cfg, ComponentAccumulator):
804 raise ConfigurationError(
'It is not allowed to flatten with multiple top sequences')
806 if len(cfg._allSequences) != 1:
807 raise ConfigurationError(
'It is not allowed to flatten with multiple top sequences')
809 sequence = cfg.getSequence(sequence_name)
810 if sequence.Sequential:
811 raise ConfigurationError(
'It is not allowed to flatten sequential sequences')
814 for member
in sequence.Members:
815 if isinstance(member, CompFactory.AthSequencer):
816 members.extend(_flatten_CA(cfg, member.getName()))
818 members.append(member)
820 sequence.Members = members
826 if not isinstance(a, ComponentAccumulator) :
830 ca_algs =
list(a._algorithms.keys())
832 algs_tmp.append(a.popEventAlgo(algo))
836 evtDensityAlgs = [(i, alg)
for (i, alg)
in enumerate(algs)
if alg
and alg.getType() ==
'EventDensityAthAlg' ]
837 pjAlgs = [(i, alg)
for (i, alg)
in enumerate(algs)
if alg
and alg.getType() ==
'PseudoJetAlgorithm' ]
839 for i, edalg
in evtDensityAlgs:
840 edInput = edalg.EventDensityTool.InputContainer
841 for j, pjalg
in pjAlgs:
844 if edInput ==
str(pjalg.OutputContainer):
845 pairsToswap.append((i, j))
846 for i, j
in pairsToswap:
847 algs[i], algs[j] = algs[j], algs[i]
854 """Make the jet collection described by jetdef available as constituents to other jet finding
856 Technically : create JetInputExternal and JetInputConstit and register them in the relevant look-up dictionnaries.
857 the JetInputConstit will have a algoBuilder to generate the JetContainer described by jetdef
859 from .StandardJetConstits
import stdConstitDic, stdInputExtDic
860 jetname = jetdef.fullname()
863 def jetBuilder(largejetdef,spec):
864 return JetRecCfg(largejetdef._cflags, jetdef)
866 stdInputExtDic[jetname] = JetInputExternal( jetname, jetname, algoBuilder=jetBuilder)
867 stdConstitDic[jetname] = JetInputConstit(jetname, xAODType.Jet, jetname )
875 if __name__==
"__main__":
877 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
879 flags.Input.Files = [
"/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ASG/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1"]
880 flags.Concurrency.NumThreads = 1
881 flags.Concurrency.NumConcurrentEvents = 1
885 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
889 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
893 from StandardSmallRJets
import AntiKt4EMTopo
894 AntiKt4EMTopo.modifiers = [
"Calib:T0:mc",
"Filter:15000",
"Sort"] + [
"JVT"] + [
"PartonTruthLabel"]
895 cfg.merge(
JetRecCfg(AntiKt4EMTopo,flags,jetnameprefix=
"New"))
897 cfg.printConfig(withDetails=
False,summariseProps=
True)