Exemple #1
0
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
Exemple #2
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
Exemple #3
0
def JetInputCfg(ConfigFlags):
    inputcfg = ComponentAccumulator()
    # Create a sequence that holds a set of algorithms
    # -- mainly for understanding how chunks of the job
    #    relate to each other
    sequencename = "JetInputSeq"

    inputcfg.addSequence(CompFactory.AthSequencer(sequencename))

    from xAODBase.xAODType import xAODType

    # Apply some corrections to the topoclusters
    # Example with property assignments
    jetmodseq = CompFactory.JetConstituentModSequence("JetMod_LCOrigin")
    jetmodseq.InputType = xAODType.CaloCluster
    jetmodseq.InputContainer = "CaloCalTopoClusters"
    jetmodseq.OutputContainer = "LCOriginTopoClusters"

    # Build the list of modifiers to run
    # Configuration with constructor keywords
    modlist = [
        CompFactory.CaloClusterConstituentsOrigin(
            "ClusterOrigin", InputType=xAODType.CaloCluster)
    ]
    jetmodseq.Modifiers = modlist

    # We need a JetAlgorithm to run the modseq, which is a tool
    jetmodalg = CompFactory.JetAlgorithm("JetModAlg_LCOrigin",
                                         Tools=[jetmodseq])

    # Add the alg to the sequence in the ComponentAccumulator
    inputcfg.addEventAlgo(jetmodalg, sequencename)

    # Create a PseudoJetAlgorithm

    constitpjgalg = CompFactory.PseudoJetAlgorithm(
        "pjgalg_LCTopo",
        InputContainer="LCOriginTopoClusters",
        OutputContainer="PseudoJetLCTopo",
        Label="LCTopo",
        SkipNegativeEnergy=True)

    ghostpjgalg = CompFactory.PseudoJetAlgorithm(
        "pjgalg_GhostTruth",
        InputContainer="TruthParticles",
        OutputContainer="PseudoJetGhostTruth",
        Label="GhostTruth",
        SkipNegativeEnergy=True)

    pjcs = [constitpjgalg.OutputContainer, ghostpjgalg.OutputContainer]

    # Add the algs to the sequence in the ComponentAccumulator
    inputcfg.addEventAlgo(constitpjgalg, sequencename)
    inputcfg.addEventAlgo(ghostpjgalg, sequencename)

    return inputcfg, pjcs
Exemple #4
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