ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
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 More...
 
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

Definition at line 21 of file RtData_t_r_reso.h.

21 : m_isValid(false), m_npars(0), m_regionId(0) {}

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  }

◆ 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.

24 { m_isValid = f; }

◆ 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 (unsigned int i = 0; i < 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  }

◆ 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

Definition at line 32 of file RtData_t_r_reso.h.

32 { m_regionId = id; }

◆ 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:
beamspotman.r
def r
Definition: beamspotman.py:676
MuonCalib::RtData_t_r_reso::m_timeVec
DataVec m_timeVec
Definition: RtData_t_r_reso.h:54
M_MAX_PARS
#define M_MAX_PARS
Definition: RtData_t_r_reso.cxx:12
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonCalib::RtData_t_r_reso::m_radiusVec
DataVec m_radiusVec
Definition: RtData_t_r_reso.h:55
MuonCalib::RtData_t_r_reso::m_resoVec
DataVec m_resoVec
Definition: RtData_t_r_reso.h:56
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonCalib::RtData_t_r_reso::m_isValid
bool m_isValid
Definition: RtData_t_r_reso.h:49
python.xAODType.dummy
dummy
Definition: xAODType.py:4
hist_file_dump.f
f
Definition: hist_file_dump.py:135
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
MuonCalib::RtData_t_r_reso::reset
void reset()
Definition: RtData_t_r_reso.cxx:90
MuonCalib::RtData_t_r_reso::m_npars
unsigned int m_npars
Definition: RtData_t_r_reso.h:51
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonCalib::RtData_t_r_reso::m_regionId
int m_regionId
Definition: RtData_t_r_reso.h:52