All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SingleChannelOpticalTriggerGate.cxx
Go to the documentation of this file.
1 /**
2  * @file sbnobj/ICARUS/PMT/Trigger/Data/SingleChannelOpticalTriggerGate.cxx
3  * @brief Logical multi-level gate associated to a optical detector channel.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date April 1, 2019
6  * @see `sbnobj/ICARUS/PMT/Trigger/Data/SingleChannelOpticalTriggerGate.h`
7  *
8  */
9 
10 // class header
12 
13 // framework libraries
14 #include "cetlib_except/exception.h"
15 
16 // C/C++ standard libraries
17 #include <ostream>
18 
19 
20 //------------------------------------------------------------------------------
21 //--- icarus::trigger::SingleChannelOpticalTriggerGate
22 //------------------------------------------------------------------------------
24  (raw::OpDetWaveform const& waveform)
25 {
26  if (hasChannel() && raw::isValidChannel(channel())
27  && (channel() != waveform.ChannelNumber())
28  ) {
29  // currently we require each gate to be on the same channel
30  throw cet::exception("TriggerGateBuilder")
31  << "icarus::trigger::SingleChannelOpticalTriggerGate::add(): "
32  << "can't add a waveform on channel " << waveform.ChannelNumber()
33  << " to a gate on channel " << channel() << "\n";
34  }
35  return OpticalTriggerGate::add(waveform);
36 } // icarus::trigger::SingleChannelOpticalTriggerGate::add()
37 
38 
39 //------------------------------------------------------------------------------
constexpr bool isValidChannel(Channel_t channel)
Returns whether the specified one is a valid channel number.
bool add(raw::OpDetWaveform const &waveform)
Adds another waveform to the channel (unless it has just been added).
Logical multi-level gate associated to a optical detector channel.