Iguana LATEST
Implementation Guardian of Analysis Algorithms
Loading...
Searching...
No Matches
iguana::RCDBReader Class Reference

#include <RCDBReader.h>

Detailed Description

RCDB reader.

This class interfaces to the RCDB. The database connection path is chosen from one of the following, in order:

  • The global variable iguana::GlobalRcdbUrl; by default this is not set to any value (its type is iguana::GlobalParam)
  • The environment variable RCDB_CONNECTION (which is likely set if you are on ifarm)
  • A default URL, which will be printed in a warning; see iguana::RCDBReader::m_default_url

RCDB will automatically use mariadb / mysql or sqlite, depending on the above RCDB database path, and whether you have satisfied the dependencies.

Note
If you are reading Monte Carlo data with run number iguana::MC_RUN_NUM = 11, RCDB queries may fail. See "override" methods, such as RCDBReader::SetBeamEnergyOverride, which allow you set values for such quantities. If you are configuring an algorithm's RCDBReader instance, you would need to call these override methods after calling Algorithm::Start. Note that some algorithms may have configuration parameters which also provide such overrides.

Definition at line 31 of file RCDBReader.h.

Public Member Functions

double GetBeamEnergy (int const runnum)
 RCDBReader (std::string_view name="rcdb", Logger::Level lev=Logger::DEFAULT_LEVEL)
void SetBeamEnergyOverride (double const beam_energy)
 set the beam energy to a fixed value; GetBeamEnergy will return this energy
 ~RCDBReader ()
 destructor
Public Member Functions inherited from iguana::Object
std::unique_ptr< Logger > & GetLog ()
std::string GetName () const
std::unique_ptr< Logger > & Log ()
 Object (std::string_view name="", Logger::Level lev=Logger::DEFAULT_LEVEL)
void SetLogLevel (Logger::Level const lev)
void SetLogLevel (std::string_view lev)
void SetName (std::string_view name)

Protected Attributes

std::string const m_default_url = "mysql://rcdb@clasdb.jlab.org/rcdb"
 default RCDB URL, used as a last resort
Protected Attributes inherited from iguana::Object
std::unique_ptr< Loggerm_log
 Logger instance for this object
std::string m_name
 The name of this object.
Inheritance diagram for iguana::RCDBReader:
Inheritance graph

Constructor & Destructor Documentation

◆ RCDBReader()

iguana::RCDBReader::RCDBReader ( std::string_view name = "rcdb",
Logger::Level lev = Logger::DEFAULT_LEVEL )
Parameters
namethe name of this reader
levthe log level

Member Function Documentation

◆ GetBeamEnergy()

double iguana::RCDBReader::GetBeamEnergy ( int const runnum)
Parameters
runnumrun number
Returns
the beam energy in GeV

◆ SetBeamEnergyOverride()

void iguana::RCDBReader::SetBeamEnergyOverride ( double const beam_energy)

set the beam energy to a fixed value; GetBeamEnergy will return this energy

Parameters
beam_energythe beam energy in GeV

Member Data Documentation

◆ m_default_url

std::string const iguana::RCDBReader::m_default_url = "mysql://rcdb@clasdb.jlab.org/rcdb"
protected

default RCDB URL, used as a last resort

Definition at line 54 of file RCDBReader.h.


The documentation for this class was generated from the following file:
  • /__w/iguana/iguana/iguana_src/src/iguana/services/RCDBReader.h