Skip to content

Commit e41c49d

Browse files
Zach MarshallZach Marshall
authored andcommitted
Last patches to the metadata building for the updated b-jet skims
1 parent 5b4dfe2 commit e41c49d

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

atlas-2025feb-odeo/build_full_metadata_json.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import csv
1010

1111
# File with the mapping of file names for each dataset
12-
json_metadata_file = open('odeo_file_mapping_ODEO_v0_FEB2025_2025-03-01.json','r')
12+
json_metadata_file = open('odeo_file_mapping_ODEO_v0_FEB2025_2025-06-30.json','r')
1313
json_file_locations = json.load(json_metadata_file)['file_locations']
1414

1515
# Open our metadata file to go through all the EVNT samples we've gathered metadata for
@@ -31,10 +31,15 @@
3131
# No skim goes into the regular file list field
3232
full_md[aset]['file_list'] = [ json_file_locations['opendata:opendata.ODEO_FEB2025_noskim_MC_v0'][afile]['uri'] for afile in json_file_locations['opendata:opendata.ODEO_FEB2025_noskim_MC_v0'] if f'mc_{aset}' in afile ]
3333
# Now go through each skim, add the files and publish the metadata
34-
for askim in ['2J2LMET30', '1LMET30', '2bjets', '3J1LMET30', 'exactly4lep', '2muons',
34+
for askim in ['2J2LMET30', '1LMET30', '3J1LMET30', 'exactly4lep', '2muons',
3535
'2to4lep', '4lep', 'exactly3lep', 'GamGam', '3lep']:
3636
full_md[aset]['skims'] += [ {'skim_type':askim,
3737
'file_list':[json_file_locations[f'opendata:opendata.ODEO_FEB2025_{askim}_MC_v0'][afile]['uri'] for afile in json_file_locations[f'opendata:opendata.ODEO_FEB2025_{askim}_MC_v0'] if f'mc_{aset}' in afile ]} ]
38+
# Special handling for the different naming
39+
for askim in ['2bjets']:
40+
full_md[aset]['skims'] += [ {'skim_type':askim,
41+
'file_list':[json_file_locations[f'opendata:opendata.ODEO_FEB2025_{askim}_mc_v1'][afile]['uri'] for afile in json_file_locations[f'opendata:opendata.ODEO_FEB2025_{askim}_mc_v1'] if f'mc_{aset}' in afile ]} ]
42+
3843
full_md[aset].update(input_md[aset])
3944
# Write out the file
4045
with open(f'mc_database_metadata_2025e.json','w') as metadata_json_file:
@@ -50,10 +55,14 @@
5055
# Reformat and then write the data metadata to a file
5156
data_metadata={'data':{'skims':[],'file_list':[]}}
5257
data_metadata['data']['file_list'] = [ json_file_locations['opendata:opendata.ODEO_FEB2025_noskim_Data_v0'][x]['uri'] for x in json_file_locations['opendata:opendata.ODEO_FEB2025_noskim_Data_v0'] ]
53-
for askim in ['2J2LMET30', '1LMET30', '2bjets', '3J1LMET30', 'exactly4lep', '2muons',
58+
for askim in ['2J2LMET30', '1LMET30', '3J1LMET30', 'exactly4lep', '2muons',
5459
'2to4lep', '4lep', 'exactly3lep', 'GamGam', '3lep']:
5560
data_metadata['data']['skims'] += [ {'skim_type':askim,
5661
'file_list':[ json_file_locations[f'opendata:opendata.ODEO_FEB2025_{askim}_Data_v0'][x]['uri'] for x in json_file_locations[f'opendata:opendata.ODEO_FEB2025_{askim}_Data_v0'] ]} ]
62+
# Special handling for the different naming
63+
for askim in ['2bjets']:
64+
data_metadata['data']['skims'] += [ {'skim_type':askim,
65+
'file_list':[ json_file_locations[f'opendata:opendata.ODEO_FEB2025_{askim}_data_v1'][x]['uri'] for x in json_file_locations[f'opendata:opendata.ODEO_FEB2025_{askim}_data_v1'] ]} ]
5766
with open(f'data_database_metadata_2025e.json','w') as data_metadata_json_file:
5867
json.dump(
5968
data_metadata,

0 commit comments

Comments
 (0)