3 from FWCore.PythonUtilities.LumiList
import LumiList
4 from argparse
import ArgumentParser
6 if __name__ ==
'__main__':
7 parser = ArgumentParser(description=
'Runs over input EDM files and prints out a list of contained lumi sections')
8 parser.add_argument(
'--intLumi', dest=
'intLumi', action=
'store_true',
9 help=
'print out total recorded and delivered integrated luminosity')
10 parser.add_argument(
'--output', dest=
'output', type=str,
11 help=
'save lumi sections output to file OUTPUT')
12 parser.add_argument(
"edm", metavar=
"edm.root", type=str, nargs=
'+')
13 options = parser.parse_args()
16 from DataFormats.FWLite
import Lumis, Handle
20 handle = Handle (
'LumiSummary')
21 label = (
'lumiProducer')
23 handle, lable =
None,
None 26 lumis = Lumis (options.edm)
27 delivered = recorded = 0
29 runList = runsLumisDict.setdefault (lum.aux().
run(), [])
30 runList.append( lum.aux().
id().luminosityBlock() )
33 lum.getByLabel (label, handle)
34 summary = handle.product()
35 delivered += summary.avgInsDelLumi()
36 recorded += summary.avgInsRecLumi()
39 jsonList = LumiList (runsAndLumis = runsLumisDict)
41 jsonList.writeJSON (options.output)
47 print(
"\nNote: These numbers should be considered approximate. For official numbers, please use lumiCalc.py")
48 print(
"delivered %.1f mb, recorded %.1f mb" % \
49 (delivered, recorded))
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)