Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:37

0001 from __future__ import print_function
0002 import ROOT
0003 import pprint
0004 import sys
0005 from DataFormats.FWLite import Events, Handle
0006 ROOT.gROOT.SetBatch()
0007 from argparse import ArgumentParser
0008 
0009 parser = ArgumentParser()
0010 parser.add_argument('file')
0011 parser.add_argument('collections', default=['slimmedJets'], nargs='*')
0012 args = parser.parse_args()
0013 
0014 events = Events(args.file)
0015 jet_labels = args.collections
0016 tested_discriminators = ['pfCombinedCvsLJetTags', 'pfCombinedCvsBJetTags']
0017 
0018 evt = next(events.__iter__())
0019 handle = Handle('std::vector<pat::Jet>')
0020 for label in jet_labels:
0021    evt.getByLabel(label, handle)
0022    jets = handle.product()
0023    jet = jets.at(0)
0024    available = set([i.first for i in jet.getPairDiscri()])
0025    for test in tested_discriminators:
0026       print("%s in %s: %s" % (test, label, test in available))