Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JPHYSICS::JAbsorptionLength Struct Reference

Auxiliary data structure to customize absorption length. More...

#include <JPDFSupportkit.hh>

Inheritance diagram for JPHYSICS::JAbsorptionLength:
JPHYSICS::JAbsorptionLength_t std::map< std::string, JAbsorptionLength_t::pF >

Public Types

typedef double(*) pF(const double)
 

Public Member Functions

 JAbsorptionLength ()
 Default constructor.
 

Static Public Member Functions

static double getAbsorptionLength (const double lambda)
 Get absorption length.
 

Static Private Member Functions

static double & get_factor ()
 Get reference to multiplication factor.
 
static pFget_function ()
 Get reference to global functon.
 

Friends

std::istream & operator>> (std::istream &in, JAbsorptionLength &absorption)
 Read absorption length from input stream.
 
std::ostream & operator<< (std::ostream &out, const JAbsorptionLength &absorption)
 Write absorption length to output stream.
 

Detailed Description

Auxiliary data structure to customize absorption length.

Definition at line 39 of file JPDFSupportkit.hh.

Member Typedef Documentation

◆ pF

double(*) JPHYSICS::JAbsorptionLength_t::pF(const double)
inherited

Definition at line 32 of file JPDFSupportkit.hh.

Constructor & Destructor Documentation

◆ JAbsorptionLength()

JPHYSICS::JAbsorptionLength::JAbsorptionLength ( )
inline

Default constructor.

Definition at line 46 of file JPDFSupportkit.hh.

47 {
48 (*this)["default"] = NAMESPACE::getAbsorptionLength;
49 (*this)["Smith&Baker"] = getAbsorptionLengthSmithAndBaker;
50 }
double getAbsorptionLengthSmithAndBaker(const double lambda)
Absorption length of deep-sea water according Smith & Baker.
double getAbsorptionLength(const double lambda)

Member Function Documentation

◆ getAbsorptionLength()

static double JPHYSICS::JAbsorptionLength::getAbsorptionLength ( const double lambda)
inlinestatic

Get absorption length.

Parameters
lambdawavelength of light [nm]
Returns
absorption length [m]

Definition at line 103 of file JPDFSupportkit.hh.

104 {
105 return get_factor() * (*get_function())(lambda);
106 }
static double & get_factor()
Get reference to multiplication factor.
static pF & get_function()
Get reference to global functon.

◆ get_factor()

static double & JPHYSICS::JAbsorptionLength::get_factor ( )
inlinestaticprivate

Get reference to multiplication factor.

Returns
factor

Definition at line 114 of file JPDFSupportkit.hh.

115 {
116 static double factor = 1.0;
117
118 return factor;
119 }

◆ get_function()

static pF & JPHYSICS::JAbsorptionLength::get_function ( )
inlinestaticprivate

Get reference to global functon.

Returns
function

Definition at line 127 of file JPDFSupportkit.hh.

128 {
130
131 return f1;
132 }
double(*) pF(const double)

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JAbsorptionLength & absorption )
friend

Read absorption length from input stream.

Parameters
ininput stream
absorptionabsorption length
Returns
input stream

Definition at line 60 of file JPDFSupportkit.hh.

61 {
62 using namespace std;
63
64 for (string option; in >> option >> JAbsorptionLength::get_factor(); ) {
65
66 JAbsorptionLength::const_iterator p = absorption.find(option);
67
68 if (p != absorption.end())
70 else
71 in.setstate(ios_base::badbit);
72 }
73
74 return in;
75 }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JAbsorptionLength & absorption )
friend

Write absorption length to output stream.

Parameters
outoutput stream
absorptionabsorption length
Returns
output stream

Definition at line 85 of file JPDFSupportkit.hh.

86 {
87 for (const_iterator i = absorption.begin(); i != absorption.end(); ++i) {
88 if (i->second == JAbsorptionLength::get_function()) {
89 out << i->first << ' ';
90 }
91 }
92
93 return out << JAbsorptionLength::get_factor();
94 }

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