70 std::map<int, std::pair<int, int>> channel_timestamp;
72 auto& digits_pds_in = *digits_handle_pds;
73 for (
auto&& digit: digits_pds_in) {
75 << digit.ChannelNumber() <<
" ";
77 auto f = channel_timestamp.find(digit.ChannelNumber());
78 if (
f == channel_timestamp.end()) {
79 channel_timestamp[digit.ChannelNumber()] = std::make_pair(digit.TimeStamp(), digit.size());
81 int begin_old =
f->second.first;
82 int begin_new = digit.TimeStamp();
83 begin_new = (begin_old > begin_new) ? begin_new : begin_old;
84 int end_old =
f->second.first+
f->second.second;
85 int end_new = digit.TimeStamp()+digit.size();
86 end_new = (end_old > end_new) ? end_old : end_new;
87 f->second.first = begin_new;
88 f->second.second = end_new - begin_new;
90 for(
auto const&
adc: digit) {
99 auto& truth_pds_in =*truth_handle_pds;
101 for (
auto const& interesting: channel_timestamp) {
102 int channel = interesting.first;
103 int timestamp = interesting.second.first;
104 int nticks = interesting.second.second;
106 for (
auto&& truth: truth_pds_in) {
107 if (truth.OpDetNum() !=
channel)
continue;
109 << truth.OpDetNum() <<
" ";
110 for(
int ichge=timestamp; ichge<nticks+timestamp; ++ichge){
118 std::cout <<
"didn't find this channel " << channel
119 <<
" timestamp " << timestamp
120 <<
" ticks " << nticks <<
" in truth\n";
EventNumber_t event() const
EDAnalyzer(fhicl::ParameterSet const &pset)
art framework interface to geometry description
#define DEFINE_ART_MODULE(klass)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Declaration of signal hit object.
auto const & get(AssnsNode< L, R, D > const &r)
LArSoft geometry interface.