LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Prints the content of optical detector waveforms on screen. More...
#include "OpDetWaveform.h"
Classes | |
struct | TickLabelMaker |
Time label: tick number relative to the waveform. More... | |
struct | TimeLabelMaker |
Base functor for printing time according to tick number. More... | |
Public Member Functions | |
OpDetWaveformDumper (raw::ADC_Count_t pedestal=0, unsigned int digitsPerLine=0U) | |
Constructor: sets waveform dump parameters. More... | |
void | setTimeLabelMaker (TimeLabelMaker const *timeLabelMaker) |
Chooses which time label maker to use. More... | |
template<typename Stream > | |
void | dump (Stream &&stream, raw::OpDetWaveform const &waveform) |
Dumps the content of a waveform into the specified output stream. More... | |
template<typename Stream > | |
void | operator() (Stream &&stream, raw::OpDetWaveform const &waveform) |
An alias of dump() . More... | |
template<typename Stream > | |
decltype(auto) | indenter (Stream &&out) const |
Returns an Indenter object tied to this dumper and out stream. More... | |
Indentation. | |
Indentation strings are expected to be written by the dumping algorithms at the beginning of each output line to ensure the proper alignment of the dump. The Note that this infrastructure only keeps track of the strings needed to indent the output, but it does not provide any tool to apply the indentation. | |
std::string const & | indent () const |
Returns the indentation string currently configured for all lines. More... | |
std::string const & | firstIndent () const |
Returns the indentation string currently configured for the first line. More... | |
void | setIndent (std::string const &indent, std::string const &firstIndent) |
Sets indentation strings to the specified values. More... | |
void | setIndent (std::string const &indent) |
Sets both indentation strings to the same specified value. More... | |
template<typename Stream > | |
Stream & | indented (Stream &&out, bool first=false) const |
Writes the indentation into a stream, and returns it for further output. More... | |
template<typename Stream > | |
Stream & | firstIndented (Stream &&out) const |
template<typename Stream > | |
Stream & | newline (Stream &&out) const |
Static Public Member Functions | |
static std::string | padRight (std::string const &s, unsigned int width, std::string padding=" ") |
Pads the specified string to the right, truncating its right if needed. More... | |
static unsigned int | digitsOf (unsigned int n) |
Pads the specified string to the right, truncating its right if needed. More... | |
Protected Member Functions | |
IndentSettings & | indentSettings () |
IndentSettings const & | indentSettings () const |
IndentSettings & | saveIndentSettings () |
Stacks a copy of the current settings, and returns the "new" ones. More... | |
IndentSettings & | restoreIndentSettings () |
Restores and returns the last saved settings. More... | |
Private Attributes | |
raw::ADC_Count_t | fPedestal |
ADC pedestal (subtracted from readings). More... | |
unsigned int | fDigitsPerLine |
ADC readings per line in the output. More... | |
TimeLabelMaker const * | fTimeLabelMaker = nullptr |
The functor to be used to extract the time label. More... | |
Prints the content of optical detector waveforms on screen.
Example of usage:
Definition at line 43 of file OpDetWaveform.h.
|
inline |
Constructor: sets waveform dump parameters.
pedestal | (default: 0 ) the pedestal to be automatically added to all digits |
digitsPerLine | (default: 0 ) how many ADC digits to print per line; 0 disables the digit printing completely |
Note that no indentation is set. If some is desired, set it with setIndent()
after construction.
Definition at line 89 of file OpDetWaveform.h.
|
static |
Pads the specified string to the right, truncating its right if needed.
Definition at line 278 of file OpDetWaveform.h.
Referenced by dump::raw::OpDetWaveformDumper::TickLabelMaker::labelWidth(), and operator()().
void dump::raw::OpDetWaveformDumper::dump | ( | Stream && | stream, |
raw::OpDetWaveform const & | waveform | ||
) |
Dumps the content of a waveform into the specified output stream.
Stream | type of stream to dump data into |
stream | stream to dump data into |
waveform | the object to be dumped |
Indentation is regulated via base class methods (see setIndent()
).
Definition at line 148 of file OpDetWaveform.h.
References lar::util::MinMaxCollector< T >::add(), raw::OpDetWaveform::ChannelNumber(), fDigitsPerLine, fPedestal, fTimeLabelMaker, dump::DumperBase::indent(), dump::DumperBase::indenter(), dump::raw::OpDetWaveformDumper::TimeLabelMaker::label(), dump::raw::OpDetWaveformDumper::TimeLabelMaker::labelWidth(), lar::util::MinMaxCollector< T >::max(), lar::util::MinMaxCollector< T >::min(), padRight(), dump::DumperBase::restoreIndentSettings(), dump::DumperBase::saveIndentSettings(), dump::DumperBase::IndentSettings::set(), and raw::OpDetWaveform::TimeStamp().
Referenced by operator()(), and setTimeLabelMaker().
|
inlineinherited |
Returns the indentation string currently configured for the first line.
Definition at line 98 of file DumperBase.h.
References dump::DumperBase::IndentSettings::firstIndent, and dump::DumperBase::indentSettings().
Referenced by dump::DumperBase::Indenter< Stream >::firstIndentString().
|
inlineinherited |
Writes first line indentation into a stream, and returns it for further output.
Definition at line 120 of file DumperBase.h.
References dump::DumperBase::indented().
|
inlineinherited |
Returns the indentation string currently configured for all lines.
Definition at line 95 of file DumperBase.h.
References dump::DumperBase::IndentSettings::indent, and dump::DumperBase::indentSettings().
Referenced by dump(), and dump::DumperBase::Indenter< Stream >::indentString().
|
inlineinherited |
Writes the indentation into a stream, and returns it for further output.
Definition at line 111 of file DumperBase.h.
References dump::DumperBase::IndentSettings::firstIndent, and dump::DumperBase::IndentSettings::indent.
Referenced by dump::DumperBase::firstIndented(), dump::DumperBase::Indenter< Stream >::indent(), and dump::DumperBase::newline().
|
inlineinherited |
Returns an Indenter
object tied to this dumper and out
stream.
Definition at line 215 of file DumperBase.h.
Referenced by dump().
|
inlineprotectedinherited |
Definition at line 221 of file DumperBase.h.
Referenced by dump::DumperBase::firstIndent(), dump::DumperBase::indent(), dump::DumperBase::restoreIndentSettings(), dump::DumperBase::saveIndentSettings(), and dump::DumperBase::setIndent().
|
inlineprotectedinherited |
Definition at line 222 of file DumperBase.h.
|
inlineinherited |
Initiates a new output line, including indentation, and returns the stream for further output.
Definition at line 128 of file DumperBase.h.
References dump::DumperBase::indented().
|
inline |
An alias of dump()
.
Definition at line 120 of file OpDetWaveform.h.
References digitsOf(), dump(), n, and padRight().
|
static |
Pads the specified string to the right, truncating its right if needed.
Definition at line 244 of file OpDetWaveform.h.
Referenced by dump(), and operator()().
|
inlineprotectedinherited |
Restores and returns the last saved settings.
Definition at line 233 of file DumperBase.h.
References dump::DumperBase::indentSettings().
Referenced by dump().
|
inlineprotectedinherited |
Stacks a copy of the current settings, and returns the "new" ones.
Definition at line 225 of file DumperBase.h.
References dump::DumperBase::indentSettings().
Referenced by dump().
|
inlineinherited |
Sets indentation strings to the specified values.
Definition at line 101 of file DumperBase.h.
References dump::DumperBase::IndentSettings::indent, and dump::DumperBase::indentSettings().
|
inlineinherited |
Sets both indentation strings to the same specified value.
Definition at line 107 of file DumperBase.h.
References dump::DumperBase::setIndent().
Referenced by dump::DumperBase::setIndent().
|
inline |
Chooses which time label maker to use.
timeLabelMaker | a pointer to the external time label maker |
A time label maker is an object derived from TimeLabelMaker
which can convert a waveform and tick into a string representing that tick within the waveform. If never specified or if nullptr
, no time label will be printed at all.
Definition at line 102 of file OpDetWaveform.h.
References dump(), and fTimeLabelMaker.
|
private |
ADC readings per line in the output.
Definition at line 135 of file OpDetWaveform.h.
Referenced by dump().
|
private |
ADC pedestal (subtracted from readings).
Definition at line 134 of file OpDetWaveform.h.
Referenced by dump().
|
private |
The functor to be used to extract the time label.
Definition at line 138 of file OpDetWaveform.h.
Referenced by dump(), and setTimeLabelMaker().