LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
OpWaveform.h
Go to the documentation of this file.
1 
8 #ifndef LARDATAOBJ_RECOBASE_OPWAVEFORM_H
9 #define LARDATAOBJ_RECOBASE_OPWAVEFORM_H
10 
11 // LArSoft libraries
12 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
15 
16 // C/C++ standard libraries
17 #include <cstddef> // std::size_t
18 #include <vector>
19 
20 namespace recob {
21 
94  class OpWaveform {
95  public:
98 
100  OpWaveform();
101 
102  private:
103  double fTimeStamp;
105  RegionsOfInterest_t fSignalROI;
106 
107  //friend class OpWaveformCreator; // helper to create wires in art
108 
109  public:
110  // --- BEGIN -- Constructors ---------------------------------------------
123  OpWaveform(double time, raw::ChannelID_t channel, RegionsOfInterest_t const& sigROIlist);
124 
148  OpWaveform(double time, raw::ChannelID_t channel, RegionsOfInterest_t&& sigROIlist);
149  // --- END -- Constructors -----------------------------------------------
150 
151  // --- BEGIN -- Accessors ------------------------------------------------
154 
156  std::vector<float> Signal() const;
157 
159  const RegionsOfInterest_t& SignalROI() const;
160 
162  std::size_t NSignal() const;
163 
165  raw::ChannelID_t Channel() const;
166 
168  double TimeStamp() const;
169 
171  // --- END -- Accessors --------------------------------------------------
172 
173  // --- BEGIN -- Sorting and comparison operations ------------------------
176 
178  bool operator<(const OpWaveform& than) const;
179 
180  // --- END -- Sorting and comparison operations --------------------------
181 
182  }; // class OpWaveform
183 
184 } // namespace recob
185 
186 //------------------------------------------------------------------------------
187 //--- inline implementation
188 //------------------------------------------------------------------------------
190 {
191  return fSignalROI;
192 }
193 inline std::size_t recob::OpWaveform::NSignal() const
194 {
195  return fSignalROI.size();
196 }
198 {
199  return fChannel;
200 }
201 inline double recob::OpWaveform::TimeStamp() const
202 {
203  return fTimeStamp;
204 }
205 inline bool recob::OpWaveform::operator<(const OpWaveform& than) const
206 {
207  return Channel() < than.Channel();
208 }
209 
210 //------------------------------------------------------------------------------
211 
212 #endif // LARDATAOBJ_RECOBASE_OPWAVEFORM_H
213 
double fTimeStamp
Time stamp.
Definition: OpWaveform.h:103
Reconstruction base classes.
Class holding the regions of interest of signal from a photon detector channel.
Definition: OpWaveform.h:94
size_type size() const
Returns the size of the vector.
OpWaveform()
Default constructor: a wire with no signal information.
Definition: OpWaveform.cxx:17
lar::sparse_vector< float > RegionsOfInterest_t
a region of interest is a pair (TDC offset, readings)
Definition: OpWaveform.h:97
double TimeStamp() const
Returns the time stamp.
Definition: OpWaveform.h:201
const RegionsOfInterest_t & SignalROI() const
Returns the list of regions of interest.
Definition: OpWaveform.h:189
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: OpWaveform.h:197
bool operator<(const OpWaveform &than) const
Returns whether this channel ID is smaller than the other.
Definition: OpWaveform.h:205
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: OpWaveform.h:105
Definition of data types for geometry description.
std::size_t NSignal() const
Returns the number of time ticks, or samples, in the channel.
Definition: OpWaveform.h:193
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: OpWaveform.h:104
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
Class defining a sparse vector (holes are zeroes)
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
Definition: OpWaveform.cxx:32