Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions sbncode/CAFMaker/RecoUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
art_make_library( LIBRARY_NAME caf_RecoUtils
SOURCE RecoUtils.cc
LIBRARIES
sbnanaobj::StandardRecord
art::Framework_Core
art::Framework_Services_Registry
art::Framework_Principal
Expand Down
1 change: 1 addition & 0 deletions sbncode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ add_subdirectory(CosmicID)
add_subdirectory(DetSim)
add_subdirectory(Cluster3D)
add_subdirectory(HitFinder)
add_subdirectory(WireMod)

# Supera
#
Expand Down
29 changes: 18 additions & 11 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a stopping comment, but do we want the float precision to default to false? I like having it as a fhicl parameter, but we should make sure that the defaults match the most common use-case


if (fWireModuleLabelVec.size() != fOutInstanceLabelVec.size())
{
Expand Down Expand Up @@ -131,19 +133,24 @@ 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)
{
size_t startTick = range.begin_index();

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

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

ROIVec.add_range(startTick, std::move(dataVec));
const recob::ChannelROI::RegionsOfInterest_f& channelROIsF = channelROI.SignalROIF();
for(const auto& range : channelROIsF.get_ranges())
ROIVec.add_range(range.begin_index(), range.data());
}
else
{
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());
for(size_t binIdx = 0; binIdx < range.data().size(); binIdx++)
dataVec[binIdx] = std::round(range.data()[binIdx] / ADCScaleFactor);
ROIVec.add_range(startTick, std::move(dataVec));
}
}

wireCol->push_back(recob::WireCreator(std::move(ROIVec),channel,view).move());
Expand Down
1 change: 1 addition & 0 deletions sbncode/WireMod/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(Utility)
49 changes: 49 additions & 0 deletions sbncode/WireMod/Utility/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cet_make_library(
LIBRARY_NAME
sbncode_WireMod_Utility

SOURCE
WireModUtility.cc

LIBRARIES
${ART_FRAMEWORK_CORE}
${MF_MESSAGELOGGER}
${Boost_SYSTEM_LIBRARY}
${ROOT_BASIC_LIB_LIST}
${ROOT_HIST}
art_root_io::TFileService_service
larcorealg::Geometry
larcore::Geometry_Geometry_service
lardataobj::AnalysisBase
lardataobj::RawData
lardataobj::RecoBase
lardataobj::Simulation
nusimdata::SimulationBase
larevt::SpaceCharge
sbnobj::ICARUS_TPC
lardataalg::DetectorInfo
lardata::RecoObjects
lardata::Utilities
larreco::RecoAlg
${LARRECO_LIB}
${LARDATA_LIB}
${ART_FRAMEWORK_CORE}
${ART_FRAMEWORK_PRINCIPAL}
${ART_FRAMEWORK_SERVICES_REGISTRY}
${ART_FRAMEWORK_SERVICES_OPTIONAL}
${ART_FRAMEWORK_SERVICES_OPTIONAL_RANDOMNUMBERGENERATOR_SERVICE}
${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE}
${MF_MESSAGELOGGER}
${FHICLCPP}
${CLHEP}
${ROOT_GEOM}
${ROOT_XMLIO}
${ROOT_GDML}
${ROOT_BASIC_LIB_LIST}
${ROOT_HIST}
BASENAME_ONLY
)

install_headers()
install_source()

Loading