|
9 | 9 | import csv |
10 | 10 |
|
11 | 11 | # 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') |
13 | 13 | json_file_locations = json.load(json_metadata_file)['file_locations'] |
14 | 14 |
|
15 | 15 | # Open our metadata file to go through all the EVNT samples we've gathered metadata for |
|
31 | 31 | # No skim goes into the regular file list field |
32 | 32 | 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 ] |
33 | 33 | # 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', |
35 | 35 | '2to4lep', '4lep', 'exactly3lep', 'GamGam', '3lep']: |
36 | 36 | full_md[aset]['skims'] += [ {'skim_type':askim, |
37 | 37 | '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 | + |
38 | 43 | full_md[aset].update(input_md[aset]) |
39 | 44 | # Write out the file |
40 | 45 | with open(f'mc_database_metadata_2025e.json','w') as metadata_json_file: |
|
50 | 55 | # Reformat and then write the data metadata to a file |
51 | 56 | data_metadata={'data':{'skims':[],'file_list':[]}} |
52 | 57 | 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', |
54 | 59 | '2to4lep', '4lep', 'exactly3lep', 'GamGam', '3lep']: |
55 | 60 | data_metadata['data']['skims'] += [ {'skim_type':askim, |
56 | 61 | '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'] ]} ] |
57 | 66 | with open(f'data_database_metadata_2025e.json','w') as data_metadata_json_file: |
58 | 67 | json.dump( |
59 | 68 | data_metadata, |
|
0 commit comments