diff --git a/processor/tasks/CROWNRun.py b/processor/tasks/CROWNRun.py index f09fe45..88fda34 100644 --- a/processor/tasks/CROWNRun.py +++ b/processor/tasks/CROWNRun.py @@ -52,17 +52,6 @@ def create_branch_map(self): for filecounter, filename in enumerate(inputdata["filelist"]): if (int(filecounter / files_per_task)) not in branches: branches[int(filecounter / files_per_task)] = [] - # This call aims to get a "better" XRootD server to access the file. - # If the file is available on GridKA, take it from there. - # Otherwise, use the official European or global redirector. - filename = get_alternate_file_uri( - filename, - [ - "root://cmsdcache-kit-disk.gridka.de", - "root://xrootd-cms.infn.it", - "root://cms-xrd-global.cern.ch", - ], - ) branches[int(filecounter / files_per_task)].append(filename) for x in branches: branch_map[branchcounter] = {} @@ -114,6 +103,22 @@ def run(self): _inputfiles = branch_data["files"] _sample_type = branch_data["sample_type"] _era = branch_data["era"] + + # This call aims to get a "better" XRootD server to access the file. + # If the file is available on GridKA, take it from there. + # Otherwise, use the official European or global redirector. + _inputfiles = [ + get_alternate_file_uri( + filename, + [ + "root://cmsdcache-kit-disk.gridka.de", + "root://xrootd-cms.infn.it", + "root://cms-xrd-global.cern.ch", + ], + ) + for filename in _inputfiles + ] + # set the outputfilename to the first name in the output list, removing the scope suffix _outputfile = str( rootfile_outputs[0].basename.replace(