All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PMTInfo_t.h
Go to the documentation of this file.
1 /**
2  * @file icaruscode/PMT/Trigger/Algorithms/details/PMTInfo_t.h
3  * @brief Helper class to store discriminated PMT information.
4  * @authors Ryan Howell (rhowell3@ur.rochester.edu)
5  * Gianluca Petrillo (petrillo@slac.stanford.edu)
6  * @date January 28, 2021
7  */
8 
9 #ifndef ICARUSCODE_PMT_TRIGGER_ALGORITHMS_DETAILS_PMTINFO_T_H
10 #define ICARUSCODE_PMT_TRIGGER_ALGORITHMS_DETAILS_PMTINFO_T_H
11 
12 // ICARUS libraries
13 #include "lardataobj/RawData/OpDetWaveform.h" // raw::Channel_t, ...
14 
15 // C++ standard libraries
16 #include <vector>
17 #include <utility> // std::move()
18 
19 
20 // -----------------------------------------------------------------------------
21 namespace icarus::trigger::details { struct PMTInfo_t; }
22 
23 // -----------------------------------------------------------------------------
24 /// Helper data structure to store PMT activity information in the event.
26 
27  using ChannelID_t = raw::Channel_t; ///< Type to represent a channel ID.
28 
29  using ADCcount_t = std::string; ///< Type to represent threshold.
30 
31 
32  // --- BEGIN -- Construction -------------------------------------------------
33 
34  PMTInfo_t() = default; // no trigger
35  PMTInfo_t
36  (ADCcount_t const& threshold, std::vector<ChannelID_t> activeChannels);
37 
38  // --- END -- Construction ---------------------------------------------------
39 
40 
41  // --- BEGIN -- Access to PMT information ------------------------------------
42  /// @name Access to PMT information
43  /// @{
44 
45  /// The threshold this PMT data is extracted with (tag).
46  ADCcount_t const& threshold() const { return fThreshold; }
47 
48  /// Returns the list of channels with activity above threshold.
49  std::vector<ChannelID_t> const& activeChannels() const
50  { return fActiveChannels; }
51 
52  /// @}
53  // --- END -- Access to PMT information --------------------------------------
54 
55  private:
56 
57  ADCcount_t fThreshold {}; ///< Discrimination threshold tag.
58 
59  /// Channels whose activity is above threshold.
60  std::vector<ChannelID_t> fActiveChannels;
61 
62 }; // icarus::trigger::details::PMTInfo_t
63 
64 
65 // -----------------------------------------------------------------------------
66 // --- Inline implementation
67 // -----------------------------------------------------------------------------
69  (ADCcount_t const& threshold, std::vector<ChannelID_t> activeChannels)
70  : fThreshold(threshold)
71  , fActiveChannels(std::move(activeChannels))
72 {}
73 
74 
75 // -----------------------------------------------------------------------------
76 
77 #endif // ICARUSCODE_PMT_TRIGGER_ALGORITHMS_DETAILS_PMTINFO_T_H
raw::Channel_t ChannelID_t
Type to represent a channel ID.
Definition: PMTInfo_t.h:27
std::vector< ChannelID_t > fActiveChannels
Channels whose activity is above threshold.
Definition: PMTInfo_t.h:60
ADCcount_t fThreshold
Discrimination threshold tag.
Definition: PMTInfo_t.h:57
std::string ADCcount_t
Type to represent threshold.
Definition: PMTInfo_t.h:29
Helper data structure to store PMT activity information in the event.
Definition: PMTInfo_t.h:25
std::vector< ChannelID_t > const & activeChannels() const
Returns the list of channels with activity above threshold.
Definition: PMTInfo_t.h:49
ADCcount_t const & threshold() const
The threshold this PMT data is extracted with (tag).
Definition: PMTInfo_t.h:46