ATLAS Offline Software
Loading...
Searching...
No Matches
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
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.
11"""
12
13import sys
14from optparse import OptionParser
15from InDetBeamSpotExample import DiskUtils
16
17# Command line parsing
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',
22 help="Output path")
23(options, args) = parser.parse_args()
24
25if len(args) < 1:
26 sys.exit('No dataset supplied')
27
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)