56 using Digit_t = raw::RawDigit::ADCvector_t::value_type;
67 Name(
"DetSimModuleLabel"),
68 Comment(
"tag of producer used to create the raw::RawDigit collection"),
73 Name(
"OutputCategory"),
74 Comment(
"the messagefacility category used for the output"),
79 Name(
"DigitsPerLine"),
80 Comment(
"number of digits printed per line (0: don't print digits)"),
86 Comment(
"digit values are written relative to this number"),
110 template <
typename Stream>
114 std::string firstIndent =
" ")
const;
137 <<
"A pedestal of " <<
fPedestal <<
" will be subtracted from all raw digits";
159 template <
typename Stream>
163 std::string firstIndent
176 out << firstIndent <<
" #" << digits.
Channel() <<
": " << ADCs.size() <<
" time ticks";
177 if (digits.
Samples() != ADCs.size()) out <<
" [!!! EXPECTED " << digits.
Samples() <<
"] ";
178 out <<
" (" << digits.
NADC() <<
" after compression); compression type: ";
180 case raw::kNone: out <<
"no compression";
break;
185 default: out <<
"unknown (#" << ((int)digits.
Compression()) <<
")";
break;
192 unsigned int repeat_count = 0;
193 unsigned int index = 0;
195 out <<
"\n" << indent <<
"content of the channel (" <<
fDigitsPerLine <<
" ticks per line):";
196 auto iTick = ADCs.cbegin(), tend = ADCs.cend();
197 while (iTick != tend) {
199 unsigned int line_size = std::min(fDigitsPerLine, (
unsigned int)ADCs.size() - index);
200 if (line_size == 0)
break;
203 DigitBuffer.resize(line_size);
204 auto iBuf = DigitBuffer.begin(), bend = DigitBuffer.end();
205 while ((iBuf != bend) && (iTick != tend))
210 if (DigitBuffer == LastBuffer) {
217 if (repeat_count > 0) {
219 << indent <<
" [ ... repeated " << repeat_count <<
" more times, " 220 << (repeat_count * LastBuffer.size()) <<
" ticks ]";
225 out <<
"\n" << indent <<
" ";
226 for (
auto digit : DigitBuffer)
227 out <<
" " << std::setw(4) << digit;
231 std::swap(LastBuffer, DigitBuffer);
234 if (repeat_count > 0) {
235 out <<
"\n" << indent <<
" [ ... repeated " << repeat_count <<
" more times to the end ]";
237 if (Extrema.
min() < Extrema.
max()) {
239 << indent <<
" range of " << index <<
" samples: [" << Extrema.
min() <<
";" 240 << 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.
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
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.
EDAnalyzer(fhicl::ParameterSet const &pset)
Classes gathering simple statistics.
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.
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
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.
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