LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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 16 of file BeamInfo.h.

Constructor & Destructor Documentation

raw::BeamInfo::BeamInfo ( )

Definition at line 17 of file BeamInfo.cxx.

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

Definition at line 30 of file BeamInfo.cxx.

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

Definition at line 33 of file BeamInfo.cxx.

37  : tor101(vtor101)
38  , tortgt(vtortgt)
39  , trtgtd(vtrtgtd)
40  , t_ms(vt_ms)
41  , fRecordType(0)
42  , fSeconds(0)
43  , fMilliSeconds(0)
44  , fNumberOfDevices(0)
45  {
46  }
long long int t_ms
Definition: BeamInfo.h:27
double trtgtd
Definition: BeamInfo.h:26
double tortgt
Definition: BeamInfo.h:25
uint32_t fSeconds
Definition: BeamInfo.h:29
uint16_t fMilliSeconds
Definition: BeamInfo.h:30
uint16_t fNumberOfDevices
Definition: BeamInfo.h:31
double tor101
Definition: BeamInfo.h:24
uint8_t fRecordType
Definition: BeamInfo.h:28

Member Function Documentation

std::vector<double> raw::BeamInfo::Get ( std::string  device_name)

Referenced by GetNumberOfDevices().

long long int raw::BeamInfo::get_t_ms ( ) const

Definition at line 69 of file BeamInfo.cxx.

References t_ms.

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

Definition at line 51 of file BeamInfo.cxx.

References tor101.

52  {
53  return tor101;
54  }
double tor101
Definition: BeamInfo.h:24
double raw::BeamInfo::get_tortgt ( ) const

Definition at line 57 of file BeamInfo.cxx.

References tortgt.

58  {
59  return tortgt;
60  }
double tortgt
Definition: BeamInfo.h:25
double raw::BeamInfo::get_trtgtd ( ) const

Definition at line 63 of file BeamInfo.cxx.

References trtgtd.

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

Definition at line 63 of file BeamInfo.h.

References fDataMap, and operator<<.

Referenced by raw::operator<<().

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

Definition at line 59 of file BeamInfo.h.

References fMilliSeconds.

Referenced by raw::operator<<().

59 {return fMilliSeconds;};
uint16_t fMilliSeconds
Definition: BeamInfo.h:30
uint16_t raw::BeamInfo::GetNumberOfDevices ( ) const
inline

Definition at line 60 of file BeamInfo.h.

References fNumberOfDevices, and Get().

Referenced by raw::operator<<().

60 {return fNumberOfDevices;};
uint16_t fNumberOfDevices
Definition: BeamInfo.h:31
uint8_t raw::BeamInfo::GetRecordType ( ) const
inline

Definition at line 57 of file BeamInfo.h.

References fRecordType.

Referenced by raw::operator<<().

57 {return fRecordType;};
uint8_t fRecordType
Definition: BeamInfo.h:28
uint32_t raw::BeamInfo::GetSeconds ( ) const
inline

Definition at line 58 of file BeamInfo.h.

References fSeconds.

Referenced by raw::operator<<().

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

Definition at line 101 of file BeamInfo.cxx.

Referenced by SetNumberOfDevices(), SetTOR101(), SetTORTGT(), and SetTRTGTD().

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

Definition at line 108 of file BeamInfo.cxx.

References fDataMap.

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

Definition at line 51 of file BeamInfo.h.

51 {fMilliSeconds=val;};
uint16_t fMilliSeconds
Definition: BeamInfo.h:30
void raw::BeamInfo::SetNumberOfDevices ( uint16_t  val)
inline

Definition at line 52 of file BeamInfo.h.

References Set().

52 {fNumberOfDevices=val;};
uint16_t fNumberOfDevices
Definition: BeamInfo.h:31
void raw::BeamInfo::SetRecordType ( uint8_t  val)
inline

Definition at line 49 of file BeamInfo.h.

49 {fRecordType=val;};
uint8_t fRecordType
Definition: BeamInfo.h:28
void raw::BeamInfo::SetSeconds ( uint32_t  val)
inline

Definition at line 50 of file BeamInfo.h.

50 {fSeconds=val;};
uint32_t fSeconds
Definition: BeamInfo.h:29
void raw::BeamInfo::SetT_MS ( long long int  val)

Definition at line 96 of file BeamInfo.cxx.

References t_ms.

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

Definition at line 75 of file BeamInfo.cxx.

References Set(), and tor101.

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

Definition at line 82 of file BeamInfo.cxx.

References Set(), and tortgt.

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

Definition at line 89 of file BeamInfo.cxx.

References Set(), and trtgtd.

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

Friends And Related Function Documentation

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

Definition at line 120 of file BeamInfo.cxx.

Referenced by GetDataMap().

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

Member Data Documentation

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

Definition at line 32 of file BeamInfo.h.

Referenced by GetDataMap(), and Set().

uint16_t raw::BeamInfo::fMilliSeconds
private

Definition at line 30 of file BeamInfo.h.

Referenced by GetMilliSeconds().

uint16_t raw::BeamInfo::fNumberOfDevices
private

Definition at line 31 of file BeamInfo.h.

Referenced by GetNumberOfDevices().

uint8_t raw::BeamInfo::fRecordType
private

Definition at line 28 of file BeamInfo.h.

Referenced by GetRecordType().

uint32_t raw::BeamInfo::fSeconds
private

Definition at line 29 of file BeamInfo.h.

Referenced by GetSeconds().

long long int raw::BeamInfo::t_ms
private

Definition at line 27 of file BeamInfo.h.

Referenced by get_t_ms(), and SetT_MS().

double raw::BeamInfo::tor101
private

Definition at line 24 of file BeamInfo.h.

Referenced by get_tor101(), and SetTOR101().

double raw::BeamInfo::tortgt
private

Definition at line 25 of file BeamInfo.h.

Referenced by get_tortgt(), and SetTORTGT().

double raw::BeamInfo::trtgtd
private

Definition at line 26 of file BeamInfo.h.

Referenced by get_trtgtd(), and SetTRTGTD().


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