ATLAS Offline Software
dumpLBFileMap.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
4 
5 """ Extracts a luminosity block map from a dataset.
6 
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.
11 """
12 
13 import sys
14 from optparse import OptionParser
15 from InDetBeamSpotExample import DiskUtils
16 
17 # Command line parsing
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',
22  help="Output path")
23 (options, args) = parser.parse_args()
24 
25 if len(args) < 1:
26  sys.exit('No dataset supplied')
27 
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)