Skip to content

Commit

Permalink
Implement event skim
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianoDee committed Sep 7, 2024
1 parent eed3e7e commit 3296c30
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions core/model/relval_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,36 @@ def __build_das_command(self, step_index):
command += 'dasgoclient --limit 0 '
command += f'--query "file dataset={dataset} run in [{run_chunk}]" '
command += f'>> {files_name}\n'
return (comment + '\n' + command).strip()

events = input_dict['events']

## N.B. das-up-to-nevents.py exists only from 14_1_0_pre7
## so we check for cmssw_release ==
## - 14_1_0_pre7
## - 14_1_X (no prereleases)
## - 14_2_X (any)
## - >= 15_X (any)

cmssw_release = self.get_release()
check_das_up_to_nevents = int(cmssw_release.split("_")[0]) >= 15
if not check_das_up_to_nevents:
check_das_up_to_nevents = "14_2" in check_das_up_to_nevents
if not check_das_up_to_nevents:
check_das_up_to_nevents = ("14_1" in cmssw_release and "pre" not in cmssw_release)
if not check_das_up_to_nevents:
check_das_up_to_nevents = (cmssw_release == "14_1_0_pre7")

if events and check_das_up_to_nevents:
self.logger.info('Making a DAS command for step %s with max events', step_index)
files_name = f'step{step_index + 1}_files.txt'
comment = f'# Arguments for step {step_index + 1}:\n'
command = f'# Command for step {step_index + 1}:\n'
comment += f'# dataset: {dataset}\n'
comment += f'# events : {events}\n'
command += f'echo "" > {files_name}\n'
commnad += f'das-up-to-nevents.py -d {dataset} -e {events} --pc'
command += f'>> {files_name}\n'
return (comment + '\n' + command).strip()

return f'# Step {step_index + 1} is input dataset for next step: {dataset}'
Expand Down

0 comments on commit 3296c30

Please sign in to comment.