All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ChannelROICreator.h
Go to the documentation of this file.
1 /** ****************************************************************************
2  * @file ChannelROICreator.h
3  * @brief Helper functions to create a wire
4  * @date December 11, 2014
5  * @author petrillo@fnal.gov
6  * @see Wire.h ChannelROICreator.cxx
7  *
8  * ****************************************************************************/
9 
10 #ifndef ChannelROICreator_H
11 #define ChannelROICreator_H
12 
13 // C/C++ standard library
14 #include <utility> // std::move()
15 
16 // LArSoft libraries
17 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
19 
20 namespace raw { class RawDigit; }
21 
22 /// Reconstruction base classes
23 namespace recob {
24 
25  /**
26  * @brief Class managing the creation of a new recob::Wire object
27  *
28  * As Gianluca Petrillo points out, the same considerations described in
29  * `recob::WireCreator` apply here as well
30  */
32  public:
33  /// Alias for the type of regions of interest
35 
36  // destructor, copy and move constructor and assignment as default
37 
38  /**
39  * @brief Constructor: uses specified signal in regions of interest
40  * @param sigROIlist signal organized in regions of interest
41  * @param rawdigit the raw digit this channel is associated to
42  *
43  * The information used from the raw digit are the channel ID and the
44  * length in samples (TDC ticks) of the original readout window.
45  */
47  (const RegionsOfInterest_t& sigROIlist, const raw::RawDigit& rawdigit);
48 
49 
50  /**
51  * @brief Constructor: uses specified signal in regions of interest
52  * @param sigROIlist signal organized in regions of interest
53  * @param rawdigit the raw digit this channel is associated to
54  *
55  * The information used from the raw digit are the channel ID and the
56  * length in samples (TDC ticks) of the original readout window.
57  *
58  * Signal information is moved from sigROIlist, that becomes empty.
59  */
61  (RegionsOfInterest_t&& sigROIlist, const raw::RawDigit& rawdigit);
62 
63 
64  /**
65  * @brief Constructor: uses specified signal in regions of interest
66  * @param sigROIlist signal organized in regions of interest
67  * @param channel the ID of the channel
68  *
69  * The information used from the raw digit are the channel ID and the
70  * length in samples (TDC ticks) of the original readout window.
71  */
73  RegionsOfInterest_t const& sigROIlist,
74  raw::ChannelID_t channel
75  );
76 
77 
78  /**
79  * @brief Constructor: uses specified signal in regions of interest
80  * @param sigROIlist signal organized in regions of interest
81  * @param channel the ID of the channel
82  * @param view the view the channel belongs to
83  *
84  * The information used from the raw digit are the channel ID and the
85  * length in samples (TDC ticks) of the original readout window.
86  *
87  * Signal information is moved from sigROIlist, that becomes empty.
88  */
90  RegionsOfInterest_t&& sigROIlist,
91  raw::ChannelID_t channel
92  );
93 
94  /**
95  * @brief Prepares the constructed wire to be moved away
96  * @return a right-value reference to the constructed wire
97  *
98  * Despite the name, no move happens in this function.
99  * Move takes place in the caller code as proper; for example:
100  *
101  * // be wire a ChannelROICreator instance:
102  * std::vector<recob::Wire> Wires;
103  * wire.move(); // nothing happens
104  * Wires.push_back(wire.move()); // here the copy happens
105  * recob::Wire single_wire(wire.move()); // wrong! wire is empty now
106  *
107  */
108  ChannelROI&& move() { return std::move(channelROI); }
109 
110 
111  /**
112  * @brief Returns the constructed wire
113  * @return a constant reference to the constructed wire
114  *
115  * Despite the name, no copy happens in this function.
116  * Copy takes place in the caller code as proper; for example:
117  *
118  * // be wire a ChannelROICreator instance:
119  * std::vector<recob::Wire> Wires;
120  * wire.copy(); // nothing happens
121  * Wires.push_back(wire.copy()); // here a copy happens
122  * recob::Wire single_wire(wire.copy()); // wire is copied again
123  *
124  */
125  const ChannelROI& copy() const { return channelROI; }
126 
127  protected:
128 
129  ChannelROI channelROI; ///< local instance of the wire being constructed
130 
131  }; // class ChannelROICreator
132 
133 } // namespace recob
134 
135 #endif // ChannelROICreator_H
ChannelROI channelROI
local instance of the wire being constructed
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
ChannelROI && move()
Prepares the constructed wire to be moved away.
const ChannelROI & copy() const
Returns the constructed wire.
lar::sparse_vector< short int > RegionsOfInterest_t
a region of interest is a pair (TDC offset, readings)
Definition: ChannelROI.h:110
ChannelROICreator(const RegionsOfInterest_t &sigROIlist, const raw::RawDigit &rawdigit)
Constructor: uses specified signal in regions of interest.
Class managing the creation of a new recob::Wire object.
Declaration of basic channel signal object for ICARUS.
Class holding the regions of interest of signal from a channel.
Definition: ChannelROI.h:107
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28