Beispiel #1
0
def commonMonitoringTool(container, refcontainer="", pathSuffix=''):
    filler = JetContainerHistoFiller(container + pathSuffix + "HistoFiller",
                                     JetContainer=container,
                                     HistoDir=container + pathSuffix + '/')

    # Give a list of predefined tools from jhm or a combination of such tools
    filler.HistoTools = [
        # build a special kinematics histo tool plotting 2D hists :
        JetKinematicHistos("kinematics",
                           PlotOccupancy=True,
                           PlotAveragePt=True,
                           PlotAverageE=True,
                           PlotNJet=True),

        # Draw a set of histo for a particular jet selection :
        selectionAndHistos("leadingjet", [
            "basickinematics",
        ]),
        selectionAndHistos("subleadingjet", ["basickinematics"]),
        selectionAndHistos("20000<pt<500000", [
            "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac",
            "LArQuality", "AverageLArQF", "N90Constituents",
            "SumPtTrkPt500[0]", "FracSamplingMax"
        ], "highpt_20_500"),
        selectionAndHistos("500000<pt<1000000", [
            "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac",
            "LArQuality", "AverageLArQF", "N90Constituents",
            "SumPtTrkPt500[0]", "FracSamplingMax"
        ], "highpt_500_1000"),
        selectionAndHistos("1000000<pt<2000000", [
            "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac",
            "LArQuality", "AverageLArQF", "N90Constituents",
            "SumPtTrkPt500[0]", "FracSamplingMax"
        ], "highpt_1000_2000"),
        selectionAndHistos("2000000<pt<8000000", [
            "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac",
            "LArQuality", "AverageLArQF", "N90Constituents",
            "SumPtTrkPt500[0]", "FracSamplingMax"
        ], "highpt_2000_8000"),
        selectionAndHistos("LooseBadJets", [
            "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality",
            JetKinematicHistos("kinematics",
                               PlotOccupancy=True,
                               PlotAveragePt=True,
                               PlotAverageE=True,
                               PlotNJet=True)
        ]),
        selectionAndHistos("1.0<eta<1.4", [
            "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality",
            JetKinematicHistos("kinematicsTileGap",
                               PlotOccupancy=True,
                               PlotAveragePt=True,
                               PlotAverageE=True,
                               PlotNJet=True)
        ], "eta_1_14"),
        jhm.Width,

        # distances between 2 leading jets.
        jhm.leadingjetrel,
    ]

    if "Topo" in container:
        filler.HistoTools += [

            # jet states
            jhm.basickinematics_emscale,
            jhm.basickinematics_constscale,

            # calo variables
            jhm.NegativeE,
            jhm.EMFrac,
            jhm.HECFrac,
            jhm.Timing,
            jhm.LArQuality,

            # calo quality variables
            jhm.AverageLArQF,
            jhm.HECQuality,
            jhm.FracSamplingMax,
            jhm.FracSamplingMaxIndex,
            jhm.N90Constituents,
            jhm.CentroidR,
            jhm.OotFracClusters5,
            jhm.OotFracClusters10,
            jhm.ptN,
            jhm.LeadingClusterCenterLambda,
            jhm.LeadingClusterSecondLambda,
            jhm.LeadingClusterSecondR,

            # energy per sampling
            jhm.PreSamplerB,
            jhm.EMB1,
            jhm.EMB2,
            jhm.EMB3,
            jhm.PreSamplerE,
            jhm.EME1,
            jhm.EME2,
            jhm.EME3,
            jhm.HEC0,
            jhm.HEC1,
            jhm.HEC2,
            jhm.HEC3,
            jhm.FCAL0,
            jhm.FCAL1,
            jhm.FCAL2,
            jhm.TileBar0,
            jhm.TileBar1,
            jhm.TileBar2,
            jhm.TileExt0,
            jhm.TileExt1,
            jhm.TileExt2,
            jhm.TileGap1,
            jhm.TileGap2,
            jhm.TileGap3,
        ]
        if jetFlags.useTracks:
            filler.HistoTools += [
                # track variables
                jhm.tool("JVF[0]"),
                jhm.SumPtTrkPt500,
                jhm.tool("SumPtTrkPt500[0]"),
                jhm.tool("NumTrkPt500[0]"),
                jhm.tool("NumTrkPt1000[0]"),
                jhm.tool("TrackWidthPt1000[0]"),
                jhm.GhostTrackCount,
            ]

        if refcontainer:
            # efficiency
            filler.HistoTools += [
                jhm.effresponse,
            ]
            filler.HistoTools['effresponse'].RefContainer = refcontainer

    #filler.OutputLevel =2
    return filler
Beispiel #2
0
def commonPhysValTool(container,
                      refcontainer="",
                      onlyKinematics=False,
                      globalSelection=""):
    containerfiller = JetContainerHistoFiller(container + "HistoFiller",
                                              JetContainer=container)
    filler = containerfiller

    if globalSelection != "":
        # here we create an intermediate selection tool, we'll pass it the histo builders
        # instead of passing them to containerfiller
        # Create the intermediate tool and attach it to containerfiller:
        containerfiller.HistoTools = [
            selectionAndHistos(
                globalSelection,
                [],  # no histo builders, will be set below
                histoNameSuffix=
                "none",  # same histo names as without global selection
            )
        ]
        # attach the selection :
        filler = containerfiller.HistoTools[0]
        containerfiller.OutputLevel = 2
        filler.OutputLevel = 2

    # Give a list of predefined tools from jhm or a combination of such tools
    filler.HistoTools = [
        # build a special tool without 2D hists :
        JetKinematicHistos("kinematics",
                           PlotOccupancy=False,
                           PlotAveragePt=False,
                           PlotNJet=True),
    ]

    if onlyKinematics:
        # return now
        return containerfiller

    filler.HistoTools += [

        # Draw a set of histo for a particular jet selection :
        selectionAndHistos("leadingjet", [
            "basickinematics",
        ]),
        selectionAndHistos("subleadingjet", ["basickinematics"]),
        selectionAndHistos("40000<pt<50000", ["pt"]),
        jhm.Width,

        # distances between 2 leading jets.
        jhm.leadingjetrel,
    ]

    if "Topo" in container or "PFlow" in container:
        filler.HistoTools += [

            # jet states
            jhm.basickinematics_emscale,
            jhm.basickinematics_constscale,

            # track variables
            jhm.tool("JVF[0]"),
            jhm.SumPtTrkPt500,
            jhm.tool("SumPtTrkPt500[0]"),
            jhm.tool("NumTrkPt500[0]"),
            jhm.tool("NumTrkPt1000[0]"),
            jhm.tool("TrackWidthPt1000[0]"),
            jhm.GhostTrackCount,
            jhm.GhostTruthAssociationFraction,
            jhm.GhostMuonSegmentCount,
            jhm.JVF,
            jhm.JVFCorr,
            jhm.Jvt,
            jhm.JvtRpt,

            # calo variables
            jhm.NegativeE,
            jhm.EMFrac,
            jhm.HECFrac,
            jhm.Timing,
            jhm.LArQuality,
            jhm.EMB2,
            jhm.EMB3,
            jhm.EME2,
            jhm.EME3,
            jhm.HEC2,
            jhm.HEC3,
            jhm.FCAL0,
            jhm.FCAL1,
            jhm.TileBar0,
            jhm.TileBar1,
            jhm.TileExt0,
            jhm.TileExt1,
        ]

        if "PFlow" in container:
            filler.HistoTools += [
                jhm.tool("SumPtChargedPFOPt500[0]"),
                jhm.tool("NumChargedPFOPt500[0]"),
                jhm.tool("NumChargedPFOPt1000[0]"),
                jhm.tool("ChargedPFOWidthPt1000[0]"),
            ]

        if refcontainer:
            # efficiency
            filler.HistoTools += [
                jhm.effresponse,
            ]
            filler.HistoTools['effresponse'].RefContainer = refcontainer

        if "Trimmed" in container:
            filler.HistoTools += [

                #main list of substrcture variables
                jhm.ECF1,
                jhm.ECF2,
                jhm.ECF3,
                jhm.Tau1_wta,
                jhm.Tau2_wta,
                jhm.Tau3_wta,
                jhm.Split12,
                jhm.Split23,
                jhm.NTrimSubjets,
                jhm.DetectorEta,
                jhm.TrackSumPt,
                jhm.TrackSumMass,
                jhm.Qw,
                jhm.PlanarFlow,
                jhm.FoxWolfram2,
                jhm.FoxWolfram0,
                jhm.Angularity,
                jhm.Aplanarity,
                jhm.KtDR,
                jhm.ZCut12,

                # other substructure variables:
                jhm.Tau21,
                jhm.Tau32,
                jhm.Tau21_wta,
                jhm.Tau32_wta,
                jhm.Dip12,
                jhm.Dip13,
                jhm.Dip23,
                jhm.DipExcl12,
                jhm.Split34,
                jhm.ZCut23,
                jhm.ZCut34,
                jhm.Mu12,
                jhm.ECF1_Beta2,
                jhm.ECF2_Beta2,
                jhm.ECF3_Beta2,
                jhm.C1,
                jhm.C2,
                jhm.D2,
                jhm.C1_Beta2,
                jhm.C2_Beta2,
                jhm.D2_Beta2,
                jhm.ThrustMin,
                jhm.ThrustMaj,
                jhm.FoxWolfram1,
                jhm.FoxWolfram3,
                jhm.FoxWolfram4,
                jhm.Sphericity,
                jhm.Aplanarity,
                jhm.PullMag,
                jhm.PullPhi,
                jhm.Pull_C00,
                jhm.Pull_C01,
                jhm.Pull_C10,
                jhm.Pull_C11,
                jhm.Charge,
                jhm.ShowerDeconstructionW,
                jhm.ShowerDeconstructionTop,
                jhm.Volatility,
            ]

    #filler.OutputLevel =2
    return containerfiller
Beispiel #3
0
    jhm.Width,  # -> Width attribute
    jhm.
    leadingjetrel,  # -> relation (distances, ration) between leading jets. 
    # or, equivalently ask with the tool() method (needed when the tool name contains special characters)
    jhm.tool("JVF[0]"
             ),  # JVF attribute. Plot only first value of the JVF vector.

    # can combine 2 known 1D attribute histos into a 2D histo
    jhm.tool("EMFrac:NegativeE"),

    # To draw a set of histos for a particular jet selection,
    # combine a selection tool with a  list of low-level histogram tools
    #  - selection is either a name of a predefined tool  or a HistosForJetSelection instance
    #  - similarly, list contains names or tool instances
    selectionAndHistos(
        "leadingjet",
        ["basickinematics", "NegativeE", "JVF[0]:Width", jhm.Width]),
    selectionAndHistos("subleadingjet", [
        "basickinematics",
    ]),
    selectionAndHistos(jhm.alljets, [jhm.Timing]),

    # Other types of selection with simple expression.
    # Only jets satisfying the expression will fill the histos
    # expresion must be in the form : '1.23<var<3.45'
    # 'var' must be a jet attribute (float, int or vector<float>)
    selectionAndHistos("-1<eta<1", [
        "basickinematics",
    ]),
    selectionAndHistos("eta<1", [
        "basickinematics",