Auxiliary data structure for I/O of transmittances of optical modules in detector.
More...
#include <JTransmittances.hh>
|
| transmittance_type | operator[] (const int id) const |
| | Get transmittances of given optical module.
|
| |
| void | load (const char *file_name) |
| | Load from input file.
|
| |
| void | store (const char *file_name) const |
| | Store to output file.
|
| |
Auxiliary data structure for I/O of transmittances of optical modules in detector.
Definition at line 94 of file JTransmittances.hh.
◆ operator[]()
Get transmittances of given optical module.
In the absence of a module identifier, default values are returned.
- Parameters
-
- Returns
- transmittances
Definition at line 108 of file JTransmittances.hh.
109 {
110 const_iterator p = find(id);
111
112 if (p != this->end())
113 return p->second;
114 else
115 return transmittance_type();
116 }
◆ load()
Load from input file.
- Parameters
-
Definition at line 30 of file JObjectStreamIO.hh.
31 {
33 }
void load(const std::string &file_name, T &object)
Load object from input file.
◆ store()
Store to output file.
- Parameters
-
Definition at line 41 of file JObjectStreamIO.hh.
42 {
44 }
void store(const std::string &file_name, const T &object)
Store object to output file.
◆ operator>>
Read transmittances from input stream.
- Parameters
-
| in | input stream |
| transmittances | transmittances |
- Returns
- input stream
Definition at line 126 of file JTransmittances.hh.
127 {
128 int id;
129 transmittance_type transmittance;
130
131 while (in >> id >> transmittance) {
132 transmittances[id] = transmittance;
133 }
134
135 return in;
136 }
◆ operator<<
Write transmittances to output stream.
- Parameters
-
| out | output stream |
| transmittances | transmittances |
- Returns
- output stream
Definition at line 146 of file JTransmittances.hh.
147 {
149
150 for (const auto& i : transmittances) {
151 out << i.first << ' ' << i.second << endl;
152 }
153
154 return out;
155 }
The documentation for this struct was generated from the following file: