Manages the I/O of the Rt realtions from/to file.
More...
#include <RtDataFromFile.h>
|
| RtDataFromFile () |
|
| ~RtDataFromFile ()=default |
|
unsigned int | nRts () const |
| return number of rt relations More...
|
|
RtRelation * | getRt (unsigned int regionId) const |
| retrieve rt-relation for a give regionId More...
|
|
void | setNRts (unsigned int nrts) |
| set total number of regions More...
|
|
bool | addRt (int regionId, RtRelation *rt) |
| RtDataFromFile takes ownership of rt. More...
|
|
bool | addRt (int regionId, RtRelation *rt, const RtFullInfo *info) |
|
std::istream & | read (std::istream &is) |
|
std::ostream & | write (std::ostream &os, int region) const |
|
std::ostream & | write (std::ostream &os) const |
|
void | write_forDB (FILE *frt, FILE *frtt, FILE *frtr, FILE *frts, int region) const |
|
void | write_forDB (FILE *frt, FILE *frtt, FILE *frtr, FILE *frts) const |
|
void | setVersion (int major, int minor) |
|
Manages the I/O of the Rt realtions from/to file.
Definition at line 21 of file RtDataFromFile.h.
◆ RtRelation
◆ RtRelations
◆ RtDataFromFile()
MuonCalib::RtDataFromFile::RtDataFromFile |
( |
| ) |
|
|
inline |
◆ ~RtDataFromFile()
MuonCalib::RtDataFromFile::~RtDataFromFile |
( |
| ) |
|
|
default |
◆ addRt() [1/2]
bool MuonCalib::RtDataFromFile::addRt |
( |
int |
regionId, |
|
|
RtRelation * |
rt |
|
) |
| |
|
inline |
RtDataFromFile takes ownership of rt.
Definition at line 51 of file RtDataFromFile.h.
52 if (regionId < 0 || regionId >= (
int)
m_rts) {
54 log << MSG::WARNING <<
"addRt() <regionId out of range> " << regionId <<
" size " <<
m_rts <<
endmsg;
59 log << MSG::WARNING <<
"addRt() <rt already set>" <<
endmsg;
◆ addRt() [2/2]
◆ getRt()
RtRelation* MuonCalib::RtDataFromFile::getRt |
( |
unsigned int |
regionId | ) |
const |
|
inline |
retrieve rt-relation for a give regionId
Definition at line 34 of file RtDataFromFile.h.
35 if (regionId >= (
unsigned int)
m_rts) {
37 log << MSG::WARNING <<
"getRt() <regionId out of range> " << regionId <<
" size " <<
m_rts <<
endmsg;
◆ nRts()
unsigned int MuonCalib::RtDataFromFile::nRts |
( |
| ) |
const |
|
inline |
◆ read()
std::istream & MuonCalib::RtDataFromFile::read |
( |
std::istream & |
is | ) |
|
Definition at line 18 of file RtDataFromFile.cxx.
25 unsigned long int pos = 0;
26 std::string::size_type
start = rts_str.find_first_not_of(
' ',
pos);
27 if (
start == std::string::npos)
28 throw std::runtime_error(
29 Form(
"File: %s, Line: %d\nRtDataFromFile::read() - problems extracting m_rts, exiting", __FILE__, __LINE__));
31 std::string::size_type
stop = rts_str.find_first_of(
' ',
start + 1);
32 if (
stop == std::string::npos)
stop = rts_str.size();
36 for (
unsigned int i = 0;
i <
m_rts; ++
i) {
◆ setNRts()
void MuonCalib::RtDataFromFile::setNRts |
( |
unsigned int |
nrts | ) |
|
|
inline |
◆ setVersion()
void MuonCalib::RtDataFromFile::setVersion |
( |
int |
major, |
|
|
int |
minor |
|
) |
| |
|
inline |
◆ write() [1/2]
std::ostream & MuonCalib::RtDataFromFile::write |
( |
std::ostream & |
os | ) |
const |
◆ write() [2/2]
std::ostream & MuonCalib::RtDataFromFile::write |
( |
std::ostream & |
os, |
|
|
int |
region |
|
) |
| const |
Definition at line 55 of file RtDataFromFile.cxx.
58 log << MSG::WARNING <<
"write() <inconsistent rt count>" <<
endmsg;
60 if (region >=
static_cast<int>(
m_rts)) {
62 log << MSG::WARNING <<
"write() <requested not existent region>" <<
endmsg;
◆ write_forDB() [1/2]
void MuonCalib::RtDataFromFile::write_forDB |
( |
FILE * |
frt, |
|
|
FILE * |
frtt, |
|
|
FILE * |
frtr, |
|
|
FILE * |
frts |
|
) |
| const |
◆ write_forDB() [2/2]
void MuonCalib::RtDataFromFile::write_forDB |
( |
FILE * |
frt, |
|
|
FILE * |
frtt, |
|
|
FILE * |
frtr, |
|
|
FILE * |
frts, |
|
|
int |
region |
|
) |
| const |
Definition at line 86 of file RtDataFromFile.cxx.
89 log << MSG::WARNING <<
"write_forDB() <inconsistent rt count>" <<
endmsg;
91 if (region >=
static_cast<int>(
m_rts)) {
93 log << MSG::WARNING <<
"write_forDB() <requested not existent region>" <<
endmsg;
◆ m_fullInfo
◆ m_major_version
int MuonCalib::RtDataFromFile::m_major_version |
|
private |
◆ m_minor_version
int MuonCalib::RtDataFromFile::m_minor_version |
|
private |
◆ m_rtRelations
◆ m_rts
unsigned int MuonCalib::RtDataFromFile::m_rts |
|
private |
The documentation for this class was generated from the following files: