Jpp 21.0.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JPHYSICS::JQE Struct Reference

Auxiliary data structure to customize quantum efficiency. More...

#include <JPDFSupportkit.hh>

Inheritance diagram for JPHYSICS::JQE:
std::map< std::string, double(*)(const double)>

Public Member Functions

 JQE ()
 Default constructor.
 

Static Public Member Functions

static double getQE (const double lambda)
 Get quantum efficiency.
 
static double & get_factor ()
 Get reference to multiplication factor.
 
static mapped_type & get_function ()
 Get reference to global functon.
 

Static Public Attributes

static constexpr const char *const default_t = "default"
 

Friends

std::istream & operator>> (std::istream &in, JQE &object)
 Read quantum efficiency from input stream.
 
std::ostream & operator<< (std::ostream &out, const JQE &object)
 Write quantum efficiency to output stream.
 

Detailed Description

Auxiliary data structure to customize quantum efficiency.

Definition at line 471 of file JPDFSupportkit.hh.

Constructor & Destructor Documentation

◆ JQE()

JPHYSICS::JQE::JQE ( )
inline

Default constructor.

Definition at line 480 of file JPDFSupportkit.hh.

481 {
482 (*this)[default_t] = NAMESPACE::getQE;
483
484 get_factor() = 1.0;
485 get_function() = (*this)[default_t];
486 }
double getQE(const double lambda)
static double & get_factor()
Get reference to multiplication factor.
static mapped_type & get_function()
Get reference to global functon.
static constexpr const char *const default_t

Member Function Documentation

◆ getQE()

static double JPHYSICS::JQE::getQE ( const double lambda)
inlinestatic

Get quantum efficiency.

Parameters
lambdawavelength of light [nm]
Returns
quantum efficiency [m]

Definition at line 534 of file JPDFSupportkit.hh.

535 {
536 return get_factor() * (*get_function())(lambda);
537 }

◆ get_factor()

static double & JPHYSICS::JQE::get_factor ( )
inlinestatic

Get reference to multiplication factor.

Returns
factor

Definition at line 545 of file JPDFSupportkit.hh.

546 {
547 static double factor = 1.0;
548
549 return factor;
550 }

◆ get_function()

static mapped_type & JPHYSICS::JQE::get_function ( )
inlinestatic

Get reference to global functon.

Returns
function

Definition at line 558 of file JPDFSupportkit.hh.

559 {
560 static mapped_type f1 = NAMESPACE::getQE;
561
562 return f1;
563 }

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JQE & object )
friend

Read quantum efficiency from input stream.

Parameters
ininput stream
objectquantum efficiency
Returns
input stream

Definition at line 496 of file JPDFSupportkit.hh.

497 {
498 using namespace std;
499
500 for (string option; in >> option >> JQE::get_factor(); ) {
501
502 JQE::const_iterator p = object.find(option);
503
504 if (p != object.end())
505 JQE::get_function() = p->second;
506 else
507 in.setstate(ios_base::badbit);
508 }
509
510 return in;
511 }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JQE & object )
friend

Write quantum efficiency to output stream.

Parameters
outoutput stream
objectquantum efficiency
Returns
output stream

Definition at line 521 of file JPDFSupportkit.hh.

522 {
523 return out << getKey(object, default_t, get_function())
524 << ' ' << JQE::get_factor();
525 }
std::string getKey(const std::map< std::string, T > &map, const std::string &key, const T &value)
Auxiliary method to get preferred key for given value.

Member Data Documentation

◆ default_t

const char* const JPHYSICS::JQE::default_t = "default"
staticconstexpr

Definition at line 474 of file JPDFSupportkit.hh.


The documentation for this struct was generated from the following file: