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