11 #include "canvas/Utilities/InputTag.h"
19 #include "fhiclcpp/ParameterSet.h"
42 fOpDetWaveformTag = config ? config->get<std::string>(
"OpDetWaveformTag",
"opdaq") :
"opdaq";
44 std::cout <<
"CLOCK FREQ: " << clock_freq << std::endl;
59 bool ProcessEvent(
const gallery::Event& ev,
const std::vector<event::Interaction> &truth, std::vector<event::RecoInteraction>&
reco) {
60 const std::vector<raw::OpDetWaveform> &waveforms = *ev.getValidHandle<std::vector<raw::OpDetWaveform>>(
fOpDetWaveformTag);
62 std::map<raw::Channel_t, std::vector<std::pair<float, float>>> waveform_data;
63 std::map<raw::Channel_t, std::vector<float>> wf_start_times;
64 std::map<raw::Channel_t, std::vector<float>> wf_periods;
70 for (
unsigned i = 0; i < wf.
Waveform().size(); i++) {
81 std::map<raw::Channel_t, std::pair<std::vector<float>, std::vector<float>>> waveform_plots;
82 for (
auto &wf_data_pair: waveform_data) {
83 for (
auto data_pair: wf_data_pair.second) {
84 waveform_plots[wf_data_pair.first].first.push_back(data_pair.first);
85 waveform_plots[wf_data_pair.first].second.push_back(data_pair.second);
89 for (
auto &start_time_pair: wf_start_times) {
90 std::cout <<
"Event: " <<
event_ind <<
" Channel: " << start_time_pair.first << std::endl;
91 const std::vector<float> &wf_period = wf_periods.at(start_time_pair.first);
92 for (
unsigned i = 0; i < start_time_pair.second.size(); i++) {
93 std::cout << start_time_pair.second[i] <<
" (" << wf_period[i] <<
") ";
99 std::vector<TGraph *>
plots;
100 for (
auto &plot_info: waveform_plots) {
101 TGraph *
plot =
new TGraph(plot_info.second.first.size(), &plot_info.second.first[0], &plot_info.second.second[0]);
104 plots.push_back(plot);
107 for (TGraph *
plot: plots) {
TFile * fOutputFile
The output ROOT file.
process_name opflashCryoW ana
process_name standard_reco_uboone reco
std::vector< PlotDef > plots
#define DECLARE_SBN_PROCESSOR(classname)
Base class for event selections.
const detinfo::DetectorClocksStandard * GetDetectorClocksProvider() const
std::string to_string(WindowPattern const &pattern)
ProviderManager * fProviderManager
Interface for provider access.
BEGIN_PROLOG could also be cout