59 using Digit_t = raw::RawDigit::ADCvector_t::value_type;
71 Name(
"DetSimModuleLabel"),
72 Comment(
"tag of producer used to create the raw::RawDigit collection"),
77 Name(
"OutputCategory"),
78 Comment(
"the messagefacility category used for the output"),
83 Name(
"DigitsPerLine"),
84 Comment(
"number of digits printed per line (0: don't print digits)"),
90 Comment(
"digit values are written relative to this number"),
116 template <
typename Stream>
119 std::string
indent =
" ", std::string firstIndent =
" " 144 <<
" will be subtracted from all raw digits";
153 auto const& RawDigits
169 template <
typename Stream>
172 std::string
indent , std::string firstIndent
185 <<
" #" << digits.
Channel() <<
": " << ADCs.size() <<
" time ticks";
186 if (digits.
Samples() != ADCs.size())
187 out <<
" [!!! EXPECTED " << digits.
Samples() <<
"] ";
189 <<
" (" << digits.
NADC() <<
" after compression); compression type: ";
191 case raw::kNone: out <<
"no compression";
break;
198 out <<
"unknown (#" << ((int) digits.
Compression()) <<
")";
break;
205 unsigned int repeat_count = 0;
206 unsigned int index = 0;
208 out <<
"\n" << indent
209 <<
"content of the channel (" <<
fDigitsPerLine <<
" ticks per line):";
210 auto iTick = ADCs.cbegin(), tend = ADCs.cend();
211 while (iTick != tend) {
213 unsigned int line_size
214 =
std::min(fDigitsPerLine, (
unsigned int) ADCs.size() - index);
215 if (line_size == 0)
break;
218 DigitBuffer.resize(line_size);
219 auto iBuf = DigitBuffer.begin(), bend = DigitBuffer.end();
220 while ((iBuf != bend) && (iTick != tend))
225 if (DigitBuffer == LastBuffer) {
232 if (repeat_count > 0) {
233 out <<
"\n" << indent
234 <<
" [ ... repeated " << repeat_count <<
" more times, " 235 << (repeat_count * LastBuffer.size()) <<
" ticks ]";
240 out <<
"\n" << indent <<
" ";
241 for (
auto digit: DigitBuffer)
242 out <<
" " << std::setw(4) << digit;
246 std::swap(LastBuffer, DigitBuffer);
249 if (repeat_count > 0) {
250 out <<
"\n" << indent
251 <<
" [ ... repeated " << repeat_count <<
" more times to the end ]";
253 if (Extrema.
min() < Extrema.
max()) {
254 out <<
"\n" << indent
255 <<
" range of " << index
256 <<
" samples: [" << Extrema.
min() <<
";" << Extrema.
max() <<
"]";
Data_t max() const
Returns the accumulated maximum, or a very small number if no values.
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
Digit_t Pedestal_t
Type to represent a pedestal.
This_t & add(Data_t value)
Include a single value in the statistics.
Collection of charge vs time digitized from a single readout channel.
art::InputTag fDetSimModuleLabel
Tag for digits data product.
virtual void analyze(art::Event const &evt) override
Does the printing.
fhicl::Atom< art::InputTag > DetSimModuleLabel
std::string fOutputCategory
Category for LogVerbatim output.
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Detector simulation of raw signals on wires.
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
fhicl::Atom< unsigned int > DigitsPerLine
Definition of basic raw digits.
Zero Suppression followed by Huffman Encoding.
Classes gathering simple statistics.
unsigned short Samples() const
Number of samples in the uncompressed ADC data.
raw::RawDigit::ADCvector_t::value_type Digit_t
Type to represent a digit.
unsigned int fDigitsPerLine
Ticks/digits per line in the output.
DumpRawDigits(Parameters const &config)
Constructor.
Zero Suppression algorithm.
Keeps track of the minimum and maximum value we observed.
Pedestal_t fPedestal
ADC pedestal, will be subtracted from digits.
Data_t min() const
Returns the accumulated minimum, or a very large number if no values.
fhicl::Atom< std::string > OutputCategory
#define DEFINE_ART_MODULE(klass)
Collect all the RawData header files together.
std::string indent(std::size_t const i)
size_t NADC() const
Number of elements in the compressed ADC sample vector.
virtual void beginJob() override
Prints an introduction.
Prints the content of all the raw digits on screen.
EDAnalyzer(Table< Config > const &config)
Definition of data types for geometry description.
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
void PrintRawDigit(Stream &&out, raw::RawDigit const &digits, std::string indent=" ", std::string firstIndent=" ") const
Dumps a single recob:Wire to the specified output stream.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
fhicl::Atom< Pedestal_t > Pedestal