Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
NuisanceReader Class Reference

Loads and parses nuisance-parameter specifications. More...

#include <NuisanceReader.h>

Inheritance diagram for NuisanceReader:
Collaboration diagram for NuisanceReader:

Public Member Functions

 NuisanceReader (std::shared_ptr< INuisancePathsProvider > paths_provider)
 Constructs a nuisance reader with an external path provider.
 
NuisanceRegistry load_default () const override
 Loads the built-in nuisance-parameter registry.
 
NuisanceRegistry load_user () const override
 Loads the nuisance registry from the configured user source.
 
NuisanceRegistry load_user (const fs::path &user_path) const override
 Loads the nuisance registry from an explicit user file.
 
NuisanceRegistry load () const
 Loads the merged nuisance registry.
 
fs::path default_path () const
 Returns the configured default nuisance-file path.
 
fs::path user_path () const
 Returns the configured user nuisance-file path.
 
- Public Member Functions inherited from INuisanceReader
virtual ~INuisanceReader ()=default
 Virtual destructor for polymorphic use.
 

Detailed Description

Loads and parses nuisance-parameter specifications.

This class reads nuisance entries from the paths supplied by an INuisancePathsProvider. The public load function merges the default registry with the user registry, where user entries override defaults with the same ParamId.

Supported entry fields include:

  • block: LHA block name,
  • code: LHA code,
  • min_val or min: lower bound,
  • max_val or max: upper bound,
  • distribution or marginal: marginal type.
Exceptions
std::invalid_argumentif constructed with a null path provider.
std::runtime_errorfor missing required fields, invalid bounds, unknown distributions, missing files, or malformed input nodes.

Definition at line 50 of file NuisanceReader.h.

Constructor & Destructor Documentation

◆ NuisanceReader()

NuisanceReader::NuisanceReader ( std::shared_ptr< INuisancePathsProvider paths_provider)
explicit

Constructs a nuisance reader with an external path provider.

Parameters
paths_providerProvider used to resolve default and user nuisance configuration files.
Exceptions
std::invalid_argumentif paths_provider is null.

Definition at line 92 of file NuisanceReader.cpp.

Member Function Documentation

◆ default_path()

fs::path NuisanceReader::default_path ( ) const

Returns the configured default nuisance-file path.

Returns
Path supplied by INuisancePathsProvider::default_nuisances_path.

Definition at line 100 of file NuisanceReader.cpp.

◆ load()

NuisanceRegistry NuisanceReader::load ( ) const

Loads the merged nuisance registry.

The default registry is loaded first. User-defined entries are then merged on top and override default specifications with identical parameter ids.

Returns
Merged nuisance registry.
Exceptions
std::runtime_errorif either source cannot be loaded or parsed.

Definition at line 142 of file NuisanceReader.cpp.

◆ load_default()

NuisanceRegistry NuisanceReader::load_default ( ) const
overridevirtual

Loads the built-in nuisance-parameter registry.

Returns
Registry containing the default nuisance specifications.
Exceptions
std::runtime_errorif the default source is missing, malformed, or cannot be parsed by the concrete implementation.

Implements INuisanceReader.

Definition at line 108 of file NuisanceReader.cpp.

◆ load_user() [1/2]

NuisanceRegistry NuisanceReader::load_user ( ) const
overridevirtual

Loads the nuisance registry from the configured user source.

Returns
Registry containing user-defined nuisance specifications. The registry may be empty when no user source is configured.
Exceptions
std::runtime_errorif the configured user source exists but cannot be read or parsed.

Implements INuisanceReader.

Definition at line 123 of file NuisanceReader.cpp.

◆ load_user() [2/2]

NuisanceRegistry NuisanceReader::load_user ( const fs::path &  user_path) const
overridevirtual

Loads the nuisance registry from an explicit user file.

Parameters
user_pathPath to the user nuisance file. An empty path may be interpreted by implementations as "no user overrides".
Returns
Registry containing nuisance specifications from user_path.
Exceptions
std::runtime_errorif user_path is non-empty but missing, unreadable, or malformed.

Implements INuisanceReader.

Definition at line 127 of file NuisanceReader.cpp.

◆ user_path()

fs::path NuisanceReader::user_path ( ) const

Returns the configured user nuisance-file path.

Returns
Path supplied by INuisancePathsProvider::user_nuisances_path.

Definition at line 104 of file NuisanceReader.cpp.


The documentation for this class was generated from the following files: