Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get field response with function #324

Merged
merged 2 commits into from
Aug 9, 2024
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
4 changes: 4 additions & 0 deletions sigproc/inc/WireCellSigProc/OmnibusSigProc.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ namespace WireCell {
// samples.
bool m_sparse{false};

// If true, load plane response with an ident number, see:
// https://github.com/WireCell/wire-cell-toolkit/issues/322
bool m_load_fr_with_plane_ident{false};

size_t m_count{0};
int m_verbose{0};

Expand Down
12 changes: 11 additions & 1 deletion sigproc/src/OmnibusSigProc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ std::string WireCell::SigProc::OmnibusSigProc::OspChan::str() const
void OmnibusSigProc::configure(const WireCell::Configuration& config)
{
m_sparse = get(config, "sparse", false);
m_load_fr_with_plane_ident = get(config, "load_fr_with_plane_ident", false);

m_fine_time_offset = get(config, "ftoffset", m_fine_time_offset);
m_coarse_time_offset = get(config, "ctoffset", m_coarse_time_offset);
Expand Down Expand Up @@ -297,6 +298,7 @@ WireCell::Configuration OmnibusSigProc::default_configuration() const
cfg["isWarped"] = m_isWrapped; // default false

cfg["sparse"] = false;
cfg["load_fr_with_plane_ident"] = false;

return cfg;
}
Expand Down Expand Up @@ -790,7 +792,15 @@ void OmnibusSigProc::init_overall_response(IFrame::pointer frame)

// Convert each average FR to a 2D array
for (int iplane = 0; iplane < 3; ++iplane) {
auto arr = Response::as_array(fravg.planes[iplane], fine_nwires, fine_nticks);
Array::array_xxf arr;
if (m_load_fr_with_plane_ident) {
// Load correct field response for the swapped V&W planes in PDHD APA1. See:
// https://github.com/WireCell/wire-cell-toolkit/issues/322
arr = Response::as_array(*(fravg.plane(iplane)), fine_nwires, fine_nticks);
}
else {
arr = Response::as_array(fravg.planes[iplane], fine_nwires, fine_nticks);
}


int nrows = 0;
Expand Down