16 #include "fhiclcpp/ParameterSet.h"
17 #include "messagefacility/MessageLogger/MessageLogger.h"
18 #include "art/Framework/Core/ModuleMacros.h"
19 #include "art/Framework/Core/EDProducer.h"
20 #include "art/Framework/Principal/Event.h"
21 #include "art/Framework/Principal/Handle.h"
22 #include "art/Framework/Services/Registry/ServiceHandle.h"
23 #include "canvas/Utilities/Exception.h"
24 #include "canvas/Utilities/InputTag.h"
44 explicit ROIConvert(fhicl::ParameterSet
const& pset);
67 for(
const auto& wireLabel : fOutInstanceLabelVec)
69 produces<std::vector<recob::Wire>>(wireLabel);
77 fWireModuleLabelVec = pset.get<std::vector<art::InputTag>>(
"WireModuleLabelVec", std::vector<art::InputTag>()={
"decon1droi"});
78 fOutInstanceLabelVec = pset.get<std::vector<std::string>> (
"OutInstanceLabelVec", {
"PHYSCRATEDATA"});
83 throw art::Exception(art::errors::Configuration) <<
" Configured " << fOutInstanceLabelVec.size()
85 <<
" input products (`WireModuleLabelVec`)\n";
110 std::unique_ptr<std::vector<recob::Wire>> wireCol = std::make_unique<std::vector<recob::Wire>>();
112 mf::LogInfo(
"ROIConvert") <<
"ROIConvert, looking for ChannelROI data at " << channelLabel.encode();
115 const std::vector<recob::ChannelROI>& channelVec = evt.getProduct<std::vector<recob::ChannelROI>>(channelLabel);
117 mf::LogInfo(
"ROIConvert") <<
"--> Recovered ChannelROI data, size: " << channelVec.size();
119 if (!channelVec.empty())
122 wireCol->reserve(channelVec.size());
125 for(
const auto& channelROI : channelVec)
137 for(
const auto& range : channelROIs.
get_ranges())
139 size_t startTick = range.begin_index();
141 std::vector<float> dataVec(range.data().size());
143 for(
size_t binIdx = 0; binIdx < range.data().size(); binIdx++) dataVec[binIdx] = range.data()[binIdx];
145 ROIVec.
add_range(startTick, std::move(dataVec));
152 if(wireCol->empty()) mf::LogWarning(
"ROIConvert") <<
"No wires made for this event.";
155 evt.put(std::move(wireCol), instanceName);
void produce(art::Event &evt)
Definition of util::zip().
Utilities related to art service access.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Helper functions to create a wire.
const geo::GeometryCore * fGeometry
const datarange_t & add_range(size_type offset, ITER first, ITER last)
Adds a sequence of elements as a range with specified offset.
const range_list_t & get_ranges() const
Returns the internal list of non-void ranges.
ROIConvert(fhicl::ParameterSet const &pset)
Class managing the creation of a new recob::Wire object.
std::vector< std::string > fOutInstanceLabelVec
The output instance labels to apply.
std::vector< art::InputTag > fWireModuleLabelVec
vector of modules that made digits
Description of geometry of one entire detector.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
size_t fEventCount
count of event processed
Declaration of basic channel signal object for ICARUS.
Declaration of basic channel signal object.
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
process_name can override from command line with o or output caldata
void reconfigure(fhicl::ParameterSet const &p)
art framework interface to geometry description
bool fDiagnosticOutput
secret diagnostics flag