LArSoft  v08_29_00
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 14 of file BeamInfo.cxx.

15  : tor101(0.)
16  , tortgt(0.)
17  , trtgtd(0.)
18  , t_ms(0)
19  , fRecordType(0)
20  , fSeconds(0)
21  , fMilliSeconds(0)
22  , fNumberOfDevices(0)
23  {
24  }
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 27 of file BeamInfo.cxx.

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

Definition at line 30 of file BeamInfo.cxx.

34  : tor101(vtor101)
35  , tortgt(vtortgt)
36  , trtgtd(vtrtgtd)
37  , t_ms(vt_ms)
38  , fRecordType(0)
39  , fSeconds(0)
40  , fMilliSeconds(0)
41  , fNumberOfDevices(0)
42  {
43  }
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 66 of file BeamInfo.cxx.

References t_ms.

67  {
68  return t_ms;
69  }
long long int t_ms
Definition: BeamInfo.h:27
double raw::BeamInfo::get_tor101 ( ) const

Definition at line 48 of file BeamInfo.cxx.

References tor101.

49  {
50  return tor101;
51  }
double tor101
Definition: BeamInfo.h:24
double raw::BeamInfo::get_tortgt ( ) const

Definition at line 54 of file BeamInfo.cxx.

References tortgt.

55  {
56  return tortgt;
57  }
double tortgt
Definition: BeamInfo.h:25
double raw::BeamInfo::get_trtgtd ( ) const

Definition at line 60 of file BeamInfo.cxx.

References trtgtd.

61  {
62  return trtgtd;
63  }
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 98 of file BeamInfo.cxx.

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

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

Definition at line 105 of file BeamInfo.cxx.

References fDataMap.

106  {
107  if (fDataMap.find(device)!=fDataMap.end()) {
108  //device already listed
109  return;
110  };
111  std::pair<std::string, std::vector<double> > p(device,val);
112  fDataMap.insert(p);
113  }
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 93 of file BeamInfo.cxx.

References t_ms.

94  {
95  t_ms = val;
96  }
long long int t_ms
Definition: BeamInfo.h:27
void raw::BeamInfo::SetTOR101 ( double  val)

Definition at line 72 of file BeamInfo.cxx.

References Set(), and tor101.

73  {
74  tor101 = val;
75  Set("E:TOR101",val);
76  }
double tor101
Definition: BeamInfo.h:24
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:98
void raw::BeamInfo::SetTORTGT ( double  val)

Definition at line 79 of file BeamInfo.cxx.

References Set(), and tortgt.

80  {
81  tortgt = val;
82  Set("E:TORTGT",val);
83  }
double tortgt
Definition: BeamInfo.h:25
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:98
void raw::BeamInfo::SetTRTGTD ( double  val)

Definition at line 86 of file BeamInfo.cxx.

References Set(), and trtgtd.

87  {
88  trtgtd = val;
89  Set("E:TRTGTD",val);
90  }
double trtgtd
Definition: BeamInfo.h:26
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:98

Friends And Related Function Documentation

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

Definition at line 117 of file BeamInfo.cxx.

Referenced by GetDataMap().

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

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: