Skip to content
Snippets Groups Projects
Commit 888726bc authored by Eduardo Rodrigues's avatar Eduardo Rodrigues Committed by Patrick Koppenburg
Browse files

Minor fixes and improvements to DaVinci/LbExec.py

parent eaed0c44
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!786Minor fixes and improvements to DaVinci/LbExec.py
......@@ -20,41 +20,36 @@ from PyConf.application import default_raw_event
class Options(DefaultOptions):
"""
A class that holds the user-specified DaVinci options.
This class inherits from the default "GaudiConf.LbExec.Options".
This class also configures the following PyConf functions, where their keyword
arguments are globally bound to the user-specified values.
This way users do not have to manually configure these functions themselves.
- upfont_decoder
- reconstruction
- get_tes_root
- get_odin
- get_hlt_reports
- get_mc_track_info
This class inherits from the default `GaudiConf.LbExec.Options`.
Four user-required parameters need to be set in this class:
- input_process (str): input_process type, either 'Spruce' or 'Turbo' or 'Hlt2'
- input_manifest (str): Path to the input manifest file
- annsvc_config (str): Path to the configuration file from sprucing or Hlt2
- metainfo_additional_tags (str): List of additional tags to be added to the metainfo
This class also configures several PyConf functions,
see the list in the `apply_binds` method,
where their keyword arguments are globally bound to the user-specified values.
This way, users do not have to manually configure these functions themselves.
The following user-required parameters need to be set in this class:
- input_process (str): Input process type, see `GaudiConf.LbExec.options.InputProcessTypes` values.
The optional parameters that need to be set are :
- stream (str): Stream name. Default is "default" (Note for "input_process=Hlt2" the stream must be strictly empty the default value is overwritten in this case).
- stream (str): Stream name. Default is "default"
Note: for `input_process=Hlt2` the stream must be strictly empty. The default value is overwritten in this case.
- lumi (bool): Flag to store luminosity information. Default is False.
- evt_pre_filter (dict[str,str]): Event pre-filter code. Default is None.
- enable_unpack (bool): Flag to enable the unpacking of the input data. Default is True.
- evt_pre_filters (dict[str,str]): Event pre-filter code. Default is None.
- annsvc_config (str): Path to the configuration file from sprucing or Hlt2. Default is None.
- write_fsr (bool): Flag to write full stream record. Default is True.
- merge_genfsr (bool): Flag to merge the full stream record. Default is False.
- metainfo_additional_tags: (list): Additional central tags for `PyConf.filecontent_metadata.metainfo_repos`.
Default is [].
"""
input_manifest_file: Optional[str]
metainfo_additional_tags: Optional[list]
annsvc_config: Optional[str]
input_process: InputProcessTypes
stream: Optional[str] = 'default'
lumi: bool = False
evt_pre_filters: Optional[dict[str, str]] = None
annsvc_config: Optional[str] = None
write_fsr: bool = True
merge_genfsr: bool = False
metainfo_additional_tags: Optional[list] = []
@root_validator(pre=False)
def _stream_default(cls, values):
......@@ -65,7 +60,7 @@ class Options(DefaultOptions):
values (dict): User-specified attributes of the Options object.
Returns:
dict: Modified attributes of the Options object
dict: Modified attributes of the Options object.
"""
input_process = values.get("input_process")
if input_process == InputProcessTypes.Hlt2:
......@@ -77,24 +72,25 @@ class Options(DefaultOptions):
def apply_binds(self):
"""
This function configures the following PyConf functions, where their keyword
arguments are globally bound to the user-specified values.
This way users do not have to manually configure these functions themselves.
arguments are globally bound to the user-specified values:
- default_raw_event
- upfont_decoder
- reconstruction
- get_tes_root
- get_odin
- get_hlt_reports
- get_mc_track_info
This way users do not have to manually configure these functions themselves.
"""
default_raw_event.global_bind(raw_event_format=self.input_raw_format)
upfront_decoder.global_bind(
input_process=self.input_process, stream=self.stream)
reconstruction.global_bind(input_process=self.input_process)
get_mc_track_info.global_bind(input_process=self.input_process)
get_tes_root.global_bind(input_process=self.input_process)
get_odin.global_bind(
input_process=self.input_process, stream=self.stream)
get_hlt_reports.global_bind(
input_process=self.input_process, stream=self.stream)
get_mc_track_info.global_bind(input_process=self.input_process)
with super().apply_binds():
yield
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