5""" Extracts a luminosity block map from a dataset.
7This map lists filenames from the dataset alongside the luminosity block
8numbers contained in the file. It is time-consuming to read this information,
9so this LB map can be passed to beamspotman's --lbmap so that you only need to
10build the map once instead of for every time you submit jobs.
14from optparse
import OptionParser
15from InDetBeamSpotExample
import DiskUtils
18parser = OptionParser(usage=
"usage: %prog [options] INPUTDATA")
19parser.add_option(
'',
"--eos", dest=
'eos', default=
False,
20 help=
"Access files using EOS (not needed if using /eos fuse mount)")
21parser.add_option(
'-f',
"--file", dest=
'map_file', default=
'dataset.lbmap',
23(options, args) = parser.parse_args()
26 sys.exit(
'No dataset supplied')
28backend = DiskUtils.EOS()
if options.eos
else DiskUtils.Local()
29file_set = DiskUtils.FileSet.from_input(args[0], backend=backend)
30DiskUtils.make_lumi_block_map_file(file_set, options.map_file)