Public Member Functions | Private Attributes | Friends | List of all members
gar::raw::BeamInfo Class Reference

#include <BeamInfo.h>

Public Member Functions

 BeamInfo ()
 
 ~BeamInfo ()
 
 BeamInfo (double tor101, double tortgt, double trtgtd, long long int t_ms)
 
double get_tor101 () const
 
double get_tortgt () const
 
double get_trtgtd () const
 
long long int get_t_ms () const
 
void SetTOR101 (double val)
 
void SetTORTGT (double val)
 
void SetTRTGTD (double val)
 
void SetT_MS (long long int val)
 
void SetRecordType (uint8_t val)
 
void SetSeconds (uint32_t val)
 
void SetMilliSeconds (uint16_t val)
 
void SetNumberOfDevices (uint16_t val)
 
void Set (std::string device_name, double val)
 
void Set (std::string device_name, std::vector< double > val)
 
uint8_t GetRecordType () const
 
uint32_t GetSeconds () const
 
uint16_t GetMilliSeconds () const
 
uint16_t GetNumberOfDevices () const
 
std::vector< double > Get (std::string device_name)
 
std::map< std::string, std::vector< double > > GetDataMap () const
 

Private Attributes

double tor101
 
double tortgt
 
double trtgtd
 
long long int t_ms
 
uint8_t fRecordType
 
uint32_t fSeconds
 
uint16_t fMilliSeconds
 
uint16_t fNumberOfDevices
 
std::map< std::string, std::vector< double > > fDataMap
 

Friends

std::ostream & operator<< (std::ostream &, const BeamInfo &)
 

Detailed Description

Definition at line 18 of file BeamInfo.h.

Constructor & Destructor Documentation

gar::raw::BeamInfo::BeamInfo ( )

Definition at line 19 of file BeamInfo.cxx.

20  : tor101(0.)
21  , tortgt(0.)
22  , trtgtd(0.)
23  , t_ms(0)
24  , fRecordType(0)
25  , fSeconds(0)
26  , fMilliSeconds(0)
27  , fNumberOfDevices(0)
28  {
29  }
uint32_t fSeconds
Definition: BeamInfo.h:31
long long int t_ms
Definition: BeamInfo.h:29
uint16_t fMilliSeconds
Definition: BeamInfo.h:32
uint16_t fNumberOfDevices
Definition: BeamInfo.h:33
uint8_t fRecordType
Definition: BeamInfo.h:30
gar::raw::BeamInfo::~BeamInfo ( )

Definition at line 32 of file BeamInfo.cxx.

32 { }
gar::raw::BeamInfo::BeamInfo ( double  tor101,
double  tortgt,
double  trtgtd,
long long int  t_ms 
)

Definition at line 35 of file BeamInfo.cxx.

39  : tor101(vtor101)
40  , tortgt(vtortgt)
41  , trtgtd(vtrtgtd)
42  , t_ms(vt_ms)
43  , fRecordType(0)
44  , fSeconds(0)
45  , fMilliSeconds(0)
46  , fNumberOfDevices(0)
47  {
48  }
uint32_t fSeconds
Definition: BeamInfo.h:31
long long int t_ms
Definition: BeamInfo.h:29
uint16_t fMilliSeconds
Definition: BeamInfo.h:32
uint16_t fNumberOfDevices
Definition: BeamInfo.h:33
uint8_t fRecordType
Definition: BeamInfo.h:30

Member Function Documentation

std::vector<double> gar::raw::BeamInfo::Get ( std::string  device_name)
long long int gar::raw::BeamInfo::get_t_ms ( ) const

Definition at line 69 of file BeamInfo.cxx.

70  {
71  return t_ms;
72  }
long long int t_ms
Definition: BeamInfo.h:29
double gar::raw::BeamInfo::get_tor101 ( ) const

Definition at line 51 of file BeamInfo.cxx.

52  {
53  return tor101;
54  }
double gar::raw::BeamInfo::get_tortgt ( ) const

Definition at line 57 of file BeamInfo.cxx.

58  {
59  return tortgt;
60  }
double gar::raw::BeamInfo::get_trtgtd ( ) const

Definition at line 63 of file BeamInfo.cxx.

64  {
65  return trtgtd;
66  }
std::map<std::string, std::vector<double> > gar::raw::BeamInfo::GetDataMap ( ) const
inline

Definition at line 66 of file BeamInfo.h.

66 {return fDataMap;};
std::map< std::string, std::vector< double > > fDataMap
Definition: BeamInfo.h:34
uint16_t gar::raw::BeamInfo::GetMilliSeconds ( ) const
inline

Definition at line 62 of file BeamInfo.h.

62 {return fMilliSeconds;};
uint16_t fMilliSeconds
Definition: BeamInfo.h:32
uint16_t gar::raw::BeamInfo::GetNumberOfDevices ( ) const
inline

Definition at line 63 of file BeamInfo.h.

63 {return fNumberOfDevices;};
uint16_t fNumberOfDevices
Definition: BeamInfo.h:33
uint8_t gar::raw::BeamInfo::GetRecordType ( ) const
inline

Definition at line 60 of file BeamInfo.h.

60 {return fRecordType;};
uint8_t fRecordType
Definition: BeamInfo.h:30
uint32_t gar::raw::BeamInfo::GetSeconds ( ) const
inline

Definition at line 61 of file BeamInfo.h.

61 {return fSeconds;};
uint32_t fSeconds
Definition: BeamInfo.h:31
void gar::raw::BeamInfo::Set ( std::string  device_name,
double  val 
)

Definition at line 102 of file BeamInfo.cxx.

103  {
104  std::vector<double> vec;
105  vec.push_back(val);
106  Set(device,vec);
107  }
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:102
void gar::raw::BeamInfo::Set ( std::string  device_name,
std::vector< double >  val 
)

Definition at line 110 of file BeamInfo.cxx.

111  {
112  if (fDataMap.find(device)!=fDataMap.end()) {
113  //device already listed
114  return;
115  };
116  std::pair<std::string, std::vector<double> > p(device,val);
117  fDataMap.insert(p);
118  }
p
Definition: test.py:223
std::map< std::string, std::vector< double > > fDataMap
Definition: BeamInfo.h:34
void gar::raw::BeamInfo::SetMilliSeconds ( uint16_t  val)
inline

Definition at line 54 of file BeamInfo.h.

uint16_t fMilliSeconds
Definition: BeamInfo.h:32
void gar::raw::BeamInfo::SetNumberOfDevices ( uint16_t  val)
inline

Definition at line 55 of file BeamInfo.h.

uint16_t fNumberOfDevices
Definition: BeamInfo.h:33
void gar::raw::BeamInfo::SetRecordType ( uint8_t  val)
inline

Definition at line 52 of file BeamInfo.h.

52 {fRecordType=val;};
uint8_t fRecordType
Definition: BeamInfo.h:30
void gar::raw::BeamInfo::SetSeconds ( uint32_t  val)
inline

Definition at line 53 of file BeamInfo.h.

53 {fSeconds=val;};
uint32_t fSeconds
Definition: BeamInfo.h:31
void gar::raw::BeamInfo::SetT_MS ( long long int  val)

Definition at line 96 of file BeamInfo.cxx.

97  {
98  t_ms = val;
99  }
long long int t_ms
Definition: BeamInfo.h:29
void gar::raw::BeamInfo::SetTOR101 ( double  val)

Definition at line 75 of file BeamInfo.cxx.

76  {
77  tor101 = val;
78  Set("E:TOR101",val);
79  }
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:102
void gar::raw::BeamInfo::SetTORTGT ( double  val)

Definition at line 82 of file BeamInfo.cxx.

83  {
84  tortgt = val;
85  Set("E:TORTGT",val);
86  }
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:102
void gar::raw::BeamInfo::SetTRTGTD ( double  val)

Definition at line 89 of file BeamInfo.cxx.

90  {
91  trtgtd = val;
92  Set("E:TRTGTD",val);
93  }
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:102

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const BeamInfo o 
)
friend

Definition at line 122 of file BeamInfo.cxx.

124  {
125 
126  os << "Record type:" << o.GetRecordType() << std::endl;;
127  os << "Timestamp: " << o.GetSeconds() << "\t"
128  << o.GetMilliSeconds() << std::endl;
129  os << "Number of Devices: " << o.GetNumberOfDevices() << std::endl;
130 
131  const std::map<std::string, std::vector<double> > dm=o.GetDataMap();
132  std::map<std::string, std::vector<double> >::const_iterator it=dm.begin();
133  while (it!=dm.end()) {
134  os << it->first<<": ";
135  for (size_t i=0;i<it->second.size();i++) os <<it->second[i]<<", ";
136  os << std::endl;
137  ++it;
138  }
139 
140  return os;
141  }
QTextStream & endl(QTextStream &s)

Member Data Documentation

std::map<std::string, std::vector<double> > gar::raw::BeamInfo::fDataMap
private

Definition at line 34 of file BeamInfo.h.

uint16_t gar::raw::BeamInfo::fMilliSeconds
private

Definition at line 32 of file BeamInfo.h.

uint16_t gar::raw::BeamInfo::fNumberOfDevices
private

Definition at line 33 of file BeamInfo.h.

uint8_t gar::raw::BeamInfo::fRecordType
private

Definition at line 30 of file BeamInfo.h.

uint32_t gar::raw::BeamInfo::fSeconds
private

Definition at line 31 of file BeamInfo.h.

long long int gar::raw::BeamInfo::t_ms
private

Definition at line 29 of file BeamInfo.h.

double gar::raw::BeamInfo::tor101
private

Definition at line 26 of file BeamInfo.h.

double gar::raw::BeamInfo::tortgt
private

Definition at line 27 of file BeamInfo.h.

double gar::raw::BeamInfo::trtgtd
private

Definition at line 28 of file BeamInfo.h.


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