57 using Digit_t = raw::RawDigit::ADCvector_t::value_type;
69 Name(
"DetSimModuleLabel"),
70 Comment(
"tag of producer used to create the raw::RawDigit collection"),
75 Name(
"OutputCategory"),
76 Comment(
"the messagefacility category used for the output"),
81 Name(
"DigitsPerLine"),
82 Comment(
"number of digits printed per line (0: don't print digits)"),
88 Comment(
"digit values are written relative to this number"),
114 template <
typename Stream>
142 <<
" will be subtracted from all raw digits";
167 template <
typename Stream>
183 <<
" #" << digits.
Channel() <<
": " << ADCs.size() <<
" time ticks";
184 if (digits.
Samples() != ADCs.size())
185 out <<
" [!!! EXPECTED " << digits.
Samples() <<
"] ";
187 <<
" (" << digits.
NADC() <<
" after compression); compression type: ";
189 case raw::kNone: out <<
"no compression";
break;
196 out <<
"unknown (#" << ((
int) digits.
Compression()) <<
")";
break;
203 unsigned int repeat_count = 0;
204 unsigned int index = 0;
206 out <<
"\n" << indent
207 <<
"content of the channel (" <<
fDigitsPerLine <<
" ticks per line):";
208 auto iTick = ADCs.cbegin(), tend = ADCs.cend();
209 while (iTick != tend) {
211 unsigned int line_size
212 =
std::min(fDigitsPerLine, (
unsigned int) ADCs.size() -
index);
213 if (line_size == 0)
break;
216 DigitBuffer.resize(line_size);
217 auto iBuf = DigitBuffer.begin(), bend = DigitBuffer.end();
218 while ((iBuf != bend) && (iTick != tend))
223 if (DigitBuffer == LastBuffer) {
230 if (repeat_count > 0) {
231 out <<
"\n" << indent
232 <<
" [ ... repeated " << repeat_count <<
" more times, " 233 << (repeat_count * LastBuffer.size()) <<
" ticks ]";
238 out <<
"\n" << indent <<
" ";
239 for (
auto digit: DigitBuffer)
247 if (repeat_count > 0) {
248 out <<
"\n" << indent
249 <<
" [ ... repeated " << repeat_count <<
" more times to the end ]";
251 if (Extrema.
min() < Extrema.
max()) {
252 out <<
"\n" << indent
253 <<
" range of " << index
254 <<
" 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.
std::vector< raw::RawDigit > RawDigits
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.
ChannelGroupService::Name Name
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
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)
void swap(Handle< T > &a, Handle< T > &b)
size_t NADC() const
Number of elements in the compressed ADC sample vector.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
virtual void beginJob() override
Prints an introduction.
Prints the content of all the raw digits on screen.
Q_EXPORT QTSManip setw(int w)
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
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