Skip to content
Snippets Groups Projects
Commit 9c1c5e64 authored by Chenjia Zhang's avatar Chenjia Zhang
Browse files

dealing with raw files

parent dbc0c890
No related branches found
No related tags found
1 merge request!348Modify the functions in FileFromDirac
Pipeline #6291323 failed
This commit is part of merge request !348. Comments created here will be created in the context of that merge request.
......@@ -111,9 +111,9 @@ def get_access_urls_data(bkkpath, sites_to_remove=[], max_files=500):
# ensure files are always in same order
file_list.sort()
if any(file.endswith("raw") for file in file_list):
raise NotImplementedError(
"File ending with 'raw' found, please write a script manually")
# if any(file.endswith("raw") for file in file_list):
# raise NotImplementedError(
# "File ending with 'raw' found, please write a script manually")
print(
"#### Checking output of . /cvmfs/lhcb.cern.ch/lib/LbEnv --quiet; lb-dirac dirac-dms-lfn-accessURL --Terminal"
......@@ -151,8 +151,21 @@ def get_access_urls_data(bkkpath, sites_to_remove=[], max_files=500):
lfn for lfn in lfns_tmp if not any(site in lfn for site in excluded)
]
lfns = sorted(lfns, key=lambda str: not "eoslhcb.cern.ch" in str)
if any(file.endswith("raw") for file in file_list):
lfns = [lfn for lfn in lfns if "eoslhcb.cern.ch" in lfn]
return lfns
# TODO warn if some of the first N files was not resolved to a URL
# since then one would get numerically different results.
if __name__ == "__main__":
# bkk_path = ("/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8"
# "/Sim10-Up08/Digi15-Up04")
# evt_type = "30000000"
bkk_path_for_data = (
"/LHCb/Collision18/Beam6500GeV-VeloClosed-MagDown/Real\ Data/Reco18/Stripping34/90000000/BHADRON.MDST"
)
# for url in get_access_urls_mc(bkk_path, evt_type, ['XDIGI']):
for url in get_access_urls_data(bkk_path_for_data, max_files=10):
print(url)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment