ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalib::RtData_t_r_reso Class Reference

Represents an Rt relation in the form of a set of (time,radius,resolution) points. More...

#include <RtData_t_r_reso.h>

Collaboration diagram for MuonCalib::RtData_t_r_reso:

Public Types

typedef std::vector< double > DataVec

Public Member Functions

 RtData_t_r_reso ()
bool isValid () const
void isValid (bool f)
unsigned int regionId () const
const DataVectimes () const
const DataVecradii () const
const DataVecresolution () const
void setRegionId (int id)
bool addEntry (double t, double r, double reso)
 returns falls if the current time is smaller then the previous one
void reset ()
std::istream & read (std::istream &is)
std::ostream & write (std::ostream &os) const
void write_forDB (FILE *frtt, FILE *frtr, FILE *frts) const

Private Attributes

bool m_isValid
unsigned int m_npars
int m_regionId
DataVec m_timeVec
DataVec m_radiusVec
DataVec m_resoVec

Detailed Description

Represents an Rt relation in the form of a set of (time,radius,resolution) points.

Definition at line 16 of file RtData_t_r_reso.h.

Member Typedef Documentation

◆ DataVec

typedef std::vector<double> MuonCalib::RtData_t_r_reso::DataVec

Definition at line 18 of file RtData_t_r_reso.h.

Constructor & Destructor Documentation

◆ RtData_t_r_reso()

MuonCalib::RtData_t_r_reso::RtData_t_r_reso ( )
inline

Member Function Documentation

◆ addEntry()

bool MuonCalib::RtData_t_r_reso::addEntry ( double t,
double r,
double reso )
inline

returns falls if the current time is smaller then the previous one

Definition at line 35 of file RtData_t_r_reso.h.

35 {
36 m_timeVec.push_back(t);
37 m_radiusVec.push_back(r);
38 m_resoVec.push_back(reso);
39 m_npars = m_timeVec.size();
40 return true;
41 }
int r
Definition globals.cxx:22

◆ isValid() [1/2]

bool MuonCalib::RtData_t_r_reso::isValid ( ) const
inline

Definition at line 23 of file RtData_t_r_reso.h.

23{ return m_isValid; }

◆ isValid() [2/2]

void MuonCalib::RtData_t_r_reso::isValid ( bool f)
inline

Definition at line 24 of file RtData_t_r_reso.h.

◆ radii()

const DataVec & MuonCalib::RtData_t_r_reso::radii ( ) const
inline

Definition at line 29 of file RtData_t_r_reso.h.

29{ return m_radiusVec; }

◆ read()

std::istream & MuonCalib::RtData_t_r_reso::read ( std::istream & is)

Definition at line 16 of file RtData_t_r_reso.cxx.

16 {
17 std::string dummy;
18
19 double t(0), r(0), reso(0);
20
21 // read region id and number of points in rt
22 is >> dummy >> m_regionId >> m_npars;
24 // reseve space in vectors
25 m_timeVec.reserve(m_npars);
26 m_radiusVec.reserve(m_npars);
27 m_resoVec.reserve(m_npars);
28
29 // read data from file
30 for (int i = 0; i < static_cast<int>(m_npars); ++i) {
31 // check if eof reached before last entry was read
32 if (is.eof()) {
33 MsgStream log(Athena::getMessageSvc(), "RtData_t_r_reso");
34 log << MSG::WARNING << "read() <unexpected eof> -> exit after " << i - 1 << " entries out of " << m_npars
35 << " were read from file" << endmsg;
36 reset();
37 return is;
38 }
39
40 // read next entry
41 is >> r >> t >> reso;
42 m_timeVec.push_back(t);
43 m_radiusVec.push_back(r);
44 m_resoVec.push_back(reso);
45 }
46
47 // reading success, data valid
48 m_isValid = true;
49
50 return is;
51 }
#define endmsg
#define M_MAX_PARS
IMessageSvc * getMessageSvc(bool quiet=false)

◆ regionId()

unsigned int MuonCalib::RtData_t_r_reso::regionId ( ) const
inline

Definition at line 26 of file RtData_t_r_reso.h.

26{ return m_regionId; }

◆ reset()

void MuonCalib::RtData_t_r_reso::reset ( )

Definition at line 90 of file RtData_t_r_reso.cxx.

90 {
91 m_isValid = false;
92 m_timeVec.clear();
93 m_radiusVec.clear();
94 m_resoVec.clear();
95 }

◆ resolution()

const DataVec & MuonCalib::RtData_t_r_reso::resolution ( ) const
inline

Definition at line 30 of file RtData_t_r_reso.h.

30{ return m_resoVec; }

◆ setRegionId()

void MuonCalib::RtData_t_r_reso::setRegionId ( int id)
inline

◆ times()

const DataVec & MuonCalib::RtData_t_r_reso::times ( ) const
inline

Definition at line 28 of file RtData_t_r_reso.h.

28{ return m_timeVec; }

◆ write()

std::ostream & MuonCalib::RtData_t_r_reso::write ( std::ostream & os) const

Definition at line 53 of file RtData_t_r_reso.cxx.

53 {
54 if (m_isValid) {
55 os << " dummy " << m_regionId << " " << m_npars << std::endl;
56 for (unsigned int i = 0; i < m_npars; ++i) {
57 os << " " << m_radiusVec[i] << " " << m_timeVec[i] << " " << m_resoVec[i] << std::endl;
58 }
59 } else {
60 MsgStream log(Athena::getMessageSvc(), "RtData_t_r_reso");
61 log << MSG::WARNING << "write() <data not valid>" << endmsg;
62 }
63
64 return os;
65 }

◆ write_forDB()

void MuonCalib::RtData_t_r_reso::write_forDB ( FILE * frtt,
FILE * frtr,
FILE * frts ) const

Definition at line 67 of file RtData_t_r_reso.cxx.

67 {
68 if (m_isValid) {
69 fprintf(frtt, "%u", m_npars);
70 fprintf(frtr, "%u", m_npars);
71 fprintf(frts, "%u", m_npars);
72
73 // loop over data and write to std::ostream
74 for (unsigned int i = 0; i < m_npars; ++i) {
75 fprintf(frtt, ",%f", m_timeVec[i]);
76 fprintf(frtr, ",%f", m_radiusVec[i]);
77 fprintf(frts, ",%f", m_resoVec[i]);
78 }
79 fprintf(frtt, "\n");
80 fprintf(frtr, "\n");
81 fprintf(frts, "\n");
82 } else {
83 MsgStream log(Athena::getMessageSvc(), "RtData_t_r_reso");
84 log << MSG::WARNING << "write_forDB() <data not valid>" << endmsg;
85 }
86
87 return;
88 }

Member Data Documentation

◆ m_isValid

bool MuonCalib::RtData_t_r_reso::m_isValid
private

Definition at line 49 of file RtData_t_r_reso.h.

◆ m_npars

unsigned int MuonCalib::RtData_t_r_reso::m_npars
private

Definition at line 51 of file RtData_t_r_reso.h.

◆ m_radiusVec

DataVec MuonCalib::RtData_t_r_reso::m_radiusVec
private

Definition at line 55 of file RtData_t_r_reso.h.

◆ m_regionId

int MuonCalib::RtData_t_r_reso::m_regionId
private

Definition at line 52 of file RtData_t_r_reso.h.

◆ m_resoVec

DataVec MuonCalib::RtData_t_r_reso::m_resoVec
private

Definition at line 56 of file RtData_t_r_reso.h.

◆ m_timeVec

DataVec MuonCalib::RtData_t_r_reso::m_timeVec
private

Definition at line 54 of file RtData_t_r_reso.h.


The documentation for this class was generated from the following files: