66 Name(
"OpDetWaveformsTag"),
67 Comment(
"input tag of the raw::OpDetWaveform collection to be dumped")};
70 Comment(
"name of the category used for the output"),
71 "DumpOpDetWaveforms"};
74 Name(
"DigitsPerLine"),
75 Comment(
"the dump of ADC readings will put this many of them for each line"),
80 Comment(
"ADC readings are written relative to this number"),
84 Name(
"SortByChannelAndTime"),
86 (
"waveforms are dumped in channel number order, and then timestamp"),
91 Comment(
"write an index in front of each digit dump line; choose between:" 92 " \"tick\" (waveform tick number)" 93 ", \"timestamp\" (electronics clock time in microseconds)" 94 ", \"none\" (no tick label)"),
137 std::unique_ptr<dump::raw::OpDetWaveformDumper::TimeLabelMaker>
fTimeLabel;
140 static std::vector<std::vector<raw::OpDetWaveform const*>>
groupByChannel(
141 std::vector<raw::OpDetWaveform>
const& waveforms);
144 static void sortByTimestamp(std::vector<raw::OpDetWaveform const*>& waveforms);
164 if (tickLabelStr ==
"none") {
167 else if (tickLabelStr ==
"tick") {
168 fTimeLabel = std::make_unique<dump::raw::OpDetWaveformDumper::TickLabelMaker>();
170 else if (tickLabelStr ==
"time") {
171 auto const clock_data =
173 fTimeLabel = std::make_unique<TimestampLabelMaker>(clock_data.OpticalClock().TickPeriod());
177 <<
"Invalid choice '" << tickLabelStr <<
"' for time label.\n";
188 auto const& Waveforms
195 << Waveforms.size() <<
" optical detector channels";
198 <<
"A pedestal of " <<
fPedestal <<
" counts will be subtracted from all ADC readings.";
216 for (
auto& channelWaveforms : groupedWaveforms) {
217 if (channelWaveforms.empty())
continue;
220 auto const channel = channelWaveforms.front()->ChannelNumber();
223 <<
" optical detector channel #" <<
channel <<
" has " 224 << channelWaveforms.size() <<
" waveforms:";
228 dump(log, *pWaveform);
239 std::vector<std::vector<raw::OpDetWaveform const*>>
242 std::vector<std::vector<raw::OpDetWaveform const*>> groups;
243 for (
auto const& waveform : waveforms) {
244 auto const channel = waveform.ChannelNumber();
246 groups[
channel].push_back(&waveform);
256 struct ChannelSorter {
280 std::sort(waveforms.begin(), waveforms.end(), ChannelSorter());
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
ChannelGroupService::Name Name
Detector simulation of raw signals on wires.
EDAnalyzer(fhicl::ParameterSet const &pset)
#define DEFINE_ART_MODULE(klass)
def dump(input_file, output_file)
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::string to_string(ModuleType const mt)
Event finding and building.
pure virtual base interface for detector clocks