RawBeamline.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 /// \file RawBeamline.h
3 /// \brief Raw data definitions for beamline data used in NOvA
4 /// test beam experiment.
5 /// \author Mike Wallbank (University of Cincinnati) <wallbank@fnal.gov>
6 /// \date October 2018
7 ////////////////////////////////////////////////////////////////////////////
8 
9 #ifndef RAWBEAMLINE_H
10 #define RAWBEAMLINE_H
11 
12 // framework
13 #include "cetlib_except/exception.h"
14 
15 // nova
17 
18 // stl
19 #include <iostream>
20 #include <string>
21 #include <vector>
22 #include <cstdint>
23 #include <bitset>
24 
25 // root
26 
27 // -----------------------------------------------------------------------
28 namespace rawdata {
29 
30  // -----------------------------------------------------------------------
31  // RawBeamlineConfig
32  // -----------------------------------------------------------------------
34 
35  public:
36 
38  virtual ~RawBeamlineConfig() {};
39 
40  void SetBeamlineRun(unsigned int run);
41  void SetBField(float b_field);
42 
43  unsigned int BeamlineRun() const;
44  float BField() const;
45 
46  private:
47 
48  unsigned int fBeamlineRun;
49  float fBField;
50 
51  };
52 
53  // -----------------------------------------------------------------------
54  // RawBeamlineTrigger
55  // -----------------------------------------------------------------------
57 
58  public:
59 
62  virtual ~RawBeamlineTrigger() {};
63 
64  void SetDetectorID(beamlinegeo::DetectorID detector);
65  void SetTimestamp(uint64_t timestamp);
66  void SetPattern(uint32_t pattern);
67  void SetTDUTime(uint64_t tduTime);
68  void SetTriggerCondition(std::string trig_condition);
69 
70  unsigned int TriggerNumber() const;
71  beamlinegeo::DetectorID DetectorID() const;
72  uint64_t Timestamp() const;
73  uint32_t Pattern() const;
74  uint64_t TDUTime() const;
75  std::string TriggerCondition() const;
76 
77  private:
78 
80  unsigned int fNumber;
81 
82  uint64_t fTimestamp;
83  uint32_t fPattern;
84  uint64_t fTDUTime;
86 
87  };
88 
89  // -----------------------------------------------------------------------
90  // RawBeamlineDigit
91  // -----------------------------------------------------------------------
93 
94  public:
95 
98  virtual ~RawBeamlineDigit() {};
99 
100  beamlinegeo::ChannelID ChannelID() const;
101  uint32_t Timestamp() const;
102  unsigned int NADC() const;
103  uint16_t ADC(unsigned int sample) const;
104  std::vector<uint16_t> ADCs() const;
105 
106  void SetChannelID(beamlinegeo::ChannelID channel);
107  void SetTimestamp(uint32_t timestamp);
108  void SetWaveform(std::vector<uint16_t> waveform);
109 
110  private:
111 
113  uint32_t fTimestamp;
114  std::vector<uint16_t> fADCs;
115 
116  };
117 
118  // -----------------------------------------------------------------------
119  // RawBeamlineWC
120  // -----------------------------------------------------------------------
122 
123  public:
124 
125  struct WCPulse {
126  WCPulse() {}
127  WCPulse(int channel, int time) { Channel = channel; Time = time; }
128  int Channel;
129  int Time;
130  };
131 
132  RawBeamlineWC();
134  virtual ~RawBeamlineWC() {}
135 
136  beamlinegeo::DetectorID DetectorID() const;
137  uint64_t Timestamp() const;
138  std::vector<WCPulse> const& XPulses() const { return fXPulses; }
139  std::vector<WCPulse> const& YPulses() const { return fYPulses; }
140 
141  void AddXPulse(WCPulse pulse);
142  void AddYPulse(WCPulse pulse);
143  void SetDetectorID(beamlinegeo::DetectorID detector);
144  void SetTimestamp(uint64_t timestamp);
145 
146  private:
147 
149  uint64_t fTimestamp;
150 
151  std::vector<WCPulse> fXPulses;
152  std::vector<WCPulse> fYPulses;
153 
154  };
155 
156 } // namespace
157 
158 #endif
void SetBeamlineRun(unsigned int run)
Definition: RawBeamline.cxx:18
beamlinegeo::ChannelID fChannelID
Definition: RawBeamline.h:112
WCPulse(int channel, int time)
Definition: RawBeamline.h:127
unsigned int BeamlineRun() const
Definition: RawBeamline.cxx:30
std::vector< WCPulse > fXPulses
Definition: RawBeamline.h:151
Definition of connection map class.
Definition: CMap.h:19
Definition of the beamline offline geometry. Also implementation of a service to obtain this informat...
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
std::vector< WCPulse > fYPulses
Definition: RawBeamline.h:152
beamlinegeo::DetectorID fDetectorID
Definition: RawBeamline.h:148
void SetBField(float b_field)
Definition: RawBeamline.cxx:24
std::vector< uint16_t > fADCs
Definition: RawBeamline.h:114
Definition: run.py:1
std::vector< WCPulse > const & YPulses() const
Definition: RawBeamline.h:139
std::vector< WCPulse > const & XPulses() const
Definition: RawBeamline.h:138
beamlinegeo::DetectorID fDetectorID
Definition: RawBeamline.h:79
enum BeamMode string