LArSoft code obtains configuration information from the art event processing framework framework via C++ bindings to FHiCL, the configuration language used by art. User-written FHiCL files are read by art at job startup, which is then passed to art modules, services and tools. Algorithm code uses templated parameter-set structures to access the information.
There are a set of guidelines to follow for developing configurations and configuration-aware C++ code, resulting in:
- better maintainability
- easier-to-understand configurations
- less time debugging; more time on physics
It is recommended that everyone go through the following two presentations:
- Kyle Knoepfel – Configuration best practices, helpers and FHiCL-file validation – Video of presentation or Slides of presentation
- This presentation covers setting up a FHiCL file including how to set up a PROLOG and the #include facility and the rules about using it. The directory of a file to be included must be present on the FHICL_FILE_PATH environment variable. Don’t abuse #include. Only #include files that contain only prologs. A common frustration is how to know what parameters to specify for a given module. While looking at the source code is one solution, it would be better to devise a system that would document itself. Kyle demonstrated ‘art –help’ and ‘art –print-available-modules’ and where users put in the allowed configuration. Trying to ensure easy-to-maintain code that is simple to understand allowing more time to be spent on physics.
- Robert Kutschke – A Case Study in Using FHiCL to ensure single points of maintenance – Slides of presentation
- When designing its use of FHiCL, Mu2e set two goals: parameters should have a single point of maintenance and FHiCL that can be run interactively should be runnable on the grid without editing. Rob’s talk showed several FHiCL fragments from actual Mu2e MC production FHiCL files. One technique is to define base configuration fragments and apply deltas to that base; this naturally leads to deep configuration hierarchies. The trick to making an interactive FHiCL file grid-ready is to design the grid scripts and the interactive FHiCL files together; the grid scripts do their job by applying prefixes and postfixes to the interactive FHiCL file – we have never needed to “reach in and edit” a FHiCL file as part of a grid job.