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

Fix for I3PulseNoiseTruthFlag extractor issue #340

Conversation

RasmusOrsoe
Copy link
Collaborator

@RasmusOrsoe RasmusOrsoe commented Nov 2, 2022

Fixes #337 . Tested on upgrade data.

@RasmusOrsoe RasmusOrsoe changed the title fix added, introduced padding value Fix for I3PulseNoiseTruthFlag extractor issue Nov 2, 2022
Copy link
Collaborator

@asogaard asogaard left a comment

Choose a reason for hiding this comment

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

Hi @RasmusOrsoe,

Thanks for proposing a fix! A few questions:

  • I3PulseNoiseTruthFlagIceCubeUpgrade inherits from I3FeatureExtractorIceCube86, but wouldn't it make more sense for it to inherit from I3FeatureExtractorIceCubeUpgrade so as to avoid having to re-derive string, pmt_dir_x, etc.?
  • If the purpose of I3PulseNoiseTruthFlagIceCubeUpgrade is to extract a truth label (truth_flag) would it make more sense to put it in i3truthextractor.py and remove the dependence on I3FeatureExtractor* entirely, thereby avoiding the cause of the problem you've encountered altogether?
    • If not, would it then be an option to use e.g. getattr(pulse, "charge", padding_value) instead of the include_pulses argument to fall back to a default of padding_value in case we get a pulse map that doesn't have the charge attribute?

@RasmusOrsoe
Copy link
Collaborator Author

Hi @RasmusOrsoe,

Thanks for proposing a fix! A few questions:

* `I3PulseNoiseTruthFlagIceCubeUpgrade` inherits from `I3FeatureExtractorIceCube86`, but wouldn't it make more sense for it to inherit from `I3FeatureExtractorIceCubeUpgrade` so as to avoid having to re-derive `string`, `pmt_dir_x`, etc.?

Yeah, I would think so. I did not change that part, but perhaps I should.

* If the purpose of `I3PulseNoiseTruthFlagIceCubeUpgrade` is to extract a truth label (`truth_flag`) would it make more sense to put it in `i3truthextractor.py` and remove the dependence on `I3FeatureExtractor*` entirely, thereby avoiding the cause of the problem you've encountered altogether?

Conceptually, I agree that this would be the best way to go. But technically, it's important to include DOM ids, PMT ids, perhaps even positions, in order to make sure that the flags are sorted correctly according to the pulsemap.

  * If not, would it then be an option to use e.g. `getattr(pulse, "charge", padding_value)` instead of the `include_pulses` argument to fall back to a default of `padding_value` in case we get a pulse map that doesn't have the `charge` attribute?

I suspect that would be a much more elegant solution. I did not think of that!

@RasmusOrsoe
Copy link
Collaborator Author

@asogaard this should be it, I think

Copy link
Collaborator

@asogaard asogaard left a comment

Choose a reason for hiding this comment

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

Fantastic!

@RasmusOrsoe RasmusOrsoe merged commit 55bbd97 into graphnet-team:main Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I3PulseNoiseTruthFlagIceCubeUpgrade doesn't work anymore
2 participants