Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
BlockAccessor.cpp File Reference
#include "BlockAccessor.h"
Include dependency graph for BlockAccessor.cpp:

Go to the source code of this file.

Functions

std::shared_ptr< BlockAccessoroperator+ (std::shared_ptr< BlockAccessor > lhs, std::shared_ptr< BlockAccessor > rhs)
 
std::shared_ptr< BlockAccessoroperator>> (std::shared_ptr< BlockAccessor > lhs, std::shared_ptr< BlockAccessor > rhs)
 
std::ostream & operator<< (std::ostream &os, std::shared_ptr< BlockAccessor > ba)
 

Function Documentation

◆ operator+()

std::shared_ptr< BlockAccessor > operator+ ( std::shared_ptr< BlockAccessor lhs,
std::shared_ptr< BlockAccessor rhs 
)

All blocks from lhs and rhs are deep-copied into a new accessor using the Block(std::shared_ptr<Block>) constructor.

If both accessors contain a block with the same resolved name, this is considered an error.

Parameters
lhsLeft-hand accessor.
rhsRight-hand accessor.
Returns
New accessor containing all blocks from both operands.
Exceptions
Vialogging/error handling if overlapping block names are found.

Definition at line 82 of file BlockAccessor.cpp.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
std::shared_ptr< BlockAccessor ba 
)

Prints all block names and their parameter values using BlockAccessor::getAllValues:

id: value
...
Block MASS:
...
const Prototype SMINPUTS
const Prototype MASS
Definition Block.h:73
Parameters
osOutput stream.
baShared pointer to the BlockAccessor to print.
Returns
The output stream.

Definition at line 165 of file BlockAccessor.cpp.

◆ operator>>()

std::shared_ptr< BlockAccessor > operator>> ( std::shared_ptr< BlockAccessor lhs,
std::shared_ptr< BlockAccessor rhs 
)

Semantics:

  • all rhs blocks are copied first,
  • lhs blocks are then merged on top,
  • if a block exists only in lhs, it is copied entirely,
  • if a parameter exists in both lhs and rhs:
    • lhs central value is kept,
    • if lhs uncertainties are non-zero, lhs is kept unchanged,
    • if lhs has zero stat+syst uncertainties, rhs uncertainties are copied into a copy of lhs.
Parameters
lhsPriority accessor.
rhsSecondary accessor.
Returns
New merged accessor.

Definition at line 110 of file BlockAccessor.cpp.