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

Read in art products for wire-cell imaging #36

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ebelchio12
Copy link

No description provided.

@FNALbuild
Copy link
Contributor

A new Pull Request was created by @ebelchio12 (Ewerton Belchior) for develop.

It involves the following packages:

larwirecell

@LArSoft/level-1-managers, @LArSoft/level-2-managers can you please review it and eventually sign? Thanks.

cms-bot commands are listed here

@FNALbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@FNALbuild
Copy link
Contributor

-code-checks
Pull request failed code-formatting checks. Please ensure that cetmodules has been setup and execute the following command from the top-level directory of your repository:

format-code \
  larwirecell/Components/CookedFrameSource.cxx

Then commit the changes and push them to your PR branch.

@lgarren
Copy link
Member

lgarren commented Aug 31, 2023

@ebelchio12 Please apply the clang format as mentioned here: #36 (comment)

@brettviren
Copy link
Member

Hi @ebelchio12

Notes from our meeting

  • remove the imaging configuration and instead simply don't apply the new CMM making if the user supplies none of the other new configuration that describes how the CMM is to be built.
  • consider making a unit test from your validation job and getting it integrated into LArSoft CI. The test can be as simple as using grep and awk to get at the log lines that you are already checking manually and doing a diff. If the diff fails, then the test fails.

@FNALbuild
Copy link
Contributor

Pull request #36 was updated. @LArSoft/level-1-managers, @LArSoft/level-2-managers can you please check and sign again.

@FNALbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@FNALbuild
Copy link
Contributor

+code-checks

Comment on lines +40 to +41
cfg["wiener_inputTag"] = ""; // art tag for wiener recob::Wire
cfg["gauss_inputTag"] = ""; // art tag for gauss recob::Wire
Copy link
Member

Choose a reason for hiding this comment

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

I'll just make one big comment but it applies to essentially this whole diff.

There are two main problems with this PR that must be cleaned up. They are like we discussed on zoom and I commented on in the PR.

  1. This class must work for a wide variety of users and so should not have any application specific information that is hard-wired in C++ or in configuration. Ie, there should be no configuration keys nor C++ symbols that include the label wiener or bad, etc. Instead, the C++ should be purely "data driven" by the configuration.

  2. There should be no "modal" true/false configuration values. Instead, if some action is to be taken by the class then the configuration values needed to perform that action will be given. If no such configuration values are given then the class simply does not take the action.

Specifically:

  • Remove all the *_inputTag configuration and code that touches them. There is already a frame_tags configuration and that is generic and is interpreted by converting art::Event data into frame traces.

  • Remove the current cmm_tag (and badmasks_inputTag) configuration and all code that touches them. What the user must supply is a instead mapping that associates a CMM key (eg "bad" to an art::Event label. I would call this configuration parameter, perhaps, cmm_entries.

  • Remove m_cmm_setup and instead convert CMM information (using your existing by iterating on the new cmm_entries configuration. If that configuration is empty then so is the loop body. The actual conversion code you have at the end of this diff (the loop over bad_masks, but again, the symbol "bad" is ... bad) looks okay to me.

Comment on lines +298 to +314
for (auto bad_mask : bad_masks) {
Waveform::ChannelMasks cm;
size_t nchannels = bad_mask.second->size() / 3;
for (size_t i = 0; i < nchannels; i++) {
size_t ch_idx = 3 * i;
size_t low_idx = 3 * i + 1;
size_t up_idx = 3 * i + 2;
auto cmch = bad_mask.second->at(ch_idx);
auto cm_first = bad_mask.second->at(low_idx);
auto cm_second = bad_mask.second->at(up_idx);
Waveform::BinRange bins(cm_first, cm_second);
cm[cmch].push_back(bins);
}
cm_out = Waveform::merge(cm_out, cm);
}

cmm[m_cmm_tag] = cm_out; // for now use a single tag for output cmm
Copy link
Member

Choose a reason for hiding this comment

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

I think this is mostly okay but do not use the symbol bad and save into the cmm using the key from the cmm_entries configuration and not any singular name (ie, remove m_cmm_tag entirely).

@knoepfel
Copy link
Member

@ebelchio12, is there any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants