All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
V1730channelConfiguration.cxx
Go to the documentation of this file.
1 /**
2  * @file sbnobj/Common/PMT/Data/V1730channelConfiguration.cxx
3  * @brief Information from the configuration of a V1730 PMT readout board.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date February 18, 2021
6  * @see sbnobj/Common/PMT/Data/V1730channelConfiguration.h
7  */
8 
9 // library header
11 
12 // C/C++ standard libraries
13 #include <ostream>
14 #include <cassert>
15 
16 
17 //------------------------------------------------------------------------------
19 
20 //------------------------------------------------------------------------------
21 void sbn::V1730channelConfiguration::dump(std::ostream& out,
22  std::string const& indent, std::string const& firstIndent,
23  unsigned int verbosity /* = MaxDumpVerbosity */
24 ) const{
25 
26  do { // fake look for easy break: `goto` in disguise
27 
28  // start a new line with indentation:
29  auto const outnl
30  = [&out,&indent]() -> std::ostream& { return out << '\n' << indent; };
31 
32  unsigned int level = 0U;
33 
34  // --- verbosity: 0+ -------------------------------------------------------
35  out << firstIndent
36  << "board channel #" << channelNo
37  << " (" << (enabled? "enabled": "disabled") << ")"
38  ;
39  if (hasChannelID()) out << ", offline ID: " << channelID;
40 
41  if (++level > verbosity) break;
42  // --- verbosity: 1+ -------------------------------------------------------
43  out << ", baseline: " << baseline << ", threshold: " << threshold
44  << " (delta=" << relativeThreshold() << ")"
45  ;
46 
47  if (++level > verbosity) break;
48  // --- verbosity: 2+ -------------------------------------------------------
49 
50  assert(level == MaxDumpVerbosity + 1U);
51 
52  // this is more debug information than anything else: verbosity was too high
53  outnl() << "No more information available (reached level " << level << ").";
54 
55  } while(false);
56 
57  out << "\n";
58 
59 } // sbn::V1730channelConfiguration::dump()
60 
61 
62 //------------------------------------------------------------------------------
short signed int threshold
Threshold (triggerThreshold&lt;N&gt;).
static constexpr unsigned int DefaultDumpVerbosity
Default verbosity level for dump().
short unsigned int channelNo
Number of the channel on the board (0-15).
void dump(std::ostream &out, std::string const &indent, std::string const &firstIndent, unsigned int verbosity=MaxDumpVerbosity) const
Dumps the content of the configuration into out stream.
short signed int relativeThreshold() const
Threshold relative to the baseline (ticks).
Information from the configuration of a V1730 PMT readout board.
static constexpr unsigned int MaxDumpVerbosity
Maximum supported verbosity level supported by dump().
short signed int baseline
Baseline (BaselineCh&lt;N+1&gt;).
bool enabled
Channel is enabled (enable).
raw::Channel_t channelID
Offline channel ID.
bool hasChannelID() const
Returns whether the channel ID is set.