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... | |
Public Member Functions inherited from dump::DumperBase | |
DumperBase () | |
Default constructor: no indentation. More... | |
DumperBase (std::string const &indent, std::string const &firstIndent) | |
Constructor: sets indentation. More... | |
DumperBase (std::string const &indent) | |
Constructor: sets indentation. More... | |
template<typename Stream > | |
decltype(auto) | indenter (Stream &&out) const |
Returns an Indenter object tied to this dumper and out stream. More... | |
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... | |
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... | |
Additional Inherited Members | |
Protected Member Functions inherited from dump::DumperBase | |
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... | |
Prints the content of optical detector waveforms on screen.
Example of usage:
Definition at line 45 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 92 of file OpDetWaveform.h.
|
static |
Pads the specified string to the right, truncating its right if needed.
Definition at line 299 of file OpDetWaveform.h.
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 151 of file OpDetWaveform.h.
|
inline |
An alias of dump()
.
Definition at line 122 of file OpDetWaveform.h.
|
static |
Pads the specified string to the right, truncating its right if needed.
Definition at line 264 of file OpDetWaveform.h.
|
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 105 of file OpDetWaveform.h.
|
private |
ADC readings per line in the output.
Definition at line 136 of file OpDetWaveform.h.
|
private |
ADC pedestal (subtracted from readings).
Definition at line 135 of file OpDetWaveform.h.
|
private |
The functor to be used to extract the time label.
Definition at line 139 of file OpDetWaveform.h.