From 2fc3fe8b51c2863727b1f3968b75d8d0fff54663 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Mon, 1 Jun 2026 20:29:43 +0200 Subject: [PATCH 01/31] readme fix --- release_tests/sources/Crab/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_tests/sources/Crab/README.md b/release_tests/sources/Crab/README.md index 34f56af..b1c9330 100644 --- a/release_tests/sources/Crab/README.md +++ b/release_tests/sources/Crab/README.md @@ -43,7 +43,7 @@ for Combine files using pre-processed anasum files and run list generated in step before: ```bash -./anasum_yearly.sh +./anasum_from_runlists.sh ``` ## Plotting From cf58d59dbef8c7a3ddba73ced0cd7b3ec7ddaf9a Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Mon, 1 Jun 2026 20:35:32 +0200 Subject: [PATCH 02/31] add warning --- release_tests/montecarlo/irf_plotting/irf_plotting.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/release_tests/montecarlo/irf_plotting/irf_plotting.sh b/release_tests/montecarlo/irf_plotting/irf_plotting.sh index 02ddf03..7a41c35 100755 --- a/release_tests/montecarlo/irf_plotting/irf_plotting.sh +++ b/release_tests/montecarlo/irf_plotting/irf_plotting.sh @@ -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" From b1c5b95646eab53afe5b7173fae67a61df976131 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Tue, 2 Jun 2026 10:01:08 +0200 Subject: [PATCH 03/31] R__LOAD --- release_tests/utilities/parameters.C | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/release_tests/utilities/parameters.C b/release_tests/utilities/parameters.C index a6880a8..cf49eeb 100644 --- a/release_tests/utilities/parameters.C +++ b/release_tests/utilities/parameters.C @@ -17,8 +17,9 @@ * Helper for ROOT macros: load libVAnaSum from environment. * Search order: * 1) $VERITAS_VANASUM_LIBRARY - * 2) $EVNDISP/lib/libVAnaSum.so - * 3) ROOT library path via "libVAnaSum.so" + * 2) $EVNDISPSYS/lib/libVAnaSum.so + * 3) $EVNDISP/lib/libVAnaSum.so + * 4) ROOT library path via "libVAnaSum.so" */ bool loadVAnaSumLibrary() { @@ -35,6 +36,14 @@ bool loadVAnaSumLibrary() iLibPath = iEnvLib; } if( iLibPath.size() == 0 ) + { + const char* iEvndispSys = gSystem->Getenv( "EVNDISPSYS" ); + if( iEvndispSys ) + { + iLibPath = string( iEvndispSys ) + "/lib/libVAnaSum.so"; + } + } + if( iLibPath.size() == 0 ) { const char* iEvndisp = gSystem->Getenv( "EVNDISP" ); if( iEvndisp ) @@ -45,21 +54,26 @@ bool loadVAnaSumLibrary() if( iLibPath.size() > 0 && !gSystem->AccessPathName( iLibPath.c_str() ) ) { - if( gSystem->Load( iLibPath.c_str() ) >= 0 ) + // Use gROOT->ProcessLine to properly load the library and its dictionaries + string loadCmd = "R__LOAD_LIBRARY(" + iLibPath + ");"; + int result = gROOT->ProcessLine( loadCmd.c_str() ); + if( result >= 0 ) { iLibraryLoaded = true; return true; } } - if( gSystem->Load( "libVAnaSum.so" ) >= 0 ) + // Try with just the library name + int result = gROOT->ProcessLine( "R__LOAD_LIBRARY(libVAnaSum.so);" ); + if( result >= 0 ) { iLibraryLoaded = true; return true; } cout << "Error: unable to load libVAnaSum.so. " - << "Set VERITAS_VANASUM_LIBRARY or EVNDISP." << endl; + << "Set VERITAS_VANASUM_LIBRARY, EVNDISPSYS, or EVNDISP." << endl; return false; } From 9598b166938bb20395d055eff1e2f5b3bfaae5d7 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Tue, 2 Jun 2026 15:01:54 +0200 Subject: [PATCH 04/31] debugging --- release_tests/utilities/parameters.C | 36 ++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/release_tests/utilities/parameters.C b/release_tests/utilities/parameters.C index cf49eeb..af8db58 100644 --- a/release_tests/utilities/parameters.C +++ b/release_tests/utilities/parameters.C @@ -34,6 +34,7 @@ bool loadVAnaSumLibrary() if( iEnvLib ) { iLibPath = iEnvLib; + cout << "DEBUG: Found VERITAS_VANASUM_LIBRARY=" << iLibPath << endl; } if( iLibPath.size() == 0 ) { @@ -41,6 +42,7 @@ bool loadVAnaSumLibrary() if( iEvndispSys ) { iLibPath = string( iEvndispSys ) + "/lib/libVAnaSum.so"; + cout << "DEBUG: Using EVNDISPSYS, iLibPath=" << iLibPath << endl; } } if( iLibPath.size() == 0 ) @@ -49,26 +51,46 @@ bool loadVAnaSumLibrary() if( iEvndisp ) { iLibPath = string( iEvndisp ) + "/lib/libVAnaSum.so"; + cout << "DEBUG: Using EVNDISP, iLibPath=" << iLibPath << endl; } } - if( iLibPath.size() > 0 && !gSystem->AccessPathName( iLibPath.c_str() ) ) + if( iLibPath.size() > 0 ) { - // Use gROOT->ProcessLine to properly load the library and its dictionaries - string loadCmd = "R__LOAD_LIBRARY(" + iLibPath + ");"; - int result = gROOT->ProcessLine( loadCmd.c_str() ); - if( result >= 0 ) + cout << "DEBUG: Checking if library exists: " << iLibPath << endl; + if( !gSystem->AccessPathName( iLibPath.c_str() ) ) { - iLibraryLoaded = true; - return true; + cout << "DEBUG: Library file exists, attempting to load with R__LOAD_LIBRARY" << endl; + // Use gROOT->ProcessLine to properly load the library and its dictionaries + string loadCmd = "R__LOAD_LIBRARY(" + iLibPath + ");"; + cout << "DEBUG: Executing: " << loadCmd << endl; + int result = gROOT->ProcessLine( loadCmd.c_str() ); + cout << "DEBUG: ProcessLine result: " << result << endl; + if( result >= 0 ) + { + iLibraryLoaded = true; + cout << "DEBUG: Successfully loaded library from " << iLibPath << endl; + return true; + } } + else + { + cout << "DEBUG: Library file does NOT exist: " << iLibPath << endl; + } + } + else + { + cout << "DEBUG: No library path determined from environment variables" << endl; } // Try with just the library name + cout << "DEBUG: Trying to load libVAnaSum.so from ROOT library path" << endl; int result = gROOT->ProcessLine( "R__LOAD_LIBRARY(libVAnaSum.so);" ); + cout << "DEBUG: ProcessLine result for libVAnaSum.so: " << result << endl; if( result >= 0 ) { iLibraryLoaded = true; + cout << "DEBUG: Successfully loaded libVAnaSum.so from ROOT library path" << endl; return true; } From 18f3b486223805bf4f764e1d46a66ea585ec0ecd Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Tue, 2 Jun 2026 15:25:13 +0200 Subject: [PATCH 05/31] library path --- .../sources/Crab/plot_energy_spectra.C | 4 +++ release_tests/utilities/parameters.C | 36 ++++--------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/release_tests/sources/Crab/plot_energy_spectra.C b/release_tests/sources/Crab/plot_energy_spectra.C index 3fc3e6d..8ab721c 100644 --- a/release_tests/sources/Crab/plot_energy_spectra.C +++ b/release_tests/sources/Crab/plot_energy_spectra.C @@ -14,6 +14,10 @@ #include "TF1.h" +// Load VAnaSum library - must be before any usage of VEnergySpectrum +// ROOT expands environment variables in R__LOAD_LIBRARY paths +R__LOAD_LIBRARY($EVNDISPSYS/lib/libVAnaSum.so) + #include "../../utilities/parameters.C" #include "../../utilities/printutilities.C" diff --git a/release_tests/utilities/parameters.C b/release_tests/utilities/parameters.C index af8db58..cf49eeb 100644 --- a/release_tests/utilities/parameters.C +++ b/release_tests/utilities/parameters.C @@ -34,7 +34,6 @@ bool loadVAnaSumLibrary() if( iEnvLib ) { iLibPath = iEnvLib; - cout << "DEBUG: Found VERITAS_VANASUM_LIBRARY=" << iLibPath << endl; } if( iLibPath.size() == 0 ) { @@ -42,7 +41,6 @@ bool loadVAnaSumLibrary() if( iEvndispSys ) { iLibPath = string( iEvndispSys ) + "/lib/libVAnaSum.so"; - cout << "DEBUG: Using EVNDISPSYS, iLibPath=" << iLibPath << endl; } } if( iLibPath.size() == 0 ) @@ -51,46 +49,26 @@ bool loadVAnaSumLibrary() if( iEvndisp ) { iLibPath = string( iEvndisp ) + "/lib/libVAnaSum.so"; - cout << "DEBUG: Using EVNDISP, iLibPath=" << iLibPath << endl; } } - if( iLibPath.size() > 0 ) + if( iLibPath.size() > 0 && !gSystem->AccessPathName( iLibPath.c_str() ) ) { - cout << "DEBUG: Checking if library exists: " << iLibPath << endl; - if( !gSystem->AccessPathName( iLibPath.c_str() ) ) + // Use gROOT->ProcessLine to properly load the library and its dictionaries + string loadCmd = "R__LOAD_LIBRARY(" + iLibPath + ");"; + int result = gROOT->ProcessLine( loadCmd.c_str() ); + if( result >= 0 ) { - cout << "DEBUG: Library file exists, attempting to load with R__LOAD_LIBRARY" << endl; - // Use gROOT->ProcessLine to properly load the library and its dictionaries - string loadCmd = "R__LOAD_LIBRARY(" + iLibPath + ");"; - cout << "DEBUG: Executing: " << loadCmd << endl; - int result = gROOT->ProcessLine( loadCmd.c_str() ); - cout << "DEBUG: ProcessLine result: " << result << endl; - if( result >= 0 ) - { - iLibraryLoaded = true; - cout << "DEBUG: Successfully loaded library from " << iLibPath << endl; - return true; - } + iLibraryLoaded = true; + return true; } - else - { - cout << "DEBUG: Library file does NOT exist: " << iLibPath << endl; - } - } - else - { - cout << "DEBUG: No library path determined from environment variables" << endl; } // Try with just the library name - cout << "DEBUG: Trying to load libVAnaSum.so from ROOT library path" << endl; int result = gROOT->ProcessLine( "R__LOAD_LIBRARY(libVAnaSum.so);" ); - cout << "DEBUG: ProcessLine result for libVAnaSum.so: " << result << endl; if( result >= 0 ) { iLibraryLoaded = true; - cout << "DEBUG: Successfully loaded libVAnaSum.so from ROOT library path" << endl; return true; } From e576709dccfd68a329cff5f26c2b4caf67d8a074 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Tue, 2 Jun 2026 15:39:49 +0200 Subject: [PATCH 06/31] setting of library path --- release_tests/sources/Crab/plot_energy_spectra.C | 2 -- release_tests/sources/Crab/plot_lightcurves.C | 2 ++ release_tests/sources/Crab/plot_sensitivity.C | 1 + release_tests/sources/Crab/plot_skymaps.C | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/release_tests/sources/Crab/plot_energy_spectra.C b/release_tests/sources/Crab/plot_energy_spectra.C index 8ab721c..882d484 100644 --- a/release_tests/sources/Crab/plot_energy_spectra.C +++ b/release_tests/sources/Crab/plot_energy_spectra.C @@ -14,8 +14,6 @@ #include "TF1.h" -// Load VAnaSum library - must be before any usage of VEnergySpectrum -// ROOT expands environment variables in R__LOAD_LIBRARY paths R__LOAD_LIBRARY($EVNDISPSYS/lib/libVAnaSum.so) #include "../../utilities/parameters.C" diff --git a/release_tests/sources/Crab/plot_lightcurves.C b/release_tests/sources/Crab/plot_lightcurves.C index 458f068..5b341a7 100644 --- a/release_tests/sources/Crab/plot_lightcurves.C +++ b/release_tests/sources/Crab/plot_lightcurves.C @@ -13,6 +13,8 @@ #include #include +R__LOAD_LIBRARY($EVNDISPSYS/lib/libVAnaSum.so) + #include "../../utilities/parameters.C" #include "../../utilities/printutilities.C" diff --git a/release_tests/sources/Crab/plot_sensitivity.C b/release_tests/sources/Crab/plot_sensitivity.C index b8c4fd8..84de9dd 100644 --- a/release_tests/sources/Crab/plot_sensitivity.C +++ b/release_tests/sources/Crab/plot_sensitivity.C @@ -4,6 +4,7 @@ */ #include +R__LOAD_LIBRARY($EVNDISPSYS/lib/libVAnaSum.so) #include "../../utilities/parameters.C" #include "../../utilities/printutilities.C" diff --git a/release_tests/sources/Crab/plot_skymaps.C b/release_tests/sources/Crab/plot_skymaps.C index 98d905a..5c8fda3 100644 --- a/release_tests/sources/Crab/plot_skymaps.C +++ b/release_tests/sources/Crab/plot_skymaps.C @@ -11,6 +11,8 @@ #include #include +R__LOAD_LIBRARY($EVNDISPSYS/lib/libVAnaSum.so) + #include "../../utilities/parameters.C" #include "../../utilities/printutilities.C" From c89dd6c47dea47cc3354dd36974fa7a954d48514 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 4 Jun 2026 15:00:41 +0200 Subject: [PATCH 07/31] Add plotting of sensitivtiy from log files --- .../Crab/plot_sensitivity_from_anasum_log.py | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 release_tests/sources/Crab/plot_sensitivity_from_anasum_log.py diff --git a/release_tests/sources/Crab/plot_sensitivity_from_anasum_log.py b/release_tests/sources/Crab/plot_sensitivity_from_anasum_log.py new file mode 100644 index 0000000..772eddd --- /dev/null +++ b/release_tests/sources/Crab/plot_sensitivity_from_anasum_log.py @@ -0,0 +1,184 @@ +"""Plot sensitivity diagnostics from anasum log files. + +Reads anasum log files from an input directory and writes a PNG summary figure. + +Usage: python plot_sensitivity_from_anasum_log.py [input_dir] [output_png] +""" + +import argparse +import glob +import os +import re + +import matplotlib.pyplot as plt +import numpy as np + +# Parse input directory argument +parser = argparse.ArgumentParser(description="Plot sensitivity metrics from anasum log files.") +parser.add_argument( + "input_dir", + nargs="?", + default=".", + help="Directory containing anasum log files (default: current directory)", +) +parser.add_argument( + "output_png", + nargs="?", + default="anasum_analysis_plots.png", + help="Output PNG filename (default: anasum_analysis_plots.png)", +) +args = parser.parse_args() + +if not os.path.isdir(args.input_dir): + raise SystemExit(f"Input directory does not exist: {args.input_dir}") + +log_files = sorted(glob.glob(os.path.join(args.input_dir, "*anasum*.log"))) + +if not log_files: + raise SystemExit(f"No anasum log files found in: {args.input_dir}") + +epochs = [] +on_off_summary_rates = [] +off_summary_rates = [] +crab_001_times = [] +all_elevations = [] +all_on_rates = [] +all_off_rates = [] + +for filepath in log_files: + with open(filepath, "r") as f: + content = f.read() + + # Extract epoch from filename (e.g., V6_2023_2023s_ATM62 or V6_2014_2015_ATM61) + basename = os.path.basename(filepath) + epoch_match = re.search(r"(V6_[^_]+_\d+[a-z]*)_ATM\d+", basename) + if not epoch_match: + # Try alternative pattern for ATM61 files + epoch_match = re.search( + r"(V6_[^_]+_\d+[a-z]*)_ATM\d+", basename.replace("_SZE_0.5deg.combined", "") + ) + if not epoch_match: + continue + epoch = epoch_match.group(1) + + # Extract summary on/off rates + rate_match = re.search(r"Rates \(on/Off\): (\d+\.\d+)\s+(\d+\.\d+)", content) + + # Extract 0.01 Crab time in hours from the sensitivity table + lines = content.split("\n") + crab_time = None + in_table = False + for line in lines: + if "[h]" in line: + in_table = True + continue + if in_table and line.strip().startswith("0.01"): + parts = line.split() + if len(parts) >= 3: + try: + crab_time = float(parts[-1]) + except ValueError: + pass + break + + # Extract all elevation and rate values from RUN lines + el_values = [] + on_rates = [] + off_rates = [] + for line in lines: + el_match = re.search(r"RUN\s+\d+.*at\s+(\d+),\s+(-?\d+)\s+deg\s+El\.,\s+Az", line) + rate_match_line = re.search(r"Rates:\s+([\d.]+).*background:\s+([\d.]+)", line) + if el_match: + el_values.append(int(el_match.group(1))) + if rate_match_line: + on_rates.append(float(rate_match_line.group(1))) + off_rates.append(float(rate_match_line.group(2))) + + # Only add data if we have all values and non-empty arrays + if rate_match and crab_time is not None and el_values and on_rates and off_rates: + epochs.append(epoch) + on_off_summary_rates.append(float(rate_match.group(1))) + off_summary_rates.append(float(rate_match.group(2))) + crab_001_times.append(crab_time) + all_elevations.append(np.array(el_values)) + all_on_rates.append(np.array(on_rates)) + all_off_rates.append(np.array(off_rates)) + +# Calculate average elevation per epoch for sensitivity plot +avg_elevations = [np.mean(el) for el in all_elevations] + +# Create plots - 4 rows: 2x2 + 2 extra +fig, axs = plt.subplots(4, 2, figsize=(14, 20)) + +# Plot 1: On Rate vs Epoch +axs[0, 0].plot(epochs, on_off_summary_rates, "o-", color="blue") +axs[0, 0].set_xlabel("Epoch") +axs[0, 0].set_ylabel("On Rate") +axs[0, 0].set_title("On Rate vs Epoch") +axs[0, 0].tick_params(axis="x", rotation=45) + +# Plot 2: Off Rate vs Epoch +axs[0, 1].plot(epochs, off_summary_rates, "s-", color="orange") +axs[0, 1].set_xlabel("Epoch") +axs[0, 1].set_ylabel("Off Rate") +axs[0, 1].set_title("Off Rate vs Epoch") +axs[0, 1].tick_params(axis="x", rotation=45) + +# Plot 3: Violin plot of Elevations per Epoch +axs[1, 0].violinplot(all_elevations, positions=range(len(epochs)), widths=0.8, showmeans=True) +axs[1, 0].set_xticks(range(len(epochs))) +axs[1, 0].set_xticklabels(epochs, rotation=45, ha="right") +axs[1, 0].set_xlabel("Epoch") +axs[1, 0].set_ylabel("Elevation [deg]") +axs[1, 0].set_title("Elevation Distribution per Epoch") + +# Plot 4: Violin plot of On Rates per Epoch +axs[1, 1].violinplot(all_on_rates, positions=range(len(epochs)), widths=0.8, showmeans=True) +axs[1, 1].set_xticks(range(len(epochs))) +axs[1, 1].set_xticklabels(epochs, rotation=45, ha="right") +axs[1, 1].set_xlabel("Epoch") +axs[1, 1].set_ylabel("On Rate") +axs[1, 1].set_title("On Rate Distribution per Epoch") + +# Plot 5: Violin plot of Off Rates per Epoch +axs[2, 0].violinplot(all_off_rates, positions=range(len(epochs)), widths=0.8, showmeans=True) +axs[2, 0].set_xticks(range(len(epochs))) +axs[2, 0].set_xticklabels(epochs, rotation=45, ha="right") +axs[2, 0].set_xlabel("Epoch") +axs[2, 0].set_ylabel("Off Rate") +axs[2, 0].set_title("Off Rate Distribution per Epoch") + +# Plot 6: 0.01 Crab Sensitivity Time vs Epoch +axs[2, 1].plot(epochs, crab_001_times, "s-", color="purple") +axs[2, 1].set_xlabel("Epoch") +axs[2, 1].set_ylabel("0.01 Crab Time [h]") +axs[2, 1].set_title("0.01 Crab Sensitivity Time vs Epoch") +axs[2, 1].tick_params(axis="x", rotation=45) + +# Plot 7: Sensitivity vs Average Elevation +# Color points red if epoch year >= 2020 +colors = [ + ( + "red" + if "2020" in epoch + or "2021" in epoch + or "2022" in epoch + or "2023" in epoch + or "2024" in epoch + or "2025" in epoch + or "2026" in epoch + else "blue" + ) + for epoch in epochs +] +axs[3, 0].scatter(avg_elevations, crab_001_times, c=colors, alpha=0.7) +axs[3, 0].set_xlabel("Average Elevation [deg]") +axs[3, 0].set_ylabel("0.01 Crab Time [h]") +axs[3, 0].set_title("Sensitivity vs Elevation") + +# Hide the empty subplot +axs[3, 1].axis("off") + +plt.tight_layout() +plt.savefig(args.output_png, dpi=300, bbox_inches="tight") +print(f"Processed {len(epochs)} files. Plots saved as {args.output_png}") From fa8b930d8c2b215d5f190e966cadc8dcc77cd8fc Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 4 Jun 2026 20:36:32 +0200 Subject: [PATCH 08/31] skip 3-tel runs --- environment.yml | 4 ++++ release_tests/sources/Crab/plot_all.sh | 2 -- .../sources/Crab/runlist_generator_from_anasum_log.sh | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 161c0e2..8cf2fae 100644 --- a/environment.yml +++ b/environment.yml @@ -2,6 +2,9 @@ name: eventdisplay-release-tests channels: - conda-forge dependencies: + - python>=3.8 + - numpy + - matplotlib - pandoc - pre-commit - towncrier @@ -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 diff --git a/release_tests/sources/Crab/plot_all.sh b/release_tests/sources/Crab/plot_all.sh index 5486d36..8564882 100755 --- a/release_tests/sources/Crab/plot_all.sh +++ b/release_tests/sources/Crab/plot_all.sh @@ -19,8 +19,6 @@ ODIR="${2}/$CUT" echo "Output directory: $ODIR" mkdir -p "$ODIR" -PDIR=$(pwd) - # copy anasum log files to release test directory for F in $LFIL; do TF=$(basename $F .combined.root) diff --git a/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh b/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh index 913b3b1..033392d 100755 --- a/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh +++ b/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh @@ -99,6 +99,11 @@ do echo "Run $R - log file not found: ${ANASUMLOG}" exit fi + # Skip runs without 4-telescope cuts + if ! grep -q "VGammaHadronCuts::printCutSummary() (ntel=4" "${ANASUMLOG}"; then + echo "RUN $R not a 4-telescope run..skipping" + continue + fi echo "DATADIR ${ANASUMLOG}" # read and extract run info from files INSTRUMENT_EPOCH=$(grep "Instrument epoch selected" "${ANASUMLOG}" | head -n 1 | awk '{print $NF}') From 24b09ae1282608da7c8b06fc7b2c9b4f97b6d3a9 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Thu, 4 Jun 2026 19:24:14 +0200 Subject: [PATCH 09/31] kaputt runs --- release_tests/sources/Crab/runlist_releaseTestingV6.dat | 2 -- 1 file changed, 2 deletions(-) diff --git a/release_tests/sources/Crab/runlist_releaseTestingV6.dat b/release_tests/sources/Crab/runlist_releaseTestingV6.dat index da6d0e3..e5d6a73 100644 --- a/release_tests/sources/Crab/runlist_releaseTestingV6.dat +++ b/release_tests/sources/Crab/runlist_releaseTestingV6.dat @@ -814,7 +814,6 @@ 104174 104199 104201 -104202 104251 104252 104253 @@ -992,7 +991,6 @@ 113299 113303 113352 -113375 113515 113637 113689 From da66aebfe8bc0a4df8c2db63ccfc2bb722e22205 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 5 Jun 2026 13:43:20 +0200 Subject: [PATCH 10/31] new elevation steps --- release_tests/sources/Crab/runlist_generator_from_anasum_log.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh b/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh index 033392d..7783734 100755 --- a/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh +++ b/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh @@ -122,7 +122,7 @@ do OBSL="stdHV" fi ELEV=$(grep "mean elevation" "${ANASUMLOG}" | head -n 1 | awk '{print $3}') - EL=$(echo $ELEV | awk -v e=$ELEV '{if (e > 50 ) {print "SZE"} else if (e > 40 ) {print "MZE"} else if (e > 30 ) {print "LZE"} else {print "BZE"}}') + EL=$(echo $ELEV | awk -v e=$ELEV '{if (e > 60 ) {print "SZE"} else if (e > 45 ) {print "MZE"} else if (e > 35 ) {print "LZE"} else {print "BZE"}}') WOBBLESTRING=$(grep "Wobble offsets (currE)" "${ANASUMLOG}") n_offset=$(echo "$WOBBLESTRING" | head -n 1 | awk '{print $5}') w_offset=$(echo "$WOBBLESTRING" | head -n 1 | awk '{print $7}') From 193f267e40220b3ee53c0d3550059a4e2e22d25a Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Sat, 6 Jun 2026 09:35:20 +0200 Subject: [PATCH 11/31] clarify usage --- .gitignore | 1 + release_tests/montecarlo/mc_data_comparison/.gitignore | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 release_tests/montecarlo/mc_data_comparison/.gitignore diff --git a/.gitignore b/.gitignore index e43b0f9..74d54ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +tmpdir diff --git a/release_tests/montecarlo/mc_data_comparison/.gitignore b/release_tests/montecarlo/mc_data_comparison/.gitignore deleted file mode 100644 index 15c6bf7..0000000 --- a/release_tests/montecarlo/mc_data_comparison/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tmpdir From eefe21af841d1b3e05b03b08da1901ad96d21404 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Sat, 6 Jun 2026 09:38:33 +0200 Subject: [PATCH 12/31] script consistency --- .../montecarlo/mc_data_comparison/README.md | 97 ++++++++++++++++--- .../mc_data_comparison/compareDatawithMC.sh | 19 ++-- .../Crab/plot_sensitivity_from_anasum_log.py | 5 +- 3 files changed, 97 insertions(+), 24 deletions(-) diff --git a/release_tests/montecarlo/mc_data_comparison/README.md b/release_tests/montecarlo/mc_data_comparison/README.md index a89720b..d971b5e 100644 --- a/release_tests/montecarlo/mc_data_comparison/README.md +++ b/release_tests/montecarlo/mc_data_comparison/README.md @@ -1,20 +1,95 @@ -# MC / data comparison +# MC / Data Comparison -Scripts and tools to compare MC distributions with results from the Crab Nebula. +Scripts and tools to compare Monte Carlo (MC) distributions with observational results from the Crab Nebula. -Fill and plot distributions with +## Quick Start ```console -./compareDatawithMC.sh +./compareDatawithMC.sh ``` -Requires as input: +Where `` specifies the observation conditions: -- MC files for each minor epoch -- Crab mscw results for each minor epoch +- `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) -**important:** -first run linking of epochs from `../../sources/Crab/`: `./runlist_generator.sh V6` -(or for any other epoch) +NOTE! The zenith angle bins are different compared to those used in the Crab Nebula analysis. -Output and plots are written as PDFs into the `../../../../EventDisplay_Release_/mc_data_comparison/` directories +## Prerequisites + +### Input Data Requirements + +- MC simulation files for each minor epoch (organized by atmosphere type) +- Crab Nebula mscw results for each minor epoch +- 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 +``` + +This generates run lists for minor epochs, zenith angle ranges, and atmosphere types. +The run lists are saved in `EventDisplay_Release_/Crab/runlists/`. + +## Running the Comparison + +### Step 1: Prepare Run Parameter File + +The `` must contain the following fields (one per line): + +```text +* VERSION # e.g., V6 +* SIMTYPE # e.g., CARE, CARE_RedHV +* ATMOSPHERE # e.g., 61*, 62* +* EPOCH # e.g., V4*, V5*, V6* +* CRAB_NSB # e.g., 0, 1, or NOTSET +``` + +Fields marked with `*` support wildcards for multiple values. + +### Step 2: Execute Comparison + +```console +cd release_tests/montecarlo/mc_data_comparison/ +./compareDatawithMC.sh 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_/mc_data_comparison/// +├── _ATM___/ +│ ├── mcdatacomparison.runparameter +│ ├── mcdatacomparison.root +│ ├── mcdatacomparison.log +│ └── *.pdf # Comparison plots +└── tmp/ # Temporary symlinks (manual cleanup required) +``` + +## Special Cases + +- **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 (summer) and 1.0° wobble offset diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh index 440978b..0a58bca 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh @@ -4,13 +4,13 @@ # # requires: # - MC files for each minor epoch -# - Crab results for each minor epoch (read from Crab runlists; used pre-processed data) +# - Crab results for each minor epoch (read from Crab run lists; used pre-processed data) set -e if [[ $# < 2 ]]; then echo " - ./compareDatawithMC.sh + ./compareDatawithMC.sh --> choose zenith angle / wobble range SZE: small zenith angles (0.5 deg wobble) MZE: medium large zenith angles (0.5 deg wobble) @@ -23,9 +23,9 @@ exit fi ########################### -# read runparameter file +# read run parameter file if [[ ! -e ${1} ]]; then - echo "Error, runparameter file not found: ${1}" + echo "Error, run parameter file not found: ${1}" exit fi # Eventdisplay version @@ -58,10 +58,8 @@ fi # Directory for simulations SIMDIR=${VERITAS_IRFPRODUCTION_DIR}/${VERSION}/${ANALYSISTYPE}/$SIMTYPE/ if [[ ! -e ${SIMDIR} ]]; then - if [[ ! -e ${SIMDIR} ]]; then - echo "Error: simulation directory not found: $SIMDIR" - exit - fi + echo "Error: simulation directory not found: $SIMDIR" + exit fi # Directory for mscw data files DDIR="$VERITAS_PREPROCESSED_DATA_DIR/${ANALYSISTYPE}/mscw/" @@ -123,7 +121,7 @@ do ZEMAX="50." elif [[ $ELE = "LZE" ]] then - ZEMIN="50" + ZEMIN="50." ZEMAX="70." simfile="55deg_${MCWOFF}wob_NOISE${NSB}.mscw.root" # wobble set (everything not 0.5 deg) @@ -216,8 +214,5 @@ do $EVNDISPSCRIPTS/helper_scripts/UTILITY.condorSubmission.sh ${FSCRIPT}.sh 4000M 10G condor_submit ${FSCRIPT}.sh.condor - continue - - done done diff --git a/release_tests/sources/Crab/plot_sensitivity_from_anasum_log.py b/release_tests/sources/Crab/plot_sensitivity_from_anasum_log.py index 772eddd..1409d6a 100644 --- a/release_tests/sources/Crab/plot_sensitivity_from_anasum_log.py +++ b/release_tests/sources/Crab/plot_sensitivity_from_anasum_log.py @@ -32,7 +32,9 @@ if not os.path.isdir(args.input_dir): raise SystemExit(f"Input directory does not exist: {args.input_dir}") -log_files = sorted(glob.glob(os.path.join(args.input_dir, "*anasum*.log"))) +log_files = sorted( + glob.glob(os.path.join(args.input_dir, "*anasum*V6_20*ATM*SZE_0.5deg.combined.log")) +) if not log_files: raise SystemExit(f"No anasum log files found in: {args.input_dir}") @@ -46,6 +48,7 @@ all_off_rates = [] for filepath in log_files: + print(f"Processing file: {filepath}") with open(filepath, "r") as f: content = f.read() From 99d2c94d23b66de803fbfc2444f44b01eb4c594f Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sat, 6 Jun 2026 09:47:39 +0200 Subject: [PATCH 13/31] apptainer note --- release_tests/montecarlo/mc_data_comparison/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release_tests/montecarlo/mc_data_comparison/README.md b/release_tests/montecarlo/mc_data_comparison/README.md index d971b5e..6a61489 100644 --- a/release_tests/montecarlo/mc_data_comparison/README.md +++ b/release_tests/montecarlo/mc_data_comparison/README.md @@ -1,5 +1,7 @@ # MC / Data Comparison +**No apptainer usage!** + Scripts and tools to compare Monte Carlo (MC) distributions with observational results from the Crab Nebula. ## Quick Start From 470c1fc9905cbb475d85b3e242c45bda94e8fa97 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Sun, 12 Jul 2026 17:32:52 +0200 Subject: [PATCH 14/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- release_tests/utilities/parameters.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_tests/utilities/parameters.C b/release_tests/utilities/parameters.C index cf49eeb..348cae0 100644 --- a/release_tests/utilities/parameters.C +++ b/release_tests/utilities/parameters.C @@ -56,7 +56,7 @@ bool loadVAnaSumLibrary() { // Use gROOT->ProcessLine to properly load the library and its dictionaries string loadCmd = "R__LOAD_LIBRARY(" + iLibPath + ");"; - int result = gROOT->ProcessLine( loadCmd.c_str() ); + Longptr_t result = gROOT->ProcessLine( loadCmd.c_str() ); if( result >= 0 ) { iLibraryLoaded = true; From 4c1e6a8d9f073856b43963ad8c4ba85be83378e9 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Sun, 12 Jul 2026 17:33:04 +0200 Subject: [PATCH 15/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- release_tests/utilities/parameters.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_tests/utilities/parameters.C b/release_tests/utilities/parameters.C index 348cae0..5b2f35d 100644 --- a/release_tests/utilities/parameters.C +++ b/release_tests/utilities/parameters.C @@ -65,7 +65,7 @@ bool loadVAnaSumLibrary() } // Try with just the library name - int result = gROOT->ProcessLine( "R__LOAD_LIBRARY(libVAnaSum.so);" ); + Longptr_t result = gROOT->ProcessLine( "R__LOAD_LIBRARY(libVAnaSum.so);" ); if( result >= 0 ) { iLibraryLoaded = true; From d7dd1ff784012e03f5a115749e5134409895af18 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Sun, 12 Jul 2026 17:33:20 +0200 Subject: [PATCH 16/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- release_tests/sources/Crab/runlist_generator_from_anasum_log.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh b/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh index 7783734..95470a8 100755 --- a/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh +++ b/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh @@ -101,7 +101,7 @@ do fi # Skip runs without 4-telescope cuts if ! grep -q "VGammaHadronCuts::printCutSummary() (ntel=4" "${ANASUMLOG}"; then - echo "RUN $R not a 4-telescope run..skipping" + echo "Run $R is not a 4-telescope run; skipping" continue fi echo "DATADIR ${ANASUMLOG}" From 4bc64c8cc485d3a38d151a21f867bf1815d16cb0 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sat, 6 Jun 2026 10:18:30 +0200 Subject: [PATCH 17/31] fix directory setting --- .../montecarlo/mc_data_comparison/compareDatawithMC.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh index 0a58bca..dc06531 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh @@ -76,8 +76,9 @@ if [[ ! -e ${CDIR} ]]; then fi # output directory for MC/Data comparison -BDIR=$(readlink -f "../../../../EventDisplay_Release_${VERSION}/mc_data_comparison/${ANALYSISTYPE}${DIRRECOTYPE}/${SIMTYPE}/") +BDIR="../../../../EventDisplay_Release_${VERSION}/mc_data_comparison/${ANALYSISTYPE}${DIRRECOTYPE}/${SIMTYPE}/" mkdir -p ${BDIR} +BDIR=$(readlink -f "../../../../EventDisplay_Release_${VERSION}/mc_data_comparison/${ANALYSISTYPE}${DIRRECOTYPE}/${SIMTYPE}/") echo "Results will be written to $BDIR" PWDIR=$(pwd) From 36a9f4e793f4c45a68fd8e707ad82612bdc5c155 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 16 Jul 2026 10:19:23 +0200 Subject: [PATCH 18/31] script improvements; XGB --- .../montecarlo/mc_data_comparison/README.md | 8 +- .../mc_data_comparison/compareDatawithMC.sh | 80 +++++++++++++------ .../compareDatawithMC_qsub.sh | 3 +- 3 files changed, 62 insertions(+), 29 deletions(-) diff --git a/release_tests/montecarlo/mc_data_comparison/README.md b/release_tests/montecarlo/mc_data_comparison/README.md index 6a61489..5596bb7 100644 --- a/release_tests/montecarlo/mc_data_comparison/README.md +++ b/release_tests/montecarlo/mc_data_comparison/README.md @@ -48,12 +48,12 @@ The `` must contain the following fields (one per line): ```text * VERSION # e.g., V6 * SIMTYPE # e.g., CARE, CARE_RedHV -* ATMOSPHERE # e.g., 61*, 62* -* EPOCH # e.g., V4*, V5*, V6* +* ATMOSPHERE # e.g., 61, 62 (repeat line for multiple values) +* EPOCH [nsb] # e.g., V6_2019_2020s 0 * CRAB_NSB # e.g., 0, 1, or NOTSET ``` -Fields marked with `*` support wildcards for multiple values. +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 @@ -94,4 +94,4 @@ EventDisplay_Release_/mc_data_comparison// $ODIR/mcdatacomparison.runparameter + if [[ $SIMTYPE == "CARE_RedHV"* ]]; then + SIMATM="61" + echo "* SIMS $SIMDIR/${I}_ATM${SIMATM}_gamma/${SIMMSCW}/${simfile} 4 ${MCWOFF} 0. 0. 0. ${ZEMIN} ${ZEMAX}" > $ODIR/mcdatacomparison.runparameter else - if [[ $ELE == "WOBBLE" ]] && [[ ${I: -1} == "s" ]]; then - echo "* SIMS $SIMDIR/${I}_ATM62_gamma/${SIMMSCW}/${simfile} 4 ${MCWOFF} 0. 0. 0. ${ZEMIN} ${ZEMAX}" > $ODIR/mcdatacomparison.runparameter - else - echo "* SIMS $SIMDIR/${I}_ATM${atm}_gamma/${SIMMSCW}/${simfile} 4 ${MCWOFF} 0. 0. 0. ${ZEMIN} ${ZEMAX}" > $ODIR/mcdatacomparison.runparameter - fi + echo "* SIMS $SIMDIR/${I}_ATM${SIMATM}_gamma/${SIMMSCW}/${simfile} 4 ${MCWOFF} 0. 0. 0. ${ZEMIN} ${ZEMAX}" > $ODIR/mcdatacomparison.runparameter fi echo "* ON ${DMSCWDIR}/[0-9]*.mscw.root 4 -99. -99. 0. 360. ${ZEMIN} ${ZEMAX}" >> $ODIR/mcdatacomparison.runparameter echo "* OFF ${DMSCWDIR}/[0-9]*.mscw.root 4 -99. -99. 0. 360. ${ZEMIN} ${ZEMAX}" >> $ODIR/mcdatacomparison.runparameter @@ -206,8 +237,9 @@ do FSCRIPT="$DMSCWDIR/compareDatawithMC_qsub_${SIMTYPE}_${I}${A}_${ELE}_${MCWOFF}_${NSB}" rm -f ${FSCRIPT}.sh sed -e "s|OUTDIR|$ODIR|" \ - -e "s|EEPOCHTM|${I}_ATM${atm}|" \ - -e "s|CURRENTDIR|$PWDIR|" compareDatawithMC_qsub.sh > ${FSCRIPT}.sh + -e "s|EEPOCHTM|${I}_ATM${SIMATM}|" \ + -e "s|CURRENTDIR|$PWDIR|" \ + -e "s|METHODRECO|$RECOMETHOD|" compareDatawithMC_qsub.sh > ${FSCRIPT}.sh echo "Run script: $FSCRIPT" chmod u+x $FSCRIPT.sh diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh index 080398f..59455dc 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh @@ -7,6 +7,7 @@ source $EVNDISPSYS/setObservatory.sh VTS ODIR=OUTDIR CDIR=CURRENTDIR EPOCHATM=EEPOCHTM +RECOMETHOD=METHODRECO BDT="1" if [[ ${ODIR} == *"CARE_RedHV"* ]]; then @@ -20,7 +21,7 @@ $EVNDISPSYS/bin/compareDatawithMC \ $ODIR/mcdatacomparison.runparameter \ -3 \ $ODIR/mcdatacomparison.root \ - ${BDT} $EPOCHATM \ + ${BDT} $EPOCHATM $RECOMETHOD \ > $ODIR/mcdatacomparison.log # prepare all plots From bdcdfb179c3c293cfa4305b4d4390488e30a60e6 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Thu, 16 Jul 2026 10:32:20 +0200 Subject: [PATCH 19/31] linking --- .../montecarlo/mc_data_comparison/compareDatawithMC.sh | 8 ++++++-- .../mc_data_comparison/compareDatawithMC_qsub.sh | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh index 5d6edb6..ecaee8f 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh @@ -55,6 +55,10 @@ fi # Stereo reconstruction method # (0: dispBDT, 2: XGB) RECOMETHOD=0 +STEREOMETHOD="" +if [[ $RECOMETHOD == 2 ]]; then + STEREOMETHOD="_XGB" +fi ########################### # elevation range @@ -88,9 +92,9 @@ if [[ ! -e ${CDIR} ]]; then fi # output directory for MC/Data comparison -BDIR="../../../../EventDisplay_Release_${VERSION}/mc_data_comparison/${ANALYSISTYPE}${DIRRECOTYPE}/${SIMTYPE}/" +BDIR="../../../../EventDisplay_Release_${VERSION}/mc_data_comparison/${ANALYSISTYPE}${DIRRECOTYPE}${STEREOMETHOD}/${SIMTYPE}/" mkdir -p ${BDIR} -BDIR=$(readlink -f "../../../../EventDisplay_Release_${VERSION}/mc_data_comparison/${ANALYSISTYPE}${DIRRECOTYPE}/${SIMTYPE}/") +BDIR=$(readlink -f "../../../../EventDisplay_Release_${VERSION}/mc_data_comparison/${ANALYSISTYPE}${DIRRECOTYPE}${STEREOMETHOD}/${SIMTYPE}/") echo "Results will be written to $BDIR" PWDIR=$(pwd) diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh index 59455dc..ad1b0f0 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh @@ -9,7 +9,7 @@ CDIR=CURRENTDIR EPOCHATM=EEPOCHTM RECOMETHOD=METHODRECO -BDT="1" +BDT="0" if [[ ${ODIR} == *"CARE_RedHV"* ]]; then BDT="0" fi From 10ebba1dca03f4a2d46e4314f61677999acc464f Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 16 Jul 2026 10:34:00 +0200 Subject: [PATCH 20/31] xgb linking --- .../montecarlo/mc_data_comparison/compareDatawithMC.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh index ecaee8f..7335918 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh @@ -216,6 +216,14 @@ do exit 1 fi ln -s -f "${MSCWFILE}" "$DMSCWDIR"/"$D".mscw.root + if [[ ${RECOMETHOD} -eq 2 ]]; then + XGBFILE="${MSCWFILE%.mscw.root}.mscw.xgb_stereo.root" + if [[ ! -e "${XGBFILE}" ]]; then + echo "Error: XGB stereo file not found for run ${D}: ${XGBFILE}" + exit 1 + fi + ln -s -f "${XGBFILE}" "$DMSCWDIR"/"$D".mscw.xgb_stereo.root + fi done echo "TEMP DIRECTORY (to be deleted by hand): $DMSCWDIR" From 987b9cc13de693d879e39b61b307dd50f84327ed Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 24 Jul 2026 16:44:59 +0200 Subject: [PATCH 21/31] all run lists --- .../mc_data_comparison/compareDatawithMC.sh | 90 +++++++++++++------ 1 file changed, 65 insertions(+), 25 deletions(-) diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh index 7335918..ef1f845 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh @@ -39,6 +39,10 @@ ATMOS=($(awk '$1 == "*" && $2 == "ATMOSPHERE" {print $3}' "${RUNPAR}")) EPOCH=($(awk '$1 == "*" && $2 == "EPOCH" {print $3}' "${RUNPAR}")) # Wobble (default observing; WOBBLE mode fixed to 1 deg) MCWOFF="0.5" +# Hardwired MC epoch for major-epoch (non-minor-epoch) run lists. +# The data run-list epoch and output names remain V6, but the MC files come +# from this minor epoch. +NON_EPOCH_MC_EPOCH="V6_2012_2013a" # Crab NSB level CRABNSB=$(awk '$1 == "*" && $2 == "CRAB_NSB" {print $3; exit}' "${RUNPAR}") # Analysis type @@ -54,7 +58,7 @@ if [[ ! -z $VERITAS_ANALYSIS_TYPE ]]; then fi # Stereo reconstruction method # (0: dispBDT, 2: XGB) -RECOMETHOD=0 +RECOMETHOD=2 STEREOMETHOD="" if [[ $RECOMETHOD == 2 ]]; then STEREOMETHOD="_XGB" @@ -72,7 +76,7 @@ case "$ELE" in ;; esac # Directory for simulations -SIMDIR=${VERITAS_IRFPRODUCTION_DIR}/${VERSION}/${ANALYSISTYPE}/$SIMTYPE/ +SIMDIR=${VERITAS_IRFPRODUCTION_DIR}/${VERSION}_fs25/${ANALYSISTYPE}/$SIMTYPE/ if [[ ! -e ${SIMDIR} ]]; then echo "Error: simulation directory not found: $SIMDIR" exit @@ -128,12 +132,14 @@ get_mscw_file() for I in "${EPOCH[@]}" do - # ignore major epoch - if [[ $I == "V6" ]]; then - continue + MC_EPOCH="${I}" + if [[ "${I}" == "V6" ]]; then + MC_EPOCH="${NON_EPOCH_MC_EPOCH}" fi # Crab NSB level (depends on epoch) - if [[ $CRABNSB == "NOTSET" ]]; then + # If CRAB_NSB is omitted, use the per-epoch value as well. This supports + # parameter files whose EPOCH lines already contain the NSB value. + if [[ -z "${CRABNSB}" || $CRABNSB == "NOTSET" ]]; then NSB=$(awk -v epoch="${I}" '$1 == "*" && $2 == "EPOCH" && $3 == epoch {print $4; exit}' "${RUNPAR}") else NSB=${CRABNSB} @@ -184,26 +190,59 @@ do REDHV="_redHV" fi SIMATM="${atm}" - echo "Processing $I $A ${atm} $REDHV" + echo "Processing $I $A ${atm} $REDHV (MC epoch ${MC_EPOCH})" - # Crab run list - RUNLIST="$CDIR/runlist_releaseTesting${I}${REDHV}_${ELE}_0.5deg.dat" + # Crab run lists. If both atmosphere-specific and generic lists exist, + # analyse both. Generic-list output gets a distinct suffix below. + RUNLISTS=() + RUNLISTTAGS=() if [[ $ELE = "WOBBLE" ]]; then - RUNLIST="$CDIR/runlist_releaseTesting${I}${REDHV}_${ELE}.dat" - fi - echo "RUNLIST $RUNLIST" - if [[ ! -f "$RUNLIST" ]]; then - echo "..not found, skipping" - continue + RUNLISTS+=("$CDIR/runlist_releaseTesting${I}${REDHV}_${ELE}.dat") + RUNLISTTAGS+=("") + else + ATM_RUNLIST="$CDIR/runlist_releaseTesting${I}${REDHV}_ATM${atm}_${ELE}_0.5deg.dat" + if [[ ! -f "$ATM_RUNLIST" ]]; then + ATM_RUNLIST="$CDIR/runlist_releaseTesting${I}${REDHV}_ATM${atm}_${ELE}.dat" + fi + if [[ -f "$ATM_RUNLIST" ]]; then + RUNLISTS+=("$ATM_RUNLIST") + RUNLISTTAGS+=("") + fi + + GENERIC_RUNLIST="$CDIR/runlist_releaseTesting${I}${REDHV}_${ELE}_0.5deg.dat" + if [[ ! -f "$GENERIC_RUNLIST" ]]; then + # Major-epoch or combined lists may not carry the 0.5deg suffix, + # e.g. runlist_releaseTestingV6_SZE.dat. + GENERIC_RUNLIST="$CDIR/runlist_releaseTesting${I}${REDHV}_${ELE}.dat" + fi + if [[ -f "$GENERIC_RUNLIST" ]]; then + RUNLISTS+=("$GENERIC_RUNLIST") + RUNLISTTAGS+=("_ALL") + fi fi - NFIL=$(wc -l < "$RUNLIST") - if [ "$NFIL" -lt 3 ]; then - echo "..not enough runs ($NFIL), skipping" - continue + + if [[ ${#RUNLISTS[@]} -eq 0 ]]; then + RUNLISTS+=("$CDIR/runlist_releaseTesting${I}${REDHV}_${ELE}_0.5deg.dat") + RUNLISTTAGS+=("") fi - # output directory - ODIR=${BDIR}/${I}${A}_${ELE}_${MCWOFF}_${NSB} + for RUNLIST_INDEX in "${!RUNLISTS[@]}" + do + RUNLIST="${RUNLISTS[RUNLIST_INDEX]}" + RUNLISTTAG="${RUNLISTTAGS[RUNLIST_INDEX]}" + echo "RUNLIST $RUNLIST" + if [[ ! -f "$RUNLIST" ]]; then + echo "..not found, skipping" + continue + fi + NFIL=$(wc -l < "$RUNLIST") + if [ "$NFIL" -lt 3 ]; then + echo "..not enough runs ($NFIL), skipping" + continue + fi + + # output directory + ODIR=${BDIR}/${I}${A}${RUNLISTTAG}_${ELE}_${MCWOFF}_${NSB} mkdir -p ${ODIR} # tmp mscw file in output directory @@ -238,18 +277,18 @@ do # write run parameter file if [[ $SIMTYPE == "CARE_RedHV"* ]]; then SIMATM="61" - echo "* SIMS $SIMDIR/${I}_ATM${SIMATM}_gamma/${SIMMSCW}/${simfile} 4 ${MCWOFF} 0. 0. 0. ${ZEMIN} ${ZEMAX}" > $ODIR/mcdatacomparison.runparameter + echo "* SIMS $SIMDIR/${MC_EPOCH}_ATM${SIMATM}_gamma/${SIMMSCW}/${simfile} 4 ${MCWOFF} 0. 0. 0. ${ZEMIN} ${ZEMAX}" > $ODIR/mcdatacomparison.runparameter else - echo "* SIMS $SIMDIR/${I}_ATM${SIMATM}_gamma/${SIMMSCW}/${simfile} 4 ${MCWOFF} 0. 0. 0. ${ZEMIN} ${ZEMAX}" > $ODIR/mcdatacomparison.runparameter + echo "* SIMS $SIMDIR/${MC_EPOCH}_ATM${SIMATM}_gamma/${SIMMSCW}/${simfile} 4 ${MCWOFF} 0. 0. 0. ${ZEMIN} ${ZEMAX}" > $ODIR/mcdatacomparison.runparameter fi echo "* ON ${DMSCWDIR}/[0-9]*.mscw.root 4 -99. -99. 0. 360. ${ZEMIN} ${ZEMAX}" >> $ODIR/mcdatacomparison.runparameter echo "* OFF ${DMSCWDIR}/[0-9]*.mscw.root 4 -99. -99. 0. 360. ${ZEMIN} ${ZEMAX}" >> $ODIR/mcdatacomparison.runparameter echo " run parameter file: $ODIR/mcdatacomparison.runparameter" - FSCRIPT="$DMSCWDIR/compareDatawithMC_qsub_${SIMTYPE}_${I}${A}_${ELE}_${MCWOFF}_${NSB}" + FSCRIPT="$DMSCWDIR/compareDatawithMC_qsub_${SIMTYPE}_${I}${A}${RUNLISTTAG}_${ELE}_${MCWOFF}_${NSB}" rm -f ${FSCRIPT}.sh sed -e "s|OUTDIR|$ODIR|" \ - -e "s|EEPOCHTM|${I}_ATM${SIMATM}|" \ + -e "s|EEPOCHTM|${MC_EPOCH}_ATM${SIMATM}|" \ -e "s|CURRENTDIR|$PWDIR|" \ -e "s|METHODRECO|$RECOMETHOD|" compareDatawithMC_qsub.sh > ${FSCRIPT}.sh @@ -259,5 +298,6 @@ do $EVNDISPSCRIPTS/helper_scripts/UTILITY.condorSubmission.sh ${FSCRIPT}.sh 4000M 10G condor_submit ${FSCRIPT}.sh.condor + done done done From 86c85d27c7e3414a6e504427e45b6674597906ec Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sun, 2 Aug 2026 16:18:21 +0200 Subject: [PATCH 22/31] add method --- .../mc_data_comparison/compareDatawithMC_qsub.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh index ad1b0f0..e2d9601 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh @@ -14,14 +14,21 @@ if [[ ${ODIR} == *"CARE_RedHV"* ]]; then BDT="0" fi +CUT="-3" +T2="0.035" +XGBSUFFIX="xgb_stereo" +MAXZE="20." +ERECOMETHOD="0" + PP=$(pwd) cd ${CDIR} $EVNDISPSYS/bin/compareDatawithMC \ $ODIR/mcdatacomparison.runparameter \ - -3 \ + $CUT \ $ODIR/mcdatacomparison.root \ - ${BDT} $EPOCHATM $RECOMETHOD \ + ${BDT} $EPOCHATM $ERECOMETHOD \ + ${XGBSUFFIX} ${MAXZE} ${T2} $RECOMETHOD \ > $ODIR/mcdatacomparison.log # prepare all plots From aeb4dc0ed5336671b1b45ace03cd9c8cd01082be Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Wed, 5 Aug 2026 09:51:18 +0200 Subject: [PATCH 23/31] add flexibility in anasum directory --- .../Crab/runlist_generator_from_anasum_log.sh | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh b/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh index 95470a8..5e881d4 100755 --- a/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh +++ b/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh @@ -78,16 +78,19 @@ fill_run() get_anasum_log_file() { - data_dir="${1}" - runn="${2}" - if [ ! -e ${data_dir}/$runn.anasum.log ]; then - if [[ ${runn} -lt 100000 ]]; then - EDIR="${data_dir}/${runn:0:1}/" - else - EDIR="${data_dir}/${runn:0:2}/" - fi + local data_dir="${1}" + local runn="${2}" + local direct_log="${data_dir}/${runn}.anasum.log" + + # Anasum logs may either be stored directly in data_dir or in a + # subdirectory selected from the first one/two run-number digits. + if [[ -e "${direct_log}" ]]; then + echo "${direct_log}" + elif [[ ${runn} -lt 100000 ]]; then + echo "${data_dir}/${runn:0:1}/${runn}.anasum.log" + else + echo "${data_dir}/${runn:0:2}/${runn}.anasum.log" fi - echo "$EDIR/$runn.anasum.log" } echo "READING anasum files from ${DATADIR}" From b531be603668196e0e6c83f6fcf3ac96bccab8cc Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sat, 26 Sep 2026 12:22:18 +0200 Subject: [PATCH 24/31] early stop of data dir does not exist --- release_tests/sources/Crab/anasum_from_runlists.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release_tests/sources/Crab/anasum_from_runlists.sh b/release_tests/sources/Crab/anasum_from_runlists.sh index 7f3226d..97fb0ae 100755 --- a/release_tests/sources/Crab/anasum_from_runlists.sh +++ b/release_tests/sources/Crab/anasum_from_runlists.sh @@ -66,6 +66,10 @@ for CUT in $CUTS; do ######################### # Directory for data files DDIR="$VERITAS_USER_DATA_DIR/analysis/Results/${VERSION}/${ANALYSISTYPE}/${OBJECT}/${MEPOCH}_${CUT}" + if [[ ! -d "$INDIR" ]]; then + echo "Error, input directory not found: $INDIR" + exit 1 + fi mkdir -p "$DDIR" echo $DDIR for R in $RLISTS; do From e0c0c2d4bcc10c18f842504e60e28ac49e32f1e5 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sat, 26 Sep 2026 12:23:26 +0200 Subject: [PATCH 25/31] pre-commit --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd67886..1432ecb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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"] @@ -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"] From 55ac73a412d0082dfeb9744b7c00b52bf211aeed Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sat, 26 Sep 2026 12:36:36 +0200 Subject: [PATCH 26/31] ze correction --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e3f9171..35896a5 100644 --- a/README.md +++ b/README.md @@ -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 From 9e3bf502a819c3220dd8b366a0dc61baeac7b697 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sat, 26 Sep 2026 15:27:53 +0200 Subject: [PATCH 27/31] clearer comparison --- release_tests/sources/README.md | 107 +++++++++++++++++- .../prepare_analysis_results_document.sh | 5 +- release_tests/sources/source_tests_summary.sh | 5 +- 3 files changed, 113 insertions(+), 4 deletions(-) diff --git a/release_tests/sources/README.md b/release_tests/sources/README.md index fdd9bde..74ecce5 100644 --- a/release_tests/sources/README.md +++ b/release_tests/sources/README.md @@ -1,5 +1,17 @@ # Release testing - Crab and published sources +## Overview + +Source tests validate an EventDisplay release against a set of published +sources (hard/soft, moderate/weak) over epochs and cut types. Results are +produced in two stages: + +1. **Per source** – `source_tests_summary.sh` writes one + `results___.md` per target/epoch/cut into the new + release's `SourceTests` directory. +2. **Combined** – `prepare_analysis_results_document.sh` concatenates all + per-source files into a single `AnalysisResults.md`. + ## Crab - use scripts and macros in ./Crab directory (implementation completed) @@ -13,4 +25,97 @@ This should involve soft and hard sources, moderate and very weak sources. ## Published sources -List of sources to be tested are in `TARGET.dat`. Use `run_analysis_all.sh` to analysis all sources. +Sources to test are listed in `TARGETS.dat`. Analyse with `run_analysis_all.sh`, +then summarise and combine per the steps below. + +## Updating the source tests summary + +### Setup + +`run_analysis_all.sh` writes analysis results into: + +```text +$VERITAS_USER_DATA_DIR/analysis/Results/${VERSION}/${ANALYSISTYPE}/SourceTests +``` + +with `${VERSION}` from `$VERITAS_EVNDISP_AUX_DIR/IRFVERSION` (e.g. `v491`), +`${ANALYSISTYPE}` from `$VERITAS_ANALYSIS_TYPE` (`AP`/`NN`). + +### 1. Run analyses (only if the anasum logs are missing) + +`run_analysis_all.sh` runs the anasum combination and writes anasum **log files** +`///.log` (note: a single command line argument +is required): + +```bash +./run_analysis_all.sh run +``` + +### 2. Per-source summary + +`source_tests_summary.sh` parses the anasum log files and writes/updates one +markdown file per target/epoch/cut: + +```text +//results___.md +``` + +It builds on the **previous** release: the previous version's markdown files are +copied into the output directory, stale lines for the new version are removed, +and freshly parsed results inserted before the closing code fence (anasum logs +are also copied over). + +```bash +./source_tests_summary.sh \ + \ + \ + +``` + +Initial run (no previous version, e.g. v490.7): + +```bash +./source_tests_summary.sh \ + $VERITAS_USER_DATA_DIR/analysis/Results/v490/AP/SourceTests \ + . \ + ../../../EventDisplay_Release_v490/SourceTests \ + v490.7 +``` + +Follow-up run (e.g. v491 built on v490 results): + +```bash +./source_tests_summary.sh \ + $VERITAS_USER_DATA_DIR/analysis/Results/v491/AP/SourceTests \ + ../../../EventDisplay_Release_v490/SourceTests \ + ../../../EventDisplay_Release_v491/SourceTests \ + v491.0 +``` + +The script iterates over all targets/epochs/cuts in `TARGETS.dat`; all per-source +files land in ``. + +### 3. Combine into full document + +`prepare_analysis_results_document.sh` loops over targets in `TARGETS.dat`, +appends each target's `results__*.md`, wraps with +`AnalysisResults_header.md`/`AnalysisResults_footer.md`, and concatenates with +`pandoc`: + +```bash +./prepare_analysis_results_document.sh ../../../EventDisplay_Release_v491/SourceTests +``` + +Produces `./AnalysisResults.md`. + +### Workflow + +```text +run_analysis_all.sh -> anasum log files (//.log) + | + v (per source) +source_tests_summary.sh -> results___.md (one per source/epoch/cut) + | + v (combined) +prepare_analysis_results_document.sh -> AnalysisResults.md (single combined document) +``` diff --git a/release_tests/sources/prepare_analysis_results_document.sh b/release_tests/sources/prepare_analysis_results_document.sh index 40e744d..e040894 100755 --- a/release_tests/sources/prepare_analysis_results_document.sh +++ b/release_tests/sources/prepare_analysis_results_document.sh @@ -25,11 +25,14 @@ LTARGETS=$(cat TARGETS.dat) PDOC="AnalysisResults_header.md " +# skip targets without result files (glob that matches nothing is left literal) +shopt -s nullglob for T in ${LTARGETS}; do - for F in $(ls ${IDIR}/${T}/results_${T}_*.md); do + for F in ${IDIR}/${T}/results_${T}_*.md; do PDOC="${PDOC} ${F}" done done +shopt -u nullglob PDOC="${PDOC} AnalysisResults_footer.md" # echo "Pandoc command: pandoc -s -o ./AnalysisResults.md ${PDOC}" diff --git a/release_tests/sources/source_tests_summary.sh b/release_tests/sources/source_tests_summary.sh index 363b363..6148095 100755 --- a/release_tests/sources/source_tests_summary.sh +++ b/release_tests/sources/source_tests_summary.sh @@ -4,7 +4,8 @@ # # if [[ $# -lt 4 ]]; then -echo " +cat <<'EOF' + ./source_tests_summary.sh Extract results from anasum log files and prepare markdown files for each object / epoch / cut type. @@ -25,7 +26,7 @@ echo " ./source_tests_summary.sh $VERITAS_USER_DATA_DIR/analysis/Results/v491/AP/SourceTests ../../../EventDisplay_Release_v490/SourceTests ../../../EventDisplay_Release_v491/SourceTests v491.0 ``` -" +EOF exit fi From 450bdc984afc0ba1570137423f6d7af84f7fd9be Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Sun, 27 Sep 2026 16:28:09 +0200 Subject: [PATCH 28/31] V2DL5 --- release_tests/sources/ANALYSIS.v2dl5.Crab.sh | 62 +++++++---- release_tests/sources/ANALYSIS.v2dl5.all.sh | 105 ++++++++++++------ .../ANALYSIS.v2dl5.reflected_region.yml | 2 +- release_tests/sources/ANALYSIS.v2dl5.sh | 64 ++++++----- release_tests/sources/ANALYSIS.v2dl5_qsub.sh | 2 +- release_tests/sources/README.md | 86 ++++++++++++-- 6 files changed, 233 insertions(+), 88 deletions(-) diff --git a/release_tests/sources/ANALYSIS.v2dl5.Crab.sh b/release_tests/sources/ANALYSIS.v2dl5.Crab.sh index 61ebbbe..cf26820 100755 --- a/release_tests/sources/ANALYSIS.v2dl5.Crab.sh +++ b/release_tests/sources/ANALYSIS.v2dl5.Crab.sh @@ -1,26 +1,48 @@ -# Run V2DL5 analysis for all Crab runs +#!/bin/bash +# Submit V2DL5 reflected-region analyses for the Crab release-test run lists. -CUT="soft2tel" -CUT="moderate2tel" -CUT="hard3tel" +set -u -RLISTS=$(ls -1 Crab/runlists/*.dat) -DL3DIR="/lustre/fs24/group/veritas/shared/processed_data_v490/AP/dl3_pointlike_${CUT}/" -DDIR="$VERITAS_USER_DATA_DIR/analysis/Results/v490/AP/v2dl5/${CUT}" -TARGET="Crab" -CONFIG="ANALYSIS.v2dl5.reflected_region.yml" +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +VERSION=$(cat "${VERITAS_EVNDISP_AUX_DIR:?}/IRFVERSION") +MINORVERSION=$(cat "${VERITAS_EVNDISP_AUX_DIR:?}/IRFMINORVERSION") +ANALYSISTYPE="${VERITAS_ANALYSIS_TYPE:0:2}" +CONFIG="${V2DL5_CONFIG:-${SCRIPT_DIR}/ANALYSIS.v2dl5.reflected_region.yml}" +DL3_BASE="${V2DL5_DL3_BASE:-${VERITAS_DATA_DIR:?}/shared/processed_data_${MINORVERSION}/${ANALYSISTYPE}}" +OUTPUT_ROOT="${V2DL5_OUTPUT_ROOT:-${VERITAS_USER_DATA_DIR:?}/analysis/Results/${VERSION}/${ANALYSISTYPE}/v2dl5}" +TARGET="${V2DL5_CRAB_TARGET:-Crab}" -for RLIST in $RLISTS -do - if [[ $(wc -l < "$RLIST") -eq 0 ]]; then - echo "Zero lines in $RLIST" - continue - fi - - ODIR=$(basename $RLIST .dat) - ODIR="${ODIR/runlist_releaseTesting/}" - echo $ODIR +if [[ -n "${V2DL5_CUTS:-}" ]]; then + CUTS="${V2DL5_CUTS}" +elif [[ "${ANALYSISTYPE}" == "NN" ]]; then + CUTS="supersoftNN2tel" +else + CUTS="soft2tel moderate2tel hard3tel" +fi - ./ANALYSIS.v2dl5.sh ${RLIST} ${TARGET} ${DL3DIR} ${DDIR}/${ODIR} ${CONFIG} +[[ -f "${CONFIG}" ]] || { echo "Missing DL5 configuration: ${CONFIG}" >&2; exit 1; } +shopt -s nullglob +RUNLISTS=("${SCRIPT_DIR}/Crab"/runlist_releaseTesting*.dat) +shopt -u nullglob +[[ ${#RUNLISTS[@]} -gt 0 ]] || { echo "No Crab release-test run lists found" >&2; exit 1; } +status=0 +for CUT in ${CUTS}; do + DL3DIR="${DL3_BASE}/dl3_pointlike_${CUT}" + if [[ ! -d "${DL3DIR}" ]]; then + echo "Skipping Crab (${CUT}): DL3 store not found: ${DL3DIR}" >&2 + status=1 + continue + fi + for RLIST in "${RUNLISTS[@]}"; do + [[ -s "${RLIST}" ]] || { echo "Skipping empty run list: ${RLIST}" >&2; status=1; continue; } + EPOCH=$(basename "${RLIST}" .dat) + EPOCH=${EPOCH#runlist_releaseTesting_} + EPOCH=${EPOCH#runlist_releaseTesting} + ODIR="${OUTPUT_ROOT}/${CUT}/Crab_${EPOCH}" + echo "Submitting Crab, ${EPOCH}, ${CUT}" + "${SCRIPT_DIR}/ANALYSIS.v2dl5.sh" "${RLIST}" "${TARGET}" "${DL3DIR}" "${ODIR}" "${CONFIG}" || status=1 + done done + +exit "${status}" diff --git a/release_tests/sources/ANALYSIS.v2dl5.all.sh b/release_tests/sources/ANALYSIS.v2dl5.all.sh index 37beba1..7ce510c 100755 --- a/release_tests/sources/ANALYSIS.v2dl5.all.sh +++ b/release_tests/sources/ANALYSIS.v2dl5.all.sh @@ -1,35 +1,76 @@ -# Run V2DL5 analysis for all test sources except Crab -# expect a TARGET.txt file in each directory with a -# one line entry containing the SIMBAD identifier - -CUT="soft2tel" -CUT="moderate2tel" -CUT="hard3tel" - -RLISTS=$(find . -type d -name Crab -prune -o -name 'runlist_releaseTesting*.dat' -print) -DL3DIR="/lustre/fs24/group/veritas/shared/processed_data_v490/AP/dl3_pointlike_${CUT}/" -DDIR="$VERITAS_USER_DATA_DIR/analysis/Results/v490/AP/v2dl5/${CUT}" -CONFIG="ANALYSIS.v2dl5.reflected_region.yml" - -for RLIST in $RLISTS -do - if [[ $(wc -l < "$RLIST") -eq 0 ]]; then - echo "Zero lines in $RLIST" +#!/bin/bash +# Submit V2DL5 reflected-region analyses for all non-Crab release-test sources. + +set -u + +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +VERSION=$(cat "${VERITAS_EVNDISP_AUX_DIR:?}/IRFVERSION") +MINORVERSION=$(cat "${VERITAS_EVNDISP_AUX_DIR:?}/IRFMINORVERSION") +ANALYSISTYPE="${VERITAS_ANALYSIS_TYPE:0:2}" +TARGETS_FILE="${SCRIPT_DIR}/TARGETS.dat" +CONFIG="${V2DL5_CONFIG:-${SCRIPT_DIR}/ANALYSIS.v2dl5.reflected_region.yml}" + +# Override these when the DL3 store or result root is not in the standard +# release-test location. +DL3_BASE="${V2DL5_DL3_BASE:-${VERITAS_DATA_DIR:?}/shared/processed_data_${MINORVERSION}/${ANALYSISTYPE}}" +OUTPUT_ROOT="${V2DL5_OUTPUT_ROOT:-${VERITAS_USER_DATA_DIR:?}/analysis/Results/${VERSION}/${ANALYSISTYPE}/v2dl5}" + +if [[ -n "${V2DL5_CUTS:-}" ]]; then + CUTS="${V2DL5_CUTS}" +elif [[ "${ANALYSISTYPE}" == "NN" ]]; then + CUTS="supersoftNN2tel" +else + CUTS="soft2tel moderate2tel hard3tel" +fi + +[[ -f "${TARGETS_FILE}" ]] || { echo "Missing target list: ${TARGETS_FILE}" >&2; exit 1; } +[[ -f "${CONFIG}" ]] || { echo "Missing DL5 configuration: ${CONFIG}" >&2; exit 1; } + +status=0 +while IFS= read -r SOURCE || [[ -n "${SOURCE}" ]]; do + [[ -z "${SOURCE}" || "${SOURCE}" == \#* ]] && continue + [[ "${SOURCE}" == "Crab" ]] && continue + + SOURCE_DIR="${SCRIPT_DIR}/${SOURCE}" + TARGET_FILE="${SOURCE_DIR}/TARGET.txt" + if [[ ! -f "${TARGET_FILE}" ]]; then + echo "Skipping ${SOURCE}: missing ${TARGET_FILE}" >&2 + status=1 continue fi - DIRN=$(dirname $RLIST) - echo $DIRN - TDIR=$(basename $DIRN) - EPOCH=$(basename $RLIST .dat) - EPOCH="${EPOCH/runlist_releaseTesting_/}" - ODIR="${TDIR}_${EPOCH}" - echo "Processing $ODIR" - - if [[ -e ${DIRN}/TARGET.txt ]]; then - TARGET=$(cat ${DIRN}/TARGET.txt) - echo " TARGET $TARGET" - ./ANALYSIS.v2dl5.sh ${RLIST} "${TARGET}" ${DL3DIR} ${DDIR}/${ODIR} ${CONFIG} - else - echo "No target file found in ${DIRN}" + TARGET=$(<"${TARGET_FILE}") + if [[ -z "${TARGET}" ]]; then + echo "Skipping ${SOURCE}: empty ${TARGET_FILE}" >&2 + status=1 + continue + fi + + shopt -s nullglob + RUNLISTS=("${SOURCE_DIR}"/runlist_releaseTesting*.dat) + shopt -u nullglob + if [[ ${#RUNLISTS[@]} -eq 0 ]]; then + echo "Skipping ${SOURCE}: no release-test run list" >&2 + status=1 + continue fi -done + + for CUT in ${CUTS}; do + DL3DIR="${DL3_BASE}/dl3_pointlike_${CUT}" + if [[ ! -d "${DL3DIR}" ]]; then + echo "Skipping ${SOURCE} (${CUT}): DL3 store not found: ${DL3DIR}" >&2 + status=1 + continue + fi + for RLIST in "${RUNLISTS[@]}"; do + [[ -s "${RLIST}" ]] || { echo "Skipping empty run list: ${RLIST}" >&2; status=1; continue; } + EPOCH=$(basename "${RLIST}" .dat) + EPOCH=${EPOCH#runlist_releaseTesting_} + EPOCH=${EPOCH#runlist_releaseTesting} + ODIR="${OUTPUT_ROOT}/${CUT}/${SOURCE}_${EPOCH}" + echo "Submitting ${SOURCE}, ${EPOCH}, ${CUT}" + "${SCRIPT_DIR}/ANALYSIS.v2dl5.sh" "${RLIST}" "${TARGET}" "${DL3DIR}" "${ODIR}" "${CONFIG}" || status=1 + done + done +done < "${TARGETS_FILE}" + +exit "${status}" diff --git a/release_tests/sources/ANALYSIS.v2dl5.reflected_region.yml b/release_tests/sources/ANALYSIS.v2dl5.reflected_region.yml index 1c6143b..95d2f88 100644 --- a/release_tests/sources/ANALYSIS.v2dl5.reflected_region.yml +++ b/release_tests/sources/ANALYSIS.v2dl5.reflected_region.yml @@ -22,7 +22,7 @@ datasets: magnitude_B: 7 star_exclusion_radius: 0.30 deg fov: 3.5 deg - star_file: "$EVNDISPSYS/../V2DL5/data/hip_mag9.fits.gz" + star_file: "STAR_FILE" containment_correction: false safe_mask: methods: ['aeff-max'] diff --git a/release_tests/sources/ANALYSIS.v2dl5.sh b/release_tests/sources/ANALYSIS.v2dl5.sh index 018a206..7c68e9c 100755 --- a/release_tests/sources/ANALYSIS.v2dl5.sh +++ b/release_tests/sources/ANALYSIS.v2dl5.sh @@ -4,19 +4,13 @@ # # qsub parameters -h_cpu=11:59:00; h_vmem=8000M; tmpdir_size=5G +h_vmem=8000M; tmpdir_size=5G -# EventDisplay version -EDVERSION=$($EVNDISPSYS/bin/anasum --version | tr -d .) -# Directory with preprocessed data -DEFANASUMDIR="$VERITAS_DATA_DIR/processed_data_${EDVERSION}/${VERITAS_ANALYSIS_TYPE:0:2}/anasum/" -V2DL5="$EVNDISPSYS/../V2DL5/" - -if [ $# -lt 4 ]; then +if [ $# -lt 5 ]; then echo " Reflected region analysis using gammapy -ANALYSIS.v2dl5.sh +ANALYSIS.v2dl5.sh required parameters: @@ -24,7 +18,7 @@ required parameters: target name (SIMBAD conform) - directory with data/obs store + directory with DL3 observation store output directory for results @@ -37,20 +31,41 @@ corresponding conda installation (v2dl5) " exit fi -RLIST=$(readlink -f "$1") +if [[ -z "${EVNDISPSYS:-}" || -z "${VERITAS_USER_LOG_DIR:-}" ]]; then + echo "Error, EVNDISPSYS and VERITAS_USER_LOG_DIR must be set, exiting..." + exit 1 +fi +V2DL5="$EVNDISPSYS/../V2DL5/" +RLIST=$(cd "$(dirname "$1")" && pwd)/$(basename "$1") TARGET="$2" -DATASTORE=$3 -ODIR=$4 -CONFIG=$5 +DATASTORE="$3" +ODIR="$4" +CONFIG="$5" # Read runlist if [ ! -f "$RLIST" ] ; then echo "Error, runlist $RLIST not found, exiting..." exit 1 fi +if [ ! -d "$DATASTORE" ] ; then + echo "Error, datastore $DATASTORE not found, exiting..." + exit 1 +fi +if [ ! -f "$CONFIG" ] ; then + echo "Error, configuration template $CONFIG not found, exiting..." + exit 1 +fi +if [ ! -f "${V2DL5}/v2dl5/scripts/reflected_region_analysis.py" ] ; then + echo "Error, V2DL5 reflected-region script not found below $V2DL5, exiting..." + exit 1 +fi +if [ ! -f "${V2DL5}/data/hip_mag9.fits.gz" ] ; then + echo "Error, V2DL5 star catalogue not found below $V2DL5, exiting..." + exit 1 +fi # make output directory if it doesn't exist -mkdir -p $ODIR +mkdir -p "$ODIR" echo -e "Output files will be written to:\n $ODIR" # run scripts are written into this directory @@ -58,29 +73,28 @@ DATE=`date +"%y%m%d"` LOGDIR="$VERITAS_USER_LOG_DIR/${DATE}-$(uuidgen)/V2DL5" mkdir -p "$LOGDIR" echo -e "Log files will be written to:\n $LOGDIR" -rm -f ${LOGIDR}/x* 2>/dev/null +rm -f "${LOGDIR}"/x* 2>/dev/null # Job submission script SUBSCRIPT=$( dirname "$0" )"/ANALYSIS.v2dl5_qsub" -TIMETAG=`date +"%s"` # Prepare template file -if [[ -e $CONFIG ]]; then - sed -e "s|DATASTORE|$DATASTORE|" \ - -e "s|TARGET|$TARGET|" $CONFIG > ${LOGDIR}/config.yml -fi +sed -e "s|DATASTORE|$DATASTORE|" \ + -e "s|TARGET|$TARGET|" \ + -e "s|STAR_FILE|${V2DL5}/data/hip_mag9.fits.gz|" \ + "$CONFIG" > "${LOGDIR}/config.yml" FSCRIPT="${LOGDIR}/V2DL5" -rm -f $FSCRIPT.sh +rm -f "$FSCRIPT.sh" sed -e "s|RRUNLIST|$RLIST|" \ -e "s|OODIR|$ODIR|" \ - -e "s|CCONFIG|${LOGDIR}/config.yml|" $SUBSCRIPT.sh > $FSCRIPT.sh + -e "s|CCONFIG|${LOGDIR}/config.yml|" "$SUBSCRIPT.sh" > "$FSCRIPT.sh" -chmod u+x $FSCRIPT.sh +chmod u+x "$FSCRIPT.sh" -$EVNDISPSCRIPTS/helper_scripts/UTILITY.condorSubmission.sh $FSCRIPT.sh $h_vmem $tmpdir_size +"$EVNDISPSCRIPTS/helper_scripts/UTILITY.condorSubmission.sh" "$FSCRIPT.sh" "$h_vmem" "$tmpdir_size" echo echo "-------------------------------------------------------------------------------" echo "Job submission using HTCondor - run the following script to submit jobs at once:" diff --git a/release_tests/sources/ANALYSIS.v2dl5_qsub.sh b/release_tests/sources/ANALYSIS.v2dl5_qsub.sh index a0a3dfe..f0ba9ec 100755 --- a/release_tests/sources/ANALYSIS.v2dl5_qsub.sh +++ b/release_tests/sources/ANALYSIS.v2dl5_qsub.sh @@ -40,7 +40,7 @@ check_conda_installation() check_conda_installation -source activate base +source "$(conda info --base)/etc/profile.d/conda.sh" conda activate v2dl5 export PYTHONPATH=\$PYTHONPATH:${V2DL5} diff --git a/release_tests/sources/README.md b/release_tests/sources/README.md index 74ecce5..8df0bb7 100644 --- a/release_tests/sources/README.md +++ b/release_tests/sources/README.md @@ -12,21 +12,89 @@ produced in two stages: 2. **Combined** – `prepare_analysis_results_document.sh` concatenates all per-source files into a single `AnalysisResults.md`. -## Crab +## Published sources -- use scripts and macros in ./Crab directory (implementation completed) -- other objects: to be done +Sources to test are listed in `TARGETS.dat`, spanning hard/soft and +moderate/weak targets. Use `run_analysis_all.sh` for the EventDisplay/anasum +results, then summarise and combine per the steps below. Crab-specific plotting +macros remain in `Crab/`. + +## DL5 / Gammapy reflected-region analysis + +The `ANALYSIS.v2dl5*.sh` scripts are a separate, batch-submitted DL5 workflow. +They call V2DL5's `reflected_region_analysis.py`, which runs the configured +Gammapy 1D reflected-region analysis (dataset creation, reflected background, +power-law fit, flux points, and light curve). Their results are not consumed by +`source_tests_summary.sh` or by `AnalysisResults.md`; those scripts summarise +the EventDisplay/anasum analysis above. + +### What must exist first + +The DL5 scripts do **not** create DL3 data. Before submitting an analysis, +make a DL3 observation store for the same EventDisplay release, analysis type, +and cut configuration, and ensure that it contains every run in the selected +run list and its required `aeff` and `edisp` IRFs. Install/checkout V2DL5 at +`$EVNDISPSYS/../V2DL5`, including its `data/hip_mag9.fits.gz` star catalogue, +and create the `v2dl5` conda environment. The submit host also needs the +EventDisplay observatory setup, HTCondor helper scripts, and writable +`$VERITAS_USER_LOG_DIR` and result locations. + +For every non-Crab source, a `TARGET.txt` file must contain a SIMBAD-resolvable +target name, because it is substituted into the `on_region.target` setting. +Seven current `TARGETS.dat` entries do not meet this requirement: +`B20912p029`, `IC310`, `LHAASO_J2108p5157`, `RBS1366`, `RGBJ1310p323`, +`SS433`, and `UMA2` lack `TARGET.txt`. `Crab` is handled separately with the +default target name `Crab`. Thus the repository cannot yet complete the full +list. Add and validate the missing target names (and suitable run lists) before +calling it a full-list analysis. + +### Submit the analyses + +Run these commands from `release_tests/sources`. The launchers read the active +`IRFVERSION`, `IRFMINORVERSION`, and analysis type, then use the standard +release-test locations: + +- DL3 stores: `$VERITAS_DATA_DIR/shared/processed_data_${IRFMINORVERSION}/` + `${VERITAS_ANALYSIS_TYPE:0:2}/dl3_pointlike_`; +- output: `$VERITAS_USER_DATA_DIR/analysis/Results/${IRFVERSION}/` + `${VERITAS_ANALYSIS_TYPE:0:2}/v2dl5/`. + +For AP, all launchers submit `soft2tel`, `moderate2tel`, and `hard3tel`; for +NN they submit `supersoftNN2tel`. Override the defaults without editing code: -Mrk501 (implementation completed): +```bash +export V2DL5_DL3_BASE=/path/to/processed_data_/ +export V2DL5_OUTPUT_ROOT=/path/to/results/v2dl5 +export V2DL5_CUTS="soft2tel moderate2tel hard3tel" +``` -- The steps to run the validation over sources other than Crab: +The non-Crab launcher reads `TARGETS.dat` and skips Crab; the Crab launcher +uses the run lists directly in `Crab/`. Both process every matching +`runlist_releaseTesting*.dat`, including special red-HV or offset selections. +Review those lists before submission, or select an explicit set by moving them +out of the matching pattern. -This should involve soft and hard sources, moderate and very weak sources. +```bash +./ANALYSIS.v2dl5.all.sh -## Published sources +./ANALYSIS.v2dl5.Crab.sh +``` + +Each call to `ANALYSIS.v2dl5.sh` creates a temporary Condor submission script +under `$VERITAS_USER_LOG_DIR/.../V2DL5`; submit the generated jobs using the +printed command: + +```bash +$EVNDISPSCRIPTS/helper_scripts/submit_scripts_to_htcondor.sh submit +``` -Sources to test are listed in `TARGETS.dat`. Analyse with `run_analysis_all.sh`, -then summarise and combine per the steps below. +The actual analysis output and `v2dl5.log` are written below +`$V2DL5_OUTPUT_ROOT//_` (or the default output root shown +above). Inspect every `v2dl5.log` after the jobs finish, verify that the +requested observations were selected, and retain the generated +fit/flux-point/light-curve products as the DL5 validation artefacts. There is +currently no repository script to collect, compare, or add these DL5 outputs +to `AnalysisResults.md`. ## Updating the source tests summary From d6770f4720703621cf796e139469beb78e374d33 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Sun, 27 Sep 2026 17:10:54 +0200 Subject: [PATCH 29/31] Change BDT value from '0' to '1' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh index e2d9601..96ed38c 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC_qsub.sh @@ -9,7 +9,7 @@ CDIR=CURRENTDIR EPOCHATM=EEPOCHTM RECOMETHOD=METHODRECO -BDT="0" +BDT="1" if [[ ${ODIR} == *"CARE_RedHV"* ]]; then BDT="0" fi From 19141acb64fee97a6b40c91c408c0e72af3a743c Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Sun, 27 Sep 2026 17:11:17 +0200 Subject: [PATCH 30/31] Fix job submission command to handle errors Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- release_tests/sources/ANALYSIS.v2dl5.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_tests/sources/ANALYSIS.v2dl5.sh b/release_tests/sources/ANALYSIS.v2dl5.sh index 7c68e9c..1292eed 100755 --- a/release_tests/sources/ANALYSIS.v2dl5.sh +++ b/release_tests/sources/ANALYSIS.v2dl5.sh @@ -94,7 +94,7 @@ sed -e "s|RRUNLIST|$RLIST|" \ chmod u+x "$FSCRIPT.sh" -"$EVNDISPSCRIPTS/helper_scripts/UTILITY.condorSubmission.sh" "$FSCRIPT.sh" "$h_vmem" "$tmpdir_size" +"$EVNDISPSCRIPTS/helper_scripts/UTILITY.condorSubmission.sh" "$FSCRIPT.sh" "$h_vmem" "$tmpdir_size" || exit 1 echo echo "-------------------------------------------------------------------------------" echo "Job submission using HTCondor - run the following script to submit jobs at once:" From 3fc6746e49c8d1e1eae4b622b4600c21b149cdd5 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Sun, 27 Sep 2026 17:11:29 +0200 Subject: [PATCH 31/31] Update README with input data requirements for Crab Nebula Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- release_tests/montecarlo/mc_data_comparison/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_tests/montecarlo/mc_data_comparison/README.md b/release_tests/montecarlo/mc_data_comparison/README.md index 5596bb7..5fcd741 100644 --- a/release_tests/montecarlo/mc_data_comparison/README.md +++ b/release_tests/montecarlo/mc_data_comparison/README.md @@ -24,7 +24,7 @@ NOTE! The zenith angle bins are different compared to those used in the Crab Neb ### Input Data Requirements - MC simulation files for each minor epoch (organized by atmosphere type) -- Crab Nebula mscw results for each minor epoch +- Crab Nebula mscw results and matching `*.mscw.xgb_stereo.root` files for each run - Run lists for Crab observations (generated separately) ## Preparation Steps