ParameterSet Creation » History » Version 3
This page is under construction
From a FHiCL document¶
ParameterSet object can be obtained directly from a FHiCL document by calling a function,
make_ParameterSet. The call takes one of two forms, depending on how the document is represented.
- Given a FHiCL document represented by a variable
#include "fhiclcpp/make_ParameterSet.h" ... fhicl::ParameterSet pset; fhicl::make_ParameterSet(doc, pset);
- Given a FHiCL document contained in an external text file, there is the slight complication of finding the correct file. This is handled by appealing to functionality found in the external
cetliblibrary. Given (a) the file's name as a variable
std::stringand (b) a variable
makerof static type
#include "fhiclcpp/make_ParameterSet.h" ... fhicl::ParameterSet pset; fhicl::make_ParameterSet(fname, maker, pset);
From multiple sources¶
In practice, it is often the case that a FHiCL document is not the sole source for obtaining a
ParameterSet. Additional information may come from command-line arguments, for example, and may be used to augment or otherwise adjust a
ParameterSet before it is considered finalized.
While it is possible to update a
ParameterSet directly (e.g., via its
erase member functions), such an approach is not generally recommended, as the design of the
ParameterSet class is strongly biased in favor of inspection and retrieval operations and against modifications. This is the reason for the earlier recommendation that a
ParameterSet be generally treated as immutable.