Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2fc3fe8
readme fix
GernotMaier Jun 1, 2026
cf58d59
add warning
GernotMaier Jun 1, 2026
b1c5b95
R__LOAD
GernotMaier Jun 2, 2026
9598b16
debugging
GernotMaier Jun 2, 2026
18f3b48
library path
GernotMaier Jun 2, 2026
e576709
setting of library path
GernotMaier Jun 2, 2026
c89dd6c
Add plotting of sensitivtiy from log files
GernotMaier Jun 4, 2026
fa8b930
skip 3-tel runs
GernotMaier Jun 4, 2026
24b09ae
kaputt runs
GernotMaier Jun 4, 2026
da66aeb
new elevation steps
GernotMaier Jun 5, 2026
193f267
clarify usage
GernotMaier Jun 6, 2026
eefe21a
script consistency
GernotMaier Jun 6, 2026
99d2c94
apptainer note
GernotMaier Jun 6, 2026
470c1fc
Potential fix for pull request finding
GernotMaier Jul 12, 2026
4c1e6a8
Potential fix for pull request finding
GernotMaier Jul 12, 2026
d7dd1ff
Potential fix for pull request finding
GernotMaier Jul 12, 2026
4bc64c8
fix directory setting
GernotMaier Jun 6, 2026
36a9f4e
script improvements; XGB
GernotMaier Jul 16, 2026
bdcdfb1
linking
GernotMaier Jul 16, 2026
10ebba1
xgb linking
GernotMaier Jul 16, 2026
987b9cc
all run lists
GernotMaier Jul 24, 2026
86c85d2
add method
GernotMaier Aug 2, 2026
aeb4dc0
add flexibility in anasum directory
GernotMaier Aug 5, 2026
b531be6
early stop of data dir does not exist
GernotMaier Sep 26, 2026
e0c0c2d
pre-commit
GernotMaier Sep 26, 2026
55ac73a
ze correction
GernotMaier Sep 26, 2026
9e3bf50
clearer comparison
GernotMaier Sep 26, 2026
450bdc9
V2DL5
GernotMaier Sep 27, 2026
d6770f4
Change BDT value from '0' to '1'
GernotMaier Sep 27, 2026
19141ac
Fix job submission command to handle errors
GernotMaier Sep 27, 2026
3fc6746
Update README with input data requirements for Crab Nebula
GernotMaier Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
tmpdir
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# https://pycqa.github.io/isort/docs/configuration/black_compatibility.html#integration-with-pre-commit
- repo: https://github.com/pycqa/isort
rev: 9.0.0a3
rev: 9.0.1
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
Expand All @@ -12,7 +12,7 @@ repos:
args: ["--line-length=100"]
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html?highlight=other%20tools#flake8
- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
rev: 7.4.1
hooks:
- id: flake8
args: ["--max-line-length=100", "--extend-ignore=E203,E712"]
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ Simplified overview of the testing (somewhat outdated):

## Abbreviations

- SZE = small zenith angles (0-40deg)
- MZE = medium zenith angles (40-50 deg)
- LZE = large zenith angles (50-70 deg)
- SZE = small zenith angles (0-30deg)
- MZE = medium zenith angles (30-45 deg)
- LZE = large zenith angles (45-55 deg)
- BZE = beyond reasonable zenith angles (>55 deg)

## Directory structure

Expand Down
4 changes: 4 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: eventdisplay-release-tests
channels:
- conda-forge
dependencies:
- python>=3.8
- numpy
- matplotlib
- pandoc
- pre-commit
- towncrier
Expand All @@ -11,3 +14,4 @@ dependencies:
# activate: conda activate eventdisplay-release-tests
# update (conda/mamba): conda env update -f environment.yml --prune
# update (micromamba): micromamba update -f environment.yml
# update (micromamba): micromamba update -n eventdisplay-release-tests -f environment.yml
1 change: 1 addition & 0 deletions release_tests/montecarlo/irf_plotting/irf_plotting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CUT="NTel3-PointSource-Hard-TMVA-BDT"
CUT="NTel2-PointSource-Soft-TMVA-BDT"
CUT="NTel2-PointSource-Moderate-TMVA-BDT"
CUT="NTel2-PointSource-Moderate"
echo "WARNING: CUT is hardwired to $CUT (for now)"
# Comparison plots - version and simtype hardwired
COMPAREVERSION="v492"
COMPARESIMTYPE="CARE_202404"
Expand Down
1 change: 0 additions & 1 deletion release_tests/montecarlo/mc_data_comparison/.gitignore

This file was deleted.

99 changes: 88 additions & 11 deletions release_tests/montecarlo/mc_data_comparison/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,97 @@
# MC / data comparison
# MC / Data Comparison

Scripts and tools to compare MC distributions with results from the Crab Nebula.
**No apptainer usage!**

Fill and plot distributions with
Scripts and tools to compare Monte Carlo (MC) distributions with observational results from the Crab Nebula.

## Quick Start

```console
./compareDatawithMC.sh <runparameter file> <SZE/MZE/LZE/WOBBLE>
./compareDatawithMC.sh <runparameter file> <SZE|MZE|LZE|WOBBLE>
```

Requires as input:
Where `<SZE|MZE|LZE|WOBBLE>` specifies the observation conditions:

- `SZE`: Small zenith angles (0-25°, 0.5° wobble)
- `MZE`: Medium zenith angles (40-50°, 0.5° wobble)
- `LZE`: Large zenith angles (50-70°, 0.5° wobble)
- `WOBBLE`: Large wobble offsets (MC at 1° wobble, summer atmosphere only)

NOTE! The zenith angle bins are different compared to those used in the Crab Nebula analysis.

## Prerequisites

### Input Data Requirements

- MC simulation files for each minor epoch (organized by atmosphere type)
- Crab Nebula mscw results and matching `*.mscw.xgb_stereo.root` files for each run
- Run lists for Crab observations (generated separately)

## Preparation Steps

Before running the comparison, you must generate the Crab run lists:

```console
# From release_tests/sources/Crab/
./runlist_generator_from_anasum_log.sh <run parameter file> <anasum-results-directory>
```

This generates run lists for minor epochs, zenith angle ranges, and atmosphere types.
The run lists are saved in `EventDisplay_Release_<version>/Crab/runlists/`.

## Running the Comparison

### Step 1: Prepare Run Parameter File

The `<run parameter file>` must contain the following fields (one per line):

- MC files for each minor epoch
- Crab mscw results for each minor epoch
```text
* VERSION <eventdisplay_version> # e.g., V6
* SIMTYPE <simulation_type> # e.g., CARE, CARE_RedHV
* ATMOSPHERE <atmosphere_id> # e.g., 61, 62 (repeat line for multiple values)
* EPOCH <epoch_id> [nsb] # e.g., V6_2019_2020s 0
* CRAB_NSB <nsb_level> # e.g., 0, 1, or NOTSET
```

The leading `*` is part of the parameter-file syntax. To provide multiple atmospheres or epochs, repeat the corresponding line. If `CRAB_NSB` is `NOTSET`, the script reads the per-epoch NSB value from the optional 4th field of each `* EPOCH ...` line.

### Step 2: Execute Comparison

```console
cd release_tests/montecarlo/mc_data_comparison/
./compareDatawithMC.sh <path/to/run\ parameter\ file> SZE
```

This will:

1. Parse the run parameter file
2. Locate MC simulation files based on epoch and atmosphere
3. Find corresponding Crab observational data
4. Submit Condor jobs for each combination
5. Generate comparison plots as PDF files

### Step 3: Monitor Progress

- Condor jobs are submitted with resource requests: 4000MB RAM, 10GB disk
- Temporary symbolic links are created in: `{output_dir}/tmp/{uuid}/`
- **Note**: Temporary directories must be cleaned up manually after completion

## Output Structure

Results are written to:

```text
EventDisplay_Release_<version>/mc_data_comparison/<analysis_type><disp>/<simulation_type>/
├── <epoch>_ATM<atm>_<ELE>_<wobble>_<nsb>/
│ ├── mcdatacomparison.runparameter
│ ├── mcdatacomparison.root
│ ├── mcdatacomparison.log
│ └── *.pdf # Comparison plots
└── tmp/ # Temporary symlinks (manual cleanup required)
```

**important:**
first run linking of epochs from `../../sources/Crab/`: `./runlist_generator.sh V6`
(or for any other epoch)
## Special Cases

Output and plots are written as PDFs into the `../../../../EventDisplay_Release_<version>/mc_data_comparison/` directories
- **CARE_RedHV simulations**: Handled with modified BDT cut (BDT=0 instead of 1)
- **Summer vs Winter Atmosphere**: Automatically selected based on epoch suffix ('s' or 'w')
- **Wobble Mode**: Forces atmosphere 61 and 1.0° wobble offset
Loading
Loading