Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions sbncode/HitFinder/ChannelROIToWire_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ChannelROIToWire : public art::EDProducer
std::vector<art::InputTag> fWireModuleLabelVec; ///< vector of modules that made digits
std::vector<std::string> fOutInstanceLabelVec; ///< The output instance labels to apply
bool fDiagnosticOutput; ///< secret diagnostics flag
bool fUseFloatPrecision; ///< use SignalROIF() to preserve sub-ADC precision (no rounding)
size_t fEventCount; ///< count of event processed

const geo::WireReadoutGeom* fChannelMapAlg = &art::ServiceHandle<geo::WireReadout const>()->Get();
Expand All @@ -77,6 +78,7 @@ void ChannelROIToWire::reconfigure(fhicl::ParameterSet const& pset)
fWireModuleLabelVec = pset.get<std::vector<art::InputTag>>("WireModuleLabelVec", std::vector<art::InputTag>()={"decon1droi"});
fOutInstanceLabelVec = pset.get<std::vector<std::string>> ("OutInstanceLabelVec", {"PHYSCRATEDATA"});
fDiagnosticOutput = pset.get< bool >("DiagnosticOutput", false);
fUseFloatPrecision = pset.get< bool >("UseFloatPrecision", false);

if (fWireModuleLabelVec.size() != fOutInstanceLabelVec.size())
{
Expand Down Expand Up @@ -131,19 +133,26 @@ void ChannelROIToWire::produce(art::Event& evt)

// Create an ROI vector for output
recob::Wire::RegionsOfInterest_t ROIVec;

// Loop through the ROIs for this channel
const recob::ChannelROI::RegionsOfInterest_t& channelROIs = channelROI.SignalROI();

for(const auto& range : channelROIs.get_ranges())
if (fUseFloatPrecision)
{
const recob::ChannelROI::RegionsOfInterest_f& channelROIsF = channelROI.SignalROIF();
for(const auto& range : channelROIsF.get_ranges())
ROIVec.add_range(range.begin_index(), range.data());
}
else
{
size_t startTick = range.begin_index();
const recob::ChannelROI::RegionsOfInterest_t& channelROIs = channelROI.SignalROI();
for(const auto& range : channelROIs.get_ranges())
{
size_t startTick = range.begin_index();

std::vector<float> dataVec(range.data().size());
std::vector<float> dataVec(range.data().size());

for(size_t binIdx = 0; binIdx < range.data().size(); binIdx++) dataVec[binIdx] = range.data()[binIdx] / ADCScaleFactor;
for(size_t binIdx = 0; binIdx < range.data().size(); binIdx++) dataVec[binIdx] = range.data()[binIdx] / ADCScaleFactor;

ROIVec.add_range(startTick, std::move(dataVec));
ROIVec.add_range(startTick, std::move(dataVec));
}
}

wireCol->push_back(recob::WireCreator(std::move(ROIVec),channel,view).move());
Expand Down
6 changes: 5 additions & 1 deletion sbncode/WireMod/Utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ cet_make_library(
lardataobj::AnalysisBase
lardataobj::RawData
lardataobj::RecoBase
lardataalg::DetectorInfo
lardataobj::Simulation
nusimdata::SimulationBase
larevt::SpaceCharge
sbnobj::ICARUS_TPC
lardataalg::DetectorInfo
lardata::RecoObjects
lardata::Utilities
larreco::RecoAlg
Expand Down
Loading