Esempio n. 1
0
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
Esempio n. 2
0
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