Registering Skim Modes#
The method for registering skim modes in VIBE is very similar as detailed in Registering your Validation Mode.
Part 1: Register in vibe/mode_registration.py#
First we must register our mode in vibe/mode_registration.py, in the case of skim modes, you must pass to the group variable, the SkimWorkingGroup variant associated with your working group. This is determined by the subdirectory of vibe/skim_production_modes you created your python script into. For the example, we will use the example group. We must also tell VIBE that our mode is a skim_production mode by passing the ModeType.skim_production variant to the mode_type variable like so:
# vibe/mode_registration.py
from vibe.core.mode import Mode, ModeType
from vibe.core.helper.working_groups import DPGroup, SkimWorkingGroup
from vibe.skim_production.example.DocSkimExampleMode import DocSkimExampleMode
available_modes = [
# -- At the bottom of the list
Mode(
validation_class = DocSkimExampleMode,
mode_type = ModeType.skim_production,
group = SkimWorkingGroup.example
)
]
And with that, step 1 of registration is complete.
Part 2: Register in vibe/skim_production_modes/<group>/<group>_production_modes.json#
Now we must register the mode inside the groups json file. This is where we tell VIBE what datasets we would like to skim along with a local file for testing your skim workflow. This has a similar format to that shown in Registering your Validation Mode, however some if the keys in the JSON file are named differently to distinguish them from an analysis_validation mode.
{
"docSkimExampleMode" : {
"skim_dataset_dict" : {
"charged" : "/path/to/charged/MC/dataset/on/grid",
"mixed" : "/path/to/mixed/MC/dataset/on/grid"
},
"local_test_file" : "path/to/local/test/file.mdst.root"
}
}
To note here is the skim_dataset_dict key, in contrast to the analysis_validation which required us to use dataset_dict. We do this because if we are to run the full skim analysis workflow, what will become the inputs of dataset_dict don’t actually exist yet. If we look back to our example workflow diagram:
The first two tasks on the far left are submitting skim projects to the grid using the SkimAttributes we defined in Skimming in VIBE. The datasets that are produced from this first set of tasks known as SkimProductionNtupleProductionTask`s will become the input for the `AnalysisNtupleProductionTask`s upstream in the workflow. VIBE will dynamically update the group JSON file with the new datasets under the key `dataset_dict along with any parameters set in AnalysisParameters inside of SkimAttributes during run time. Then when the AnalysisNtupleProductionTask`s are ran, all the information required will be present and it can submit the basf2 path defined in the method `create_basf2_path of your skim production mode for the validation step of VIBE.
Note
For more detailed insight into skimming in VIBE check out Skimming Expert Info Dump