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

refresh nticks for each event #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions sigproc/inc/WireCellSigProc/OmnibusNoiseFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ namespace WireCell {
private:
// number of time ticks in the waveforms processed. Set to 0 and first input trace sets it.
size_t m_nticks;
// allow user to refresh the nticks for each event
bool m_reload_nticks{false};
std::string m_intag, m_outtag;
std::vector<WireCell::IChannelFilter::pointer> m_perchan, m_grouped, m_perchan_status;
WireCell::IChannelNoiseDatabase::pointer m_noisedb;
Expand Down
7 changes: 6 additions & 1 deletion sigproc/src/OmnibusNoiseFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ void OmnibusNoiseFilter::configure(const WireCell::Configuration& cfg)
log->warn("\"nsamples\" is an obsolete parameter, use \"nticks\"");
// we don't throw here on assumption that nticks is still provided
}
m_reload_nticks = get<bool>(cfg, "reload_nticks", m_reload_nticks);
if (m_reload_nticks) {
log->debug("will refresh nticks per event");
}

auto jmm = cfg["maskmap"];
for (auto name : jmm.getMemberNames()) {
Expand Down Expand Up @@ -77,6 +81,7 @@ WireCell::Configuration OmnibusNoiseFilter::default_configuration() const
{
Configuration cfg;
cfg["nticks"] = (int) m_nticks;
cfg["reload_nticks"] = m_reload_nticks;
cfg["maskmap"]["chirp"] = "bad";
cfg["maskmap"]["noisy"] = "bad";

Expand Down Expand Up @@ -115,7 +120,7 @@ bool OmnibusNoiseFilter::operator()(const input_pointer& inframe, output_pointer
return true;
}

if (! m_nticks) {
if (! m_nticks or m_reload_nticks) {
// Warning: this implicitly assumes a dense frame (ie, all tbin=0 and all waveforms same size).
// It also won't stop triggering a warning inside OneChannelNoise if there is a mismatch.
m_nticks = traces.at(0)->charge().size();
Expand Down