def JetGroomAlgCfg(ConfigFlags, buildjetsname, groomjetsname): groomcfg = ComponentAccumulator() # Create a sequence that holds a set of algorithms # -- mainly for understanding how chunks of the job # relate to each other sequencename = "JetGroomSeq" groomcfg.addSequence(CompFactory.AthSequencer(sequencename)) # Create the JetGroomer, provide it with a JetTrimmer jtrim = CompFactory.JetTrimming("trimSmallR2Frac5", RClus=0.2, PtFrac=0.05) jtrim.UngroomedJets = buildjetsname jtrim.ParentPseudoJets = "PseudoJetMerged_" + buildjetsname # Create the JetRecAlg, configure it to use the builder # using constructor syntax instead # (equivalent to setting properties with "=") jra = CompFactory.JetRecAlg( "JRA_trim", Provider=jtrim, # Single ToolHandle Modifiers=[], # ToolHandleArray OutputContainer=groomjetsname) # Add the alg to the ComponentAccumulator in the named sequence groomcfg.addEventAlgo(jra, sequencename) return groomcfg
def JetCopyAlgCfg(ConfigFlags, buildjetsname, copyjetsname): copycfg = ComponentAccumulator() # Create a sequence that holds a set of algorithms # -- mainly for understanding how chunks of the job # relate to each other sequencename = "JetCopySeq" copycfg.addSequence(CompFactory.AthSequencer(sequencename)) # Create the JetCopier, set some standard options jcopy = CompFactory.JetCopier("copier") jcopy.InputJets = buildjetsname # Add a simple jet modifier to the JetRecAlg jclsmoms = CompFactory.JetClusterMomentsTool("clsmoms", JetContainer=copyjetsname) # Create the JetRecAlg, configure it to use the copier # using constructor syntax instead # (equivalent to setting properties with "=") jra = CompFactory.JetRecAlg( "JRA_copy", Provider=jcopy, # Single ToolHandle Modifiers=[jclsmoms], # ToolHandleArray OutputContainer=copyjetsname) # Add the alg to the ComponentAccumulator in the named sequence copycfg.addEventAlgo(jra, sequencename) return copycfg
def JetBuildAlgCfg(ConfigFlags, buildjetsname): buildcfg = ComponentAccumulator() # Create a sequence that holds a set of algorithms # -- mainly for understanding how chunks of the job # relate to each other sequencename = "JetBuildSeq" buildcfg.addSequence(CompFactory.AthSequencer(sequencename)) # Merge in config to get jet inputs inputcfg, pjcs = JetInputCfg(ConfigFlags) buildcfg.merge(inputcfg) # Create a merger to build the PseudoJetContainer for this specific jet collection mergepjalg = CompFactory.PseudoJetMerger( "pjmergealg_" + buildjetsname, InputPJContainers=pjcs, OutputContainer="PseudoJetMerged_" + buildjetsname) buildcfg.addEventAlgo(mergepjalg) # Create the JetClusterer, set some standard options jclust = CompFactory.JetClusterer("builder") jclust.JetAlgorithm = "AntiKt" jclust.JetRadius = 1.0 jclust.PtMin = 10e3 # MeV jclust.InputPseudoJets = "PseudoJetMerged_" + buildjetsname jclust.JetInputType = 1 # Hardcoded "magic number" for now # See https://gitlab.cern.ch/atlas/athena/blob/master/Event/xAOD/xAODJet/xAODJet/JetContainerInfo.h # This should get its own dictionary. # Add a simple jet modifier to the JetRecAlg jclsmoms = CompFactory.JetClusterMomentsTool("clsmoms", JetContainer=buildjetsname) # Create the JetRecAlg, configure it to use the builder # using constructor syntax instead # (equivalent to setting properties with "=") jra = CompFactory.JetRecAlg( "JRA_build", Provider=jclust, # Single ToolHandle Modifiers=[jclsmoms], # ToolHandleArray OutputContainer=buildjetsname) # Add the alg to the ComponentAccumulator in the named sequence buildcfg.addEventAlgo(jra, sequencename) return buildcfg
def getJetRecAlg(jetname, jetdef, pjs, modlist): jclust = CompFactory.JetClusterer("builder") jclust.JetAlgorithm = jetdef.algorithm jclust.JetRadius = jetdef.radius jclust.PtMin = jetdef.ptmin jclust.InputPseudoJets = pjs jclust.GhostArea = 0.01 # In which cases do we not want areas? jclust.JetInputType = jetdef.inputdef.basetype from . import JetModConfig mods = [] for moddef, modspec in modlist: mod = JetModConfig.getModifier(jetdef, moddef, modspec) mods.append(mod) jra = CompFactory.JetRecAlg("jetrecalg_" + jetname, Provider=jclust, Modifiers=mods, OutputContainer=jetname) autoconfigureModifiers(jra.Modifiers, jetname) return jra