Add full cut optimization as introduced in pyirf 0.13#2789
Add full cut optimization as introduced in pyirf 0.13#2789LukasBeiske wants to merge 15 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
|
How fine did you make the scanning of the cuts? In principle, the full cut opt should always be at least as good as the one that is restricted,.if it is allowed to find the same cuts. |
This comment has been minimized.
This comment has been minimized.
I kept everything at the default values, as we have them in here right now. So, if I'm not mistaken, the only difference would be that the EventDisplay-like optimization has a theta cut with 68% efficiency, while the full optimization only tries 60% and 70%. And, I think, there is no check for a minimum number of events per bin in the full cut optimization, while the 68% theta cut for the EventDisplay-like optimization has a minimum of 10 events per bin. However, this only seems to play a role for the two lowest energy bins, if at all. |
Analysis Details1 IssueCoverage and DuplicationsProject ID: cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs |
|
If I remember correctly, these percentiles cannot be compared directly, as the eventdisplay-like optimization computes the percentile on the events surviving the initial cut, whereas the full optimization computes it on all events. |
Ah, good point, I forgot about that. I'll run the full optimization again with a finer gridding. I guess, these underperformance for some bins will disappear then. |
kosack
left a comment
There was a problem hiding this comment.
gh_cut_efficiency_step=0.02
theta_cut_efficiency_step=0.02
If a smaller step is important to get a good sensitivity, please also update the ctapipe-quickstart configurations to provide the best values for users, and also the default values in the tool itself.
Is this an error introduced here? Or does it affect main? If it affects also main, could you open a PR just with the bugfix please? |
This does not affect main, it was related to the application of the multiplicity cut introduced here. |
|
@Hckjs This is correct yes. One could probably get around this by optimizing again at least once or until it converges. But I think we should just use the global optimization scheme instead. |
I didn' realize that plot was for the old optimization, as @Hckjs points out it doesnt hold true for the gh opt that finer steps should alsway result in lower sensitivity. For the full optimization, it only holds if
|
7dcc8e6 to
1e98b11
Compare
|
Thanks @Hckjs, I missed that. However, doing it again for the full optimization using the same dataset for cut optimization and sensitivity calculation, the same problem is visible: I'll look into this again. Maybe there is something I'm still missing in the grid search within pyirf. |
Looking at only the final sensitivity makes it a bit hard to debug since it has so many factors that effect it. Those fluctuations could be due to low stats if one of the cuts is too tight. Might be good to compare the cut efficiencies, background rates, PSF, and effective areas separately |
cad944f to
126cdc1
Compare
|
|
Checking with @Hckjs, I think we understand what is happening. The cut optimization is done in a single FoV range, by default from 0° to 5° degrees offset. If you optimize the cuts in this full range but then compute sensitivity in different, smaller offset ranges, the assumption smaller step = better or equal sensitivity does not hold. |
|
Small update after checking again with @maxnoe: We think the root of the problem is the |
…llow implicit definition of physical_type via default_value
126cdc1 to
a5d4273
Compare
|
Let's do independent things in independent PRs, this is already a great new feature |
|














This changes the
PointSourceSensitivityOptimizerto use the full cut optimization introduced in pyirf 0.13. The previous EventDisplay-like optimization can now be used via thePointSourceSensitivityGhOptimizer.I did a quick comparison of the three optimizers using prod6 files (multiplicity >= 2 for gh opt and percentile cuts, as the HillasReconstructer is used):




I am not sure, why the EventDisplay-like optimization results in a better sensitivity at high energies.
Fixes #2771