14def getInputDirectory(run, stream=None, project=None, suffix=None, year=None):
15 """
16 Function to find input directory with Tile Calorimeter input data files: calibrations, ...
17 Arguments:
18 run -- run number
19 stream -- run stream
20 project -- data project
21 suffix -- directory suffix
22 skipBadFiles -- skip known bad files
23 year -- year of data
24 """
25
26 log = logging.getLogger( 'TileInputFiles.getInputDirectory' )
27
28 if run < 10:
29 directory = '.'
30 else:
31 if not year:
32 yr={ 2023:441536, 2022:408681, 2021:387034, 2020:374260,
33 2019:367983, 2018:342531, 2017:314451, 2016:288032, 2015:248505,
34 2014:224307, 2013:216705, 2012:194688, 2011:171194, 2010:142682,
35 2009:99717, 2008:35430, 2007:0}
36 for year,beg in yr.items():
37 if run>=beg:
38 break
39
40 if stream or project or suffix:
41 if not stream:
42 stream = 'physics_Main'
43 log.warning('%s is not set up and will be used: %s' , 'Run stream', stream)
44 elif stream == 'Tile':
45 stream = 'calibration_Tile'
46 if not project:
47 if 'calibration' in stream and 'Tile' not in stream:
48 project = f'data{year%100}_calib'
49 else:
50 project = f'data{year%100}_13p6TeV'
51 log.warning('%s is not set up and will be used: %s' , 'Data project', project)
52 elif 'data' not in project:
53 project = f'data{year%100}_{project}'
54 if not suffix:
55 if stream == 'physics_Main' or stream == 'physics_MinBias' or stream.startswith('calibration'):
56 suffix = 'daq.RAW'
57 else:
58 suffix = 'merge.RAW'
59 log.warning('%s is not set up and will be used: %s' , 'Directory suffix', suffix)
60
61 run=str(run).zfill(8)
62 directory = f'/eos/atlas/atlastier0/rucio/{project}/{stream}/{run}/{project}.{run}.{stream}.{suffix}'
63
64 else:
65 directory = f'/eos/atlas/atlascerngroupdisk/det-tile/online/{year}/daq'
66
67 return directory
68
69