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

Filters In truth table, osc_weight in retro table #184

Merged

Conversation

BozianuLeon
Copy link
Collaborator

This is a small pull request that simply includes 5 of the collaborations filters that are useful for LE, oscillation analyses and neutrino sources . We extract these at the same time as the I3EventHeader etc. (they are calculated only for InIceSplit P frames) and will be located in the truth table of future SQLite dbs. Having these filters is very important for the one day in data project.

@BozianuLeon
Copy link
Collaborator Author

Also correcting an earlier PR error, a variable name missing an 's' on the end.

@RasmusOrsoe
Copy link
Collaborator

RasmusOrsoe commented Apr 7, 2022

@BozianuLeon if you could find the time to also include the "passed_lvlx" booleans, (x being 2, 3, 4, 5 etc) it would be quite nice.

Also; are these quantities available for all data and for real data/mc alike? Perhaps it would wise to wrap this in a the "try_get_key" method that Andreas proposed in #176, otherwise this PR would break the conversion to sqlite

@BozianuLeon
Copy link
Collaborator Author

BozianuLeon commented Apr 7, 2022

This PR was actually specifically targeting real data i3-files, which all contain FilterMask, I've also checked the level 2 simulation and this all contains the same filters (or at least an older subset of them). This shouldn't require a try_get method (which I could definitely still implement) unless one of the IceCube WG changes the filters they require to be run on all lvl2 data.

I'd be happy to make a passed_levelx boolean, but this does not currently exist (to my knowledge) in low-level i3 files, when I have a little bit more time. This was really just to get the DC filter on raw level 2 data.

@BozianuLeon
Copy link
Collaborator Author

BozianuLeon commented Apr 8, 2022

Add in the oscillation_weight for noise Monte Carlo, for later calculation of event rates.
Include try_get utility method mentioned in #176 , try to get oscillation_weight for lower level i3 files than currently. I3MCWeightDict should have a "weight" key from level 3.
I also think we should think about moving oscillation_weight out of the retro table, into truth. As it exists in lower levels than retro, and is useful for converting to rates in future plots.

@BozianuLeon BozianuLeon changed the title Add relevant filters to truth tables Filters In truth table, oscillation_weight in retro table Apr 14, 2022
@BozianuLeon BozianuLeon changed the title Filters In truth table, oscillation_weight in retro table Filters In truth table, osc_weight in retro table Apr 14, 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 @BozianuLeon,

Sorry for taking so long to get around to this. I think this PR looks perfectly fine, provided @RasmusOrsoe is happy about the change in the weight variable. :)

Comment on lines -391 to 400
if frame_contains_retro(frame):
if frame_is_noise(frame):
output.update({
'osc_weight': frame["I3MCWeightDict"]["weight"],
'osc_weight': frame["noise_weight"]["weight"],
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

@RasmusOrsoe, does this change affect you? Perhaps it would be better to introduce a new output variable called noise_weight or similar?

Copy link
Collaborator

@RasmusOrsoe RasmusOrsoe Apr 21, 2022

Choose a reason for hiding this comment

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

Hey @asogaard. This looks suspicious, so thanks for pointing it out!

However, I think this is a change following an offline conversation I had with Leon. The I3MCWeightDict weight weighs events to physical rates. If I remember correctly, this weight is not stored in ["I3MCWeightDict"] for pure noise events, and I think this is why Leon is adding it from a different field for noise events. @BozianuLeon can you confirm?

edit: Since osc_weight is our physical event weight, then I think it is completely fine to do what Leon does here - granted Leon can confirm.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can confirm what you are saying @RasmusOrsoe, this is oscNext's way of handling weights of noise events, just storing it somewhere differently. I do not think we lose any information by overwriting osc_weight here

@BozianuLeon BozianuLeon merged commit 7d1eeb4 into graphnet-team:main Apr 26, 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.

3 participants