Beispiel #1
0
        ]


_vertexFolders = [
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
]
_v0Folders = [
    "DQMData/Run 1/Vertexing/Run summary/V0",
    "DQMData/Vertexing/V0",
    "DQMData/Run 1/Vertexing/Run summary/V0V",
    "DQMData/Vertexing/V0V",
]
plotter = Plotter()
plotter.append(
    "", _vertexFolders,
    PlotFolder(_recovsgen,
               _pvtagging,
               _effandfake,
               _resolution,
               _resolutionNumTracks,
               _pull,
               _puritymissing,
               _sumpt2,
               purpose=PlotPurpose.Vertexing,
               page="vertex",
               onlyForPileup=True))
plotter.appendTable("", _vertexFolders, VertexSummaryTable())
plotter.append(
Beispiel #2
0
            "Duplicate rate",
        ]

_vertexFolders = [
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
]
_v0Folders = [
    "DQMData/Run 1/Vertexing/Run summary/V0",
    "DQMData/Vertexing/V0",
    "DQMData/Run 1/Vertexing/Run summary/V0V",
    "DQMData/Vertexing/V0V",
]
plotter = Plotter()
plotter.append("", _vertexFolders, PlotFolder(
    _recovsgen,
    _pvtagging,
    _effandfake,
    _resolution,
    _resolutionNumTracks,
    _pull,
    _puritymissing,
    _sumpt2,
    purpose=PlotPurpose.Vertexing,
    page="vertex",
    onlyForPileup=True
))
plotter.appendTable("", _vertexFolders, VertexSummaryTable())
plotter.append("K0", [x+"/K0" for x in _v0Folders], PlotFolder(
Beispiel #3
0
_genpos = PlotGroup("genpos", [
    Plot("GenAllV_X", xtitle="Gen AllV pos x", ytitle="N", **_common),
    Plot("GenPV_X", xtitle="Gen PV pos x", ytitle="N", **_common),
    Plot("GenAllV_Y", xtitle="Gen AllV pos y", ytitle="N", **_common),
    Plot("GenPV_Y", xtitle="Gen PV pos y", ytitle="N", **_common),
    Plot("GenAllV_Z", xtitle="Gen AllV pos z", ytitle="N", **_common),
    Plot("GenPV_Z", xtitle="Gen PV pos z", ytitle="N", **_common),
])

plotter = Plotter([
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
],[
    _recovsgen,
    _pvtagging,
    _effandfake,
    _resolution,
    _pull,
    _puritymissing,
    _sumpt2
])
plotterGen = Plotter([
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
],[
     _genpos
])
Beispiel #4
0
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
]
_vertexDqmFolders = [
    "DQMData/Run 1/OfflinePV/Run summary/offlinePrimaryVertices",
    "DQMData/OffinePV/offlinePrimaryVertices",
]
_v0Folders = [
    "DQMData/Run 1/Vertexing/Run summary/V0",
    "DQMData/Vertexing/V0",
    "DQMData/Run 1/Vertexing/Run summary/V0V",
    "DQMData/Vertexing/V0V",
]
plotter = Plotter()
plotterExt = Plotter()
plotter.append(
    "", _vertexFolders,
    PlotFolder(_recovsgen,
               _pvtagging,
               _effandfake,
               _resolution,
               _resolutionNumTracks,
               _resolutionPt,
               _pull,
               _pullNumTracks,
               _pullPt,
               _puritymissing,
               _sumpt2,
               purpose=PlotPurpose.Vertexing,
Beispiel #5
0
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
]
_vertexDqmFolders = [
    "DQMData/Run 1/OfflinePV/Run summary/offlinePrimaryVertices",
    "DQMData/OffinePV/offlinePrimaryVertices",
]
_v0Folders = [
    "DQMData/Run 1/Vertexing/Run summary/V0",
    "DQMData/Vertexing/V0",
    "DQMData/Run 1/Vertexing/Run summary/V0V",
    "DQMData/Vertexing/V0V",
]
plotter = Plotter()
plotterExt = Plotter()
plotter.append("", _vertexFolders, PlotFolder(
    _recovsgen,
    _pvtagging,
    _effandfake,
    _resolution,
    _resolutionNumTracks,
    _resolutionPt,
    _pull,
    _pullNumTracks,
    _pullPt,
    _puritymissing,
    _sumpt2,
    purpose=PlotPurpose.Vertexing,
    page="vertex"
Beispiel #6
0
def main():

    # plot-dependent style options
    # style options can be found from Validation/RecoTrack/python/plotting/plotting.py
    styledict_resolution = {
        "xlog": True,
        "xgrid": False,
        "ygrid": False,
        "xtitle": "GenJet pT (GeV)",
        "ytitle": "Jet pT resolution",
        "xtitleoffset": 7.7,
        "ytitleoffset": 3.8,
        "adjustMarginLeft": 0.00
    }

    styledict_response = {
        "xlog": True,
        "xgrid": False,
        "ygrid": False,
        "xtitle": "GenJet pT (GeV)",
        "ytitle": "Jet response",
        "xtitleoffset": 7.7,
        "ytitleoffset": 3.8,
        "adjustMarginLeft": 0.00
    }
    plot_opts = {
        "reso_pt": styledict_resolution,
        "reso_pt_rms": styledict_resolution,
        "response_pt": styledict_response
    }
    for iptbin in range(len(ptbins) - 1):
        plot_opts["response_{0:.0f}_{1:.0f}".format(ptbins[iptbin],
                                                    ptbins[iptbin + 1])] = {
                                                        "stat": True
                                                    }

    samples, plots, doOffsetPlots, offsetVar, offsetDR = parse_args()

    plotter = Plotter()

    for folder, name, histograms in plots:
        opts = plot_opts.get(name, {})

        #fullfolder =  "DQMData/Run 1/Physics/Run summary/{0}".format(folder)
        fullfolder = "DQMData/Run 1/ParticleFlow/Run summary/{0}".format(
            folder)
        print "Booking histogram group {0}={1} from folder {2}".format(
            name, histograms, folder)
        if "Offset/" in folder:
            opts = {'xtitle': 'Default', 'ytitle': 'Default'}
            addPlots(plotter, fullfolder, name, folder, histograms, opts, True)
        else:
            addPlots(plotter, fullfolder, name, folder, histograms, opts)

    outputDir = "plots"  # Plot output directory
    description = "Simple ParticleFlow comparison"

    plotterDrawArgs = dict(
        separate=False,  # Set to true if you want each plot in it's own canvas
        #    ratio=False,   # Uncomment to disable ratio pad
    )

    val = SimpleValidation(samples, outputDir)
    report = val.createHtmlReport(validationName=description)
    val.doPlots([plotter], plotterDrawArgs=plotterDrawArgs)

    report.write()

    #add tdr-style stack plots to offset html file
    if doOffsetPlots:
        offsetDir = "OffsetStacks"
        fullOffsetDir = os.path.join(outputDir, offsetDir)
        os.makedirs(fullOffsetDir)

        for s in samples:
            offFile = open(outputDir + "/" + s.label() + "_offset.html", "r")
            lines = offFile.readlines()
            offFile.close()

            for f in s.files():
                fname = f.split('/')[-2]
                outName = offsetStack([(fname, f)], offsetVar, offsetDR,
                                      fullOffsetDir)
                outName = outName.replace(
                    "plots/", ""
                )  #KH: This "plots" look redundant and causes trouble for .html. Stripping it off.
                addLine(outName, lines)

                for f2 in s.files():
                    if f == f2: continue
                    fname2 = f2.split('/')[-2]
                    outName = offsetStack([(fname, f), (fname2, f2)],
                                          offsetVar, offsetDR, fullOffsetDir)
                    outName = outName.replace(
                        "plots/", ""
                    )  #KH: This "plots" look redundant and causes trouble for .html. Stripping it off.
                    addLine(outName, lines)

            offFile = open(outputDir + "/" + s.label() + "_offset.html", "w")
            lines = "".join(lines)
            offFile.write(lines)
            offFile.close()
Beispiel #7
0
_genpos = PlotGroup("genpos", [
    Plot("GenAllV_X", xtitle="Gen AllV pos x", ytitle="N", **_common),
    Plot("GenPV_X", xtitle="Gen PV pos x", ytitle="N", **_common),
    Plot("GenAllV_Y", xtitle="Gen AllV pos y", ytitle="N", **_common),
    Plot("GenPV_Y", xtitle="Gen PV pos y", ytitle="N", **_common),
    Plot("GenAllV_Z", xtitle="Gen AllV pos z", ytitle="N", **_common),
    Plot("GenPV_Z", xtitle="Gen PV pos z", ytitle="N", **_common),
])

_vertexFolders = [
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
]
plotter = Plotter()
plotter.append(
    "", _vertexFolders,
    PlotFolder(_recovsgen,
               _pvtagging,
               _effandfake,
               _resolution,
               _pull,
               _puritymissing,
               _sumpt2,
               purpose=PlotPurpose.Vertexing,
               page="vertex"))
plotterGen = Plotter()
plotterGen.append("", _vertexFolders, PlotFolder(_genpos))

Beispiel #8
0
_genpos = PlotGroup("genpos", [
    Plot("GenAllV_X", xtitle="Gen AllV pos x", ytitle="N", **_common),
    Plot("GenPV_X", xtitle="Gen PV pos x", ytitle="N", **_common),
    Plot("GenAllV_Y", xtitle="Gen AllV pos y", ytitle="N", **_common),
    Plot("GenPV_Y", xtitle="Gen PV pos y", ytitle="N", **_common),
    Plot("GenAllV_Z", xtitle="Gen AllV pos z", ytitle="N", **_common),
    Plot("GenPV_Z", xtitle="Gen PV pos z", ytitle="N", **_common),
])

_vertexFolders = [
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
]
plotter = Plotter()
plotter.append("", _vertexFolders, PlotFolder(
    _recovsgen,
    _pvtagging,
    _effandfake,
    _resolution,
    _pull,
    _puritymissing,
    _sumpt2,
    purpose=PlotPurpose.Vertexing,
    page="vertex"
))
plotterGen = Plotter()
plotterGen.append("", _vertexFolders, PlotFolder(
     _genpos
))
Beispiel #9
0
])
_common = {"drawStyle": "HIST"}
_genpos = PlotGroup("genpos", [
    Plot("GenAllV_X", xtitle="Gen AllV pos x", ytitle="N", **_common),
    Plot("GenPV_X", xtitle="Gen PV pos x", ytitle="N", **_common),
    Plot("GenAllV_Y", xtitle="Gen AllV pos y", ytitle="N", **_common),
    Plot("GenPV_Y", xtitle="Gen PV pos y", ytitle="N", **_common),
    Plot("GenAllV_Z", xtitle="Gen AllV pos z", ytitle="N", **_common),
    Plot("GenPV_Z", xtitle="Gen PV pos z", ytitle="N", **_common),
])

plotter = Plotter([
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
], [
    _recovsgen,
    _effandfake,
])
plotterGen = Plotter([
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
    "DQMData/Vertexing/PrimaryVertex",
    "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
    "DQMData/Vertexing/PrimaryVertexV",
], [_genpos])


class VertexValidation(validation.Validation):
    def _init__(self, *args, **kwargs):
        super(TrackingValidation, self).__init__(*args, **kwargs)