Skip to content

Additional metric and viewcone restriction for monte carlo statistics estimator#2346

Draft
GernotMaier wants to merge 7 commits into
mainfrom
mc-statistics
Draft

Additional metric and viewcone restriction for monte carlo statistics estimator#2346
GernotMaier wants to merge 7 commits into
mainfrom
mc-statistics

Conversation

@GernotMaier

Copy link
Copy Markdown
Contributor

Closes #2345

@GernotMaier GernotMaier self-assigned this Jul 15, 2026
@GernotMaier GernotMaier added the Copilot review AI-supported Copilot review label Jul 15, 2026
@ctao-sonarqube

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the Monte Carlo statistics estimation workflow to support (1) restricting estimates to a reduced view-cone radius and (2) estimating required thrown events from a user-specified total number of triggered events, in addition to the existing per-bin relative-uncertainty target. It also centralizes and applies test-resource path macro resolution when reading YAML configuration files.

Changes:

  • Add --reduced_view_cone_radius support and view-cone reweighting in the Monte Carlo statistics estimator.
  • Add --target_triggered_events as an alternative metric (mutually exclusive with --target_relative_uncertainty) for required-events estimation.
  • Move/centralize ${static:...} / ${generated:...} / ${downloaded:...} path macro resolution into simtools.io.io_handler and apply it during config loading.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit_tests/production_configuration/test_monte_carlo_statistics_estimator.py Adds unit coverage for reduced view-cone logic, triggered-event target metric, and metadata/column changes.
tests/unit_tests/io/test_io_handler.py Adds unit tests for recursive resolution of test-resource macros and canonical tests/resources/... paths.
tests/unit_tests/configuration/test_configurator.py Verifies YAML config loading resolves ${static/generated/downloaded:...} macros into absolute paths.
tests/unit_tests/applications/test_production_derive_monte_carlo_statistics.py Extends CLI parsing tests for --reduced_view_cone_radius and --target_triggered_events.
tests/integration_tests/config/production_derive_monte_carlo_statistics_target_uncertainty.yml Updates integration config to use reduced view cone radius and new output naming.
tests/integration_tests/config/production_derive_monte_carlo_statistics_target_triggered_events.yml Adds a new integration config for the triggered-event target mode.
src/simtools/testing/configuration.py Delegates test-resource path resolution to simtools.io.io_handler.
src/simtools/production_configuration/monte_carlo_statistics_estimator.py Implements view-cone restriction, triggered-event target estimation, and refactors estimation helpers/metadata handling.
src/simtools/io/io_handler.py Introduces resolve_test_resource_paths utility for ${static/generated/downloaded:...} and tests/resources path normalization.
src/simtools/configuration/configurator.py Applies test-resource path resolution when reading YAML configuration files.
src/simtools/applications/production_derive_monte_carlo_statistics.py Adds new CLI options and enforces mutual exclusivity between the two target metrics.
docs/changes/2346.feature.md Adds a changelog fragment describing the new estimator metric and view-cone restriction option.
Comments suppressed due to low confidence (1)

tests/integration_tests/config/production_derive_monte_carlo_statistics_target_uncertainty.yml:17

  • integration_tests block is not valid YAML for the expected workflow schema: test_name is currently at the same indentation level as the list item, so it becomes a sibling key of integration_tests instead of part of the test entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +548 to 552
overall_trigger_probability = _compute_overall_trigger_probability(
triggered_counts,
simulated_counts,
energy_mask,
target_relative_uncertainty,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Copilot review AI-supported Copilot review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Additional metric and viewcone restriction for monte carlo statistics estimator

2 participants