LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
DAQHeader.h
Go to the documentation of this file.
1 //
3 // Definition of basic DAQ header information
4 //
5 // brebel@fnal.gov
6 //
7 // -modified DAQHeader class to save all information available in
8 // binary version of DAQ480 software. - Mitch Soderberg 2/19/09
9 //
11 
12 #ifndef DAQHEADER_H
13 #define DAQHEADER_H
14 
15 #include <stdint.h>
16 #include <time.h>
17 
18 namespace raw {
19 
20  class DAQHeader {
21  public:
22  DAQHeader(); // Default constructor
23 
24  private:
25  unsigned int fStatus;
26  int fFixed;
27  unsigned short fFormat;
28  unsigned short fSoftware;
29  unsigned short fRun;
30  unsigned short
31  fSubRun; //-> Added by D. Caratelli (dcaratelli@nevis.columbia.edu) after E. Church got approval @ Dec. 1st LArSoft mtg. This is a fucking nice comment. --kazu
32  unsigned short fEvent;
33  time_t fTime;
34  short fSpare;
35  uint32_t fNchan;
36 
37  public:
38  DAQHeader(unsigned int status); // Ascii DAQ constructor
39  DAQHeader(unsigned int status, // Binary DAQ constructor - SubRun Specified
40  int fixed,
41  unsigned short format,
42  unsigned short software,
43  unsigned short run,
44  unsigned short subrun,
45  unsigned short event,
46  time_t time,
47  short spare,
48  uint32_t nchan);
49  DAQHeader(unsigned int status, // Binary DAQ constructor - SubRun Not Specified
50  int fixed,
51  unsigned short format,
52  unsigned short software,
53  unsigned short run,
54  unsigned short event,
55  time_t time,
56  short spare,
57  uint32_t nchan);
58 
59  // Set Methods
60  void SetStatus(unsigned int i);
61  void SetFixedWord(int i);
62  void SetFileFormat(unsigned short i);
63  void SetSoftwareVersion(unsigned short i);
64  void SetRun(unsigned short i);
65  void SetSubRun(unsigned short i);
66  void SetEvent(unsigned short i);
67  void SetTimeStamp(time_t t);
68  void SetSpareWord(short s);
69  void SetNChannels(uint32_t i);
70 
71  // Get Methods
72  unsigned int GetStatus() const;
73  int GetFixedWord() const;
74  unsigned short GetFileFormat() const;
75  unsigned short GetSoftwareVersion() const;
76  unsigned short GetRun() const;
77  unsigned short GetSubRun() const;
78  unsigned short GetEvent() const;
79  time_t GetTimeStamp() const;
80  short GetSpareWord() const;
81  uint32_t GetNChannels() const;
82  };
83 }
84 
85 inline void raw::DAQHeader::SetStatus(unsigned int i)
86 {
87  fStatus = i;
88 }
89 inline void raw::DAQHeader::SetFixedWord(int i)
90 {
91  fFixed = i;
92 }
93 inline void raw::DAQHeader::SetFileFormat(unsigned short i)
94 {
95  fFormat = i;
96 }
97 inline void raw::DAQHeader::SetSoftwareVersion(unsigned short i)
98 {
99  fSoftware = i;
100 }
101 inline void raw::DAQHeader::SetRun(unsigned short i)
102 {
103  fRun = i;
104 }
105 inline void raw::DAQHeader::SetSubRun(unsigned short i)
106 {
107  fSubRun = i;
108 }
109 inline void raw::DAQHeader::SetEvent(unsigned short i)
110 {
111  fEvent = i;
112 }
113 inline void raw::DAQHeader::SetTimeStamp(time_t t)
114 {
115  fTime = t;
116 }
117 inline void raw::DAQHeader::SetSpareWord(short s)
118 {
119  fSpare = s;
120 }
121 inline void raw::DAQHeader::SetNChannels(uint32_t i)
122 {
123  fNchan = i;
124 }
125 inline unsigned int raw::DAQHeader::GetStatus() const
126 {
127  return fStatus;
128 }
130 {
131  return fFixed;
132 }
133 inline unsigned short raw::DAQHeader::GetFileFormat() const
134 {
135  return fFormat;
136 }
137 inline unsigned short raw::DAQHeader::GetSoftwareVersion() const
138 {
139  return fSoftware;
140 }
141 inline unsigned short raw::DAQHeader::GetRun() const
142 {
143  return fRun;
144 }
145 inline unsigned short raw::DAQHeader::GetSubRun() const
146 {
147  return fSubRun;
148 }
149 inline unsigned short raw::DAQHeader::GetEvent() const
150 {
151  return fEvent;
152 }
153 inline time_t raw::DAQHeader::GetTimeStamp() const
154 {
155  return fTime;
156 }
157 inline short raw::DAQHeader::GetSpareWord() const
158 {
159  return fSpare;
160 }
161 inline uint32_t raw::DAQHeader::GetNChannels() const
162 {
163  return fNchan;
164 }
165 
166 #endif // DAQHEADER_H
167 
unsigned short fEvent
Definition: DAQHeader.h:32
unsigned int fStatus
Definition: DAQHeader.h:25
void SetSpareWord(short s)
Definition: DAQHeader.h:117
void SetRun(unsigned short i)
Definition: DAQHeader.h:101
unsigned short fRun
Definition: DAQHeader.h:29
short fSpare
Definition: DAQHeader.h:34
void SetTimeStamp(time_t t)
Definition: DAQHeader.h:113
Raw data description.
Definition: RawTypes.h:6
unsigned short fSoftware
Definition: DAQHeader.h:28
unsigned short GetSubRun() const
Definition: DAQHeader.h:145
unsigned short GetFileFormat() const
Definition: DAQHeader.h:133
uint32_t fNchan
Definition: DAQHeader.h:35
int GetFixedWord() const
Definition: DAQHeader.h:129
unsigned int GetStatus() const
Definition: DAQHeader.h:125
void SetSubRun(unsigned short i)
Definition: DAQHeader.h:105
unsigned short fFormat
Definition: DAQHeader.h:27
void SetNChannels(uint32_t i)
Definition: DAQHeader.h:121
time_t fTime
Definition: DAQHeader.h:33
void SetFixedWord(int i)
Definition: DAQHeader.h:89
unsigned short GetRun() const
Definition: DAQHeader.h:141
short GetSpareWord() const
Definition: DAQHeader.h:157
unsigned short GetEvent() const
Definition: DAQHeader.h:149
uint32_t GetNChannels() const
Definition: DAQHeader.h:161
void SetSoftwareVersion(unsigned short i)
Definition: DAQHeader.h:97
unsigned short GetSoftwareVersion() const
Definition: DAQHeader.h:137
void SetEvent(unsigned short i)
Definition: DAQHeader.h:109
void SetStatus(unsigned int i)
Definition: DAQHeader.h:85
void SetFileFormat(unsigned short i)
Definition: DAQHeader.h:93
time_t GetTimeStamp() const
Definition: DAQHeader.h:153
unsigned short fSubRun
Definition: DAQHeader.h:31
Event finding and building.