-
Notifications
You must be signed in to change notification settings - Fork 78
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 on mc_type for RF #589
Conversation
I did not foresee the writing type issue... (these parameters are requested to be integers and |
Then the default necessarily has to be an integer outside of the physical range, right? And filter those before passing the events to the training (and to the application of the trained models) |
lstchain/io/lstcontainers.py
Outdated
@@ -95,7 +95,7 @@ class DL1ParametersContainer(Container): | |||
mc_core_x = Field(None, 'Simulated impact point x position', unit=u.m) | |||
mc_core_y = Field(None, 'Simulated impact point y position', unit=u.m) | |||
mc_h_first_int = Field(None, 'Simulated first interaction height', unit=u.m) | |||
mc_type = Field(-1, 'Simulated particle type') | |||
mc_type = Field(np.nan, 'Simulated particle type') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, -1 is ok, particle id is also a positive integer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I think that in the corsika nomenclatura, negative integers are possible and meant for anti-particles (-1 would be positrons then)
maybe I'll rather go for -9999 just in case ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:o
thanks!
I would have sworn I had seen negative values in the past, my mistake!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, triple checking this, I found that simtel does not use the CORSIKA codes anymore.
From io_hess.h
:
int primary_id; ///< Particle ID of primary. Was in CORSIKA convention
///< where detector_prog_vers in MC run header was 0,
///< and is now 0 (gamma), 1(e-), 2(mu-), 100*A+Z
///< for nucleons and nuclei, negative for antimatter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this should be 0 for gamma, 101 for proton.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, verified for our current simulations. 0 = gamma, 101 = proton, negative numbers possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the counter check!
I'll update accordingly.
Yes that was basically how it was implemented. |
Codecov Report
@@ Coverage Diff @@
## master #589 +/- ##
=======================================
Coverage 37.51% 37.52%
=======================================
Files 82 82
Lines 7359 7361 +2
=======================================
+ Hits 2761 2762 +1
- Misses 4598 4599 +1
Continue to review full report at Codecov.
|
Issue:
I encountered the problem when using
dl1ab
, themc_type
would be set to -1 for some events and thus the RF would predict 3 classes and the gammaness would not be assigned to the right class.So I also add an error raise in case of more than 2 predicted classes, which should never happen in current setup.