LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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  {}
long long int t_ms
Definition: BeamInfo.h:26
double trtgtd
Definition: BeamInfo.h:25
double tortgt
Definition: BeamInfo.h:24
uint32_t fSeconds
Definition: BeamInfo.h:28
uint16_t fMilliSeconds
Definition: BeamInfo.h:29
uint16_t fNumberOfDevices
Definition: BeamInfo.h:30
double tor101
Definition: BeamInfo.h:23
uint8_t fRecordType
Definition: BeamInfo.h:27
raw::BeamInfo::~BeamInfo ( )

Definition at line 26 of file BeamInfo.cxx.

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

Definition at line 29 of file BeamInfo.cxx.

30  : tor101(vtor101)
31  , tortgt(vtortgt)
32  , trtgtd(vtrtgtd)
33  , t_ms(vt_ms)
34  , fRecordType(0)
35  , fSeconds(0)
36  , fMilliSeconds(0)
37  , fNumberOfDevices(0)
38  {}
long long int t_ms
Definition: BeamInfo.h:26
double trtgtd
Definition: BeamInfo.h:25
double tortgt
Definition: BeamInfo.h:24
uint32_t fSeconds
Definition: BeamInfo.h:28
uint16_t fMilliSeconds
Definition: BeamInfo.h:29
uint16_t fNumberOfDevices
Definition: BeamInfo.h:30
double tor101
Definition: BeamInfo.h:23
uint8_t fRecordType
Definition: BeamInfo.h:27

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 59 of file BeamInfo.cxx.

References t_ms.

60  {
61  return t_ms;
62  }
long long int t_ms
Definition: BeamInfo.h:26
double raw::BeamInfo::get_tor101 ( ) const

Definition at line 41 of file BeamInfo.cxx.

References tor101.

42  {
43  return tor101;
44  }
double tor101
Definition: BeamInfo.h:23
double raw::BeamInfo::get_tortgt ( ) const

Definition at line 47 of file BeamInfo.cxx.

References tortgt.

48  {
49  return tortgt;
50  }
double tortgt
Definition: BeamInfo.h:24
double raw::BeamInfo::get_trtgtd ( ) const

Definition at line 53 of file BeamInfo.cxx.

References trtgtd.

54  {
55  return trtgtd;
56  }
double trtgtd
Definition: BeamInfo.h:25
std::map<std::string, std::vector<double> > raw::BeamInfo::GetDataMap ( ) const
inline

Definition at line 60 of file BeamInfo.h.

References fDataMap, and operator<<.

Referenced by raw::operator<<().

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

Definition at line 56 of file BeamInfo.h.

References fMilliSeconds.

Referenced by raw::operator<<().

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

Definition at line 57 of file BeamInfo.h.

References fNumberOfDevices, and Get().

Referenced by raw::operator<<().

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

Definition at line 54 of file BeamInfo.h.

References fRecordType.

Referenced by raw::operator<<().

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

Definition at line 55 of file BeamInfo.h.

References fSeconds.

Referenced by raw::operator<<().

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

Definition at line 91 of file BeamInfo.cxx.

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

92  {
93  std::vector<double> vec;
94  vec.push_back(val);
95  Set(device, vec);
96  }
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:91
void raw::BeamInfo::Set ( std::string  device_name,
std::vector< double >  val 
)

Definition at line 98 of file BeamInfo.cxx.

References fDataMap.

99  {
100  if (fDataMap.find(device) != fDataMap.end()) {
101  //device already listed
102  return;
103  };
104  std::pair<std::string, std::vector<double>> p(device, val);
105  fDataMap.insert(p);
106  }
std::map< std::string, std::vector< double > > fDataMap
Definition: BeamInfo.h:31
void raw::BeamInfo::SetMilliSeconds ( uint16_t  val)
inline

Definition at line 48 of file BeamInfo.h.

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

Definition at line 49 of file BeamInfo.h.

References Set().

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

Definition at line 46 of file BeamInfo.h.

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

Definition at line 47 of file BeamInfo.h.

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

Definition at line 86 of file BeamInfo.cxx.

References t_ms.

87  {
88  t_ms = val;
89  }
long long int t_ms
Definition: BeamInfo.h:26
void raw::BeamInfo::SetTOR101 ( double  val)

Definition at line 65 of file BeamInfo.cxx.

References Set(), and tor101.

66  {
67  tor101 = val;
68  Set("E:TOR101", val);
69  }
double tor101
Definition: BeamInfo.h:23
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:91
void raw::BeamInfo::SetTORTGT ( double  val)

Definition at line 72 of file BeamInfo.cxx.

References Set(), and tortgt.

73  {
74  tortgt = val;
75  Set("E:TORTGT", val);
76  }
double tortgt
Definition: BeamInfo.h:24
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:91
void raw::BeamInfo::SetTRTGTD ( double  val)

Definition at line 79 of file BeamInfo.cxx.

References Set(), and trtgtd.

80  {
81  trtgtd = val;
82  Set("E:TRTGTD", val);
83  }
double trtgtd
Definition: BeamInfo.h:25
void Set(std::string device_name, double val)
Definition: BeamInfo.cxx:91

Friends And Related Function Documentation

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

Definition at line 110 of file BeamInfo.cxx.

Referenced by GetDataMap().

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

Member Data Documentation

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

Definition at line 31 of file BeamInfo.h.

Referenced by GetDataMap(), and Set().

uint16_t raw::BeamInfo::fMilliSeconds
private

Definition at line 29 of file BeamInfo.h.

Referenced by GetMilliSeconds().

uint16_t raw::BeamInfo::fNumberOfDevices
private

Definition at line 30 of file BeamInfo.h.

Referenced by GetNumberOfDevices().

uint8_t raw::BeamInfo::fRecordType
private

Definition at line 27 of file BeamInfo.h.

Referenced by GetRecordType().

uint32_t raw::BeamInfo::fSeconds
private

Definition at line 28 of file BeamInfo.h.

Referenced by GetSeconds().

long long int raw::BeamInfo::t_ms
private

Definition at line 26 of file BeamInfo.h.

Referenced by get_t_ms(), and SetT_MS().

double raw::BeamInfo::tor101
private

Definition at line 23 of file BeamInfo.h.

Referenced by get_tor101(), and SetTOR101().

double raw::BeamInfo::tortgt
private

Definition at line 24 of file BeamInfo.h.

Referenced by get_tortgt(), and SetTORTGT().

double raw::BeamInfo::trtgtd
private

Definition at line 25 of file BeamInfo.h.

Referenced by get_trtgtd(), and SetTRTGTD().


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