LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Wire.h
Go to the documentation of this file.
1 
8 /*
9  * Changes
10  * 20190510 Gianluca Petrillo (petrillo@slac.stanford.edu)
11  * updated documentation
12  * 20141211 Gianluca Petrillo (petrillo@fnal.gov)
13  * data architecture revision changes:
14  * - fSignalType and SignalType() removed
15  * - fRawDigit and RawDigit() removed
16  * - fChannel and Channel() added
17  * - constructors now take directly a RawDigit, not its art::Ptr
18  *
19  * ****************************************************************************/
20 
21 #ifndef LARDATAOBJ_RECOBASE_WIRE_H
22 #define LARDATAOBJ_RECOBASE_WIRE_H
23 
24 // LArSoft libraries
25 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
28 
29 // C/C++ standard libraries
30 #include <cstddef> // std::size_t
31 #include <vector>
32 
33 namespace recob {
34 
116  class Wire {
117  public:
120 
122  Wire();
123 
124  private:
127  RegionsOfInterest_t fSignalROI;
128 
129  friend class WireCreator; // helper to create wires in art
130 
131  public:
132  // --- BEGIN -- Constructors ---------------------------------------------
145  Wire(RegionsOfInterest_t const& sigROIlist, raw::ChannelID_t channel, geo::View_t view);
146 
170  Wire(RegionsOfInterest_t&& sigROIlist, raw::ChannelID_t channel, geo::View_t view);
171  // --- END -- Constructors -----------------------------------------------
172 
173  // --- BEGIN -- Accessors ------------------------------------------------
176 
178  std::vector<float> Signal() const;
179 
181  const RegionsOfInterest_t& SignalROI() const;
182 
184  std::size_t NSignal() const;
185 
187  geo::View_t View() const;
188 
190  raw::ChannelID_t Channel() const;
191 
193  // --- END -- Accessors --------------------------------------------------
194 
195  // --- BEGIN -- Sorting and comparison operations ------------------------
198 
200  bool operator<(const Wire& than) const;
201 
202  // --- END -- Sorting and comparison operations --------------------------
203 
204  }; // class Wire
205 
206 } // namespace recob
207 
208 //------------------------------------------------------------------------------
209 //--- inline implementation
210 //------------------------------------------------------------------------------
212 {
213  return fSignalROI;
214 }
215 inline std::size_t recob::Wire::NSignal() const
216 {
217  return fSignalROI.size();
218 }
220 {
221  return fView;
222 }
224 {
225  return fChannel;
226 }
227 inline bool recob::Wire::operator<(const Wire& than) const
228 {
229  return Channel() < than.Channel();
230 }
231 
232 //------------------------------------------------------------------------------
233 
234 #endif // LARDATAOBJ_RECOBASE_WIRE_H
235 
Reconstruction base classes.
size_type size() const
Returns the size of the vector.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: Wire.h:125
bool operator<(const Wire &than) const
Returns whether this channel ID is smaller than the other.
Definition: Wire.h:227
lar::sparse_vector< float > RegionsOfInterest_t
a region of interest is a pair (TDC offset, readings)
Definition: Wire.h:119
Class managing the creation of a new recob::Wire object.
Definition: WireCreator.h:55
geo::View_t fView
View corresponding to the plane of this wire.
Definition: Wire.h:126
geo::View_t View() const
Returns the view the channel belongs to.
Definition: Wire.h:219
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:223
const RegionsOfInterest_t & SignalROI() const
Returns the list of regions of interest.
Definition: Wire.h:211
Definition of data types for geometry description.
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
Definition: Wire.cxx:30
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: Wire.h:127
Class holding the regions of interest of signal from a channel.
Definition: Wire.h:116
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
Class defining a sparse vector (holes are zeroes)
Wire()
Default constructor: a wire with no signal information.
Definition: Wire.cxx:17
std::size_t NSignal() const
Returns the number of time ticks, or samples, in the channel.
Definition: Wire.h:215