From 855e044b09ffd0e001827650280d7959a0b2d0e4 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 28 May 2026 08:10:26 +0200 Subject: [PATCH 1/7] update run list --- .../sources/Crab/runlist_releaseTestingV6.dat | 29 +++++++++++++++++++ .../Crab/runlist_releaseTestingV6redHV.dat | 2 ++ 2 files changed, 31 insertions(+) diff --git a/release_tests/sources/Crab/runlist_releaseTestingV6.dat b/release_tests/sources/Crab/runlist_releaseTestingV6.dat index 10bc219..da6d0e3 100644 --- a/release_tests/sources/Crab/runlist_releaseTestingV6.dat +++ b/release_tests/sources/Crab/runlist_releaseTestingV6.dat @@ -1028,3 +1028,32 @@ 113963 113994 113995 +114042 +114043 +114096 +114113 +114161 +114162 +114282 +114290 +114337 +114355 +114371 +114375 +114462 +114487 +114488 +114489 +114526 +114527 +114554 +114629 +114682 +114683 +114706 +114741 +114742 +114748 +114773 +114789 +114880 diff --git a/release_tests/sources/Crab/runlist_releaseTestingV6redHV.dat b/release_tests/sources/Crab/runlist_releaseTestingV6redHV.dat index df43692..3f85527 100644 --- a/release_tests/sources/Crab/runlist_releaseTestingV6redHV.dat +++ b/release_tests/sources/Crab/runlist_releaseTestingV6redHV.dat @@ -132,3 +132,5 @@ 113658 113711 113989 +114550 +114551 From 550e77c737ccc6f4e53c8991fbb38aa92c547fd0 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 28 May 2026 08:17:38 +0200 Subject: [PATCH 2/7] fix repo names --- README.md | 6 +++--- release_tests/montecarlo/energythresholds/plot.C | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7e4a34e..e3f9171 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ Note that it is impossible to test every single IRF function and every single po This repository contains code and macros for release testing. Results of release tests are saved in separate repositories: -- [v492](https://github.com/VERITAS-Observatory/EventDisplay_ReleaseTests_v492) -- [v491](https://github.com/VERITAS-Observatory/EventDisplay_ReleaseTests_v491) -- [v490](https://github.com/VERITAS-Observatory/EventDisplay_ReleaseTests_v490) +- [v492](https://github.com/VERITAS-Observatory/EventDisplay_Release_v492) +- [v491](https://github.com/VERITAS-Observatory/EventDisplay_Release_v491) +- [v490](https://github.com/VERITAS-Observatory/EventDisplay_Release_v490) - [before v490](https://github.com/VERITAS-Observatory/Eventdisplay_ReleaseTests) Simplified overview of the testing (somewhat outdated): diff --git a/release_tests/montecarlo/energythresholds/plot.C b/release_tests/montecarlo/energythresholds/plot.C index 31fcafe..53c8890 100644 --- a/release_tests/montecarlo/energythresholds/plot.C +++ b/release_tests/montecarlo/energythresholds/plot.C @@ -148,7 +148,7 @@ void plot( string runparameterfile ) fPar->print(); string e_dir = "$VERITAS_EVNDISP_AUX_DIR/EffectiveAreas/"; - string oDir = "../../../../EventDisplay_ReleaseTests_" + fPar->fVersion + "/energythresholds/"; + string oDir = "../../../../EventDisplay_Release_" + fPar->fVersion + "/energythresholds/"; // NSB axis depend on HV int min_nsb = 45; From 20131523abd18958259bab13215442c4743a44d3 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 28 May 2026 08:26:16 +0200 Subject: [PATCH 3/7] G3 --- README.md | 4 ++-- .../montecarlo/mc_data_comparison/compareDatawithMC.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e3f9171..afe0b8a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Eventdisplay Release Tests -## Introduction +# Introduction Releases of Eventdisplay are required to pass a list of testing procedures before being tagged for science analysis. @@ -9,7 +9,7 @@ Note that it is impossible to test every single IRF function and every single po This repository contains code and macros for release testing. Results of release tests are saved in separate repositories: -- [v492](https://github.com/VERITAS-Observatory/EventDisplay_Release_v492) +- v492](https://github.com/VERITAS-Observatory/EventDisplay_Release_v492) - [v491](https://github.com/VERITAS-Observatory/EventDisplay_Release_v491) - [v490](https://github.com/VERITAS-Observatory/EventDisplay_Release_v490) - [before v490](https://github.com/VERITAS-Observatory/Eventdisplay_ReleaseTests) diff --git a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh index 7c318db..440978b 100755 --- a/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh +++ b/release_tests/montecarlo/mc_data_comparison/compareDatawithMC.sh @@ -139,7 +139,7 @@ do do if [[ ${I: -1} == "w" ]] && [[ ${atm} == *"62"* ]]; then continue - elif [[ ${I: -1} == "s" ]] && [[ ${A} == *"61"* ]]; then + elif [[ ${I: -1} == "s" ]] && [[ ${atm} == *"61"* ]]; then continue fi From dc22850be58b63ae1c041aea8cbf8c762f28c192 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 28 May 2026 08:27:53 +0200 Subject: [PATCH 4/7] G4 --- 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 34a3d0a..913b3b1 100755 --- a/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh +++ b/release_tests/sources/Crab/runlist_generator_from_anasum_log.sh @@ -129,7 +129,7 @@ do elif [[ $w_offset != 0 ]]; then WOBB="$w_offset" else - WOBBB="0" + WOBB="0" fi echo "${R}: MAJOREPOCH ${MAJOREPOCH} EPOCH ${EPOCH} ELEVATION ${EL} ATM $ATM WOBBLE $WOBB OBSL $OBSL" From 532fc6ccfb2236a7a64bff9bee7e3388c7075cc0 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 28 May 2026 08:51:38 +0200 Subject: [PATCH 5/7] G5 --- .../sources/Crab/plot_energy_spectra.C | 7 +- release_tests/sources/Crab/plot_lightcurves.C | 8 +- release_tests/sources/Crab/plot_sensitivity.C | 44 ++++++---- .../Crab/plot_sensitivity_compare_cuts.C | 58 ++++++++----- release_tests/sources/Crab/plot_skymaps.C | 8 +- release_tests/utilities/parameters.C | 82 +++++++++++++++++++ 6 files changed, 158 insertions(+), 49 deletions(-) diff --git a/release_tests/sources/Crab/plot_energy_spectra.C b/release_tests/sources/Crab/plot_energy_spectra.C index 105d492..3fc3e6d 100644 --- a/release_tests/sources/Crab/plot_energy_spectra.C +++ b/release_tests/sources/Crab/plot_energy_spectra.C @@ -14,15 +14,14 @@ #include "TF1.h" -#include "../../utilitities/parameters.C" -#include "../../utilitities/printutilities.C" - -R__LOAD_LIBRARY(/afs/ifh.de/group/cta/scratch/maierg/EVNDISP/EVNDISP-400/GITHUB_Eventdisplay/EventDisplay_v491-al9/lib/libVAnaSum.so) +#include "../../utilities/parameters.C" +#include "../../utilities/printutilities.C" using namespace std; void plot_energy_spectra( string anasumfile, string figureDir ) { + if( !loadVAnaSumLibrary() ) return; // file with fit results ofstream osPL; diff --git a/release_tests/sources/Crab/plot_lightcurves.C b/release_tests/sources/Crab/plot_lightcurves.C index 826b44a..458f068 100644 --- a/release_tests/sources/Crab/plot_lightcurves.C +++ b/release_tests/sources/Crab/plot_lightcurves.C @@ -13,10 +13,8 @@ #include #include -#include "../../utilitities/parameters.C" -#include "../../utilitities/printutilities.C" - -R__LOAD_LIBRARY(/afs/ifh.de/group/cta/scratch/maierg/EVNDISP/EVNDISP-400/GITHUB_Eventdisplay/EventDisplay_v491-al9/lib/libVAnaSum.so) +#include "../../utilities/parameters.C" +#include "../../utilities/printutilities.C" double getMinMax( vector< double > iMJD, bool bMax ) { @@ -105,6 +103,8 @@ void plotAverageFlux( TCanvas *c, TGraphErrors *g, double fA, double fAE, int iC void plot_lightcurves( string anasumfile, string figureDir, double iEnergy_TeV ) { + if( !loadVAnaSumLibrary() ) return; + gSystem->mkdir( figureDir.c_str(), true ); if( iEnergy_TeV < 0. ) { diff --git a/release_tests/sources/Crab/plot_sensitivity.C b/release_tests/sources/Crab/plot_sensitivity.C index 334f944..b8c4fd8 100644 --- a/release_tests/sources/Crab/plot_sensitivity.C +++ b/release_tests/sources/Crab/plot_sensitivity.C @@ -5,18 +5,21 @@ #include -#include "../../utilitities/parameters.C" -#include "../../utilitities/printutilities.C" +#include "../../utilities/parameters.C" +#include "../../utilities/printutilities.C" -R__LOAD_LIBRARY(/afs/ifh.de/group/cta/scratch/maierg/EVNDISP/EVNDISP-400/GITHUB_Eventdisplay/EventDisplay_v491-al9/lib/libVAnaSum.so) - - -void plot_sensitivity() +void plot_sensitivity( string iVersion = "", + string iComparisonVersion = "" ) { + if( !loadVAnaSumLibrary() ) return; - string cut = "moderate2tel"; - string data_dir = "$VERITAS_USER_DATA_DIR/analysis/Results/"; + string iCut = "moderate2tel"; string anasum_file = "anasum_releaseTestingV6_SZE_0.5deg.combined.root"; + string iCurrentAnasum = getCrabAnasumPath( iVersion, iCut, "AP", anasum_file ); + if( iCurrentAnasum.size() == 0 ) + { + return; + } VSensitivityCalculator *b = new VSensitivityCalculator(); b->setFluxRange_CU(1.e-3, 10.); @@ -24,22 +27,29 @@ void plot_sensitivity() b->setPlottingStyle(633); TCanvas *c = b->plotDifferentialSensitivityvsEnergyFromCrabSpectrum( 0, - data_dir + "v491/AP/Crab/V6_" + cut + "/" + anasum_file, + iCurrentAnasum, 633, "CU" ); b->setPlottingStyle(633); b->plotDifferentialSensitivityvsEnergyFromCrabSpectrum( c, - data_dir + "v491/AP/Crab/V6_" + cut + "/" + anasum_file, + iCurrentAnasum, 633, "CU" ); - b->setPlottingStyle(12); - b->plotDifferentialSensitivityvsEnergyFromCrabSpectrum( - c, - data_dir + "v490/AP/Crab/V6_" + cut + "/" + anasum_file, - 12, "CU" - ); + if( iComparisonVersion.size() > 0 ) + { + string iComparisonAnasum = getCrabAnasumPath( iComparisonVersion, iCut, "AP", anasum_file ); + if( iComparisonAnasum.size() > 0 ) + { + b->setPlottingStyle(12); + b->plotDifferentialSensitivityvsEnergyFromCrabSpectrum( + c, + iComparisonAnasum, + 12, "CU" + ); + } + } TFile *fCTA = new TFile("/lustre/fs22/group/cta/users/maierg/analysis/AnalysisData/prod6-LaPalma-20deg-dark-sq230-LL/Phys-g20240826/DESY.g20240826.V3.ID0NIM3LST3MST3SST3SCMST3.prod6-LaPalma-20deg-dark-sq230-LL.N.Am-4LSTs09MSTs.180000s.root"); TH1F *hCTA = (TH1F*)fCTA->Get("DiffSensCU"); @@ -47,5 +57,5 @@ void plot_sensitivity() hCTA->SetLineColor(418); hCTA->Draw("hist same"); - printCanvas(c, "/SensitivityCU_" + cut, "./" ); + printCanvas(c, "/SensitivityCU_" + iCut, "./" ); } diff --git a/release_tests/sources/Crab/plot_sensitivity_compare_cuts.C b/release_tests/sources/Crab/plot_sensitivity_compare_cuts.C index af099d2..3fb4ef2 100644 --- a/release_tests/sources/Crab/plot_sensitivity_compare_cuts.C +++ b/release_tests/sources/Crab/plot_sensitivity_compare_cuts.C @@ -10,22 +10,23 @@ #include #include -#include "../../utilitities/parameters.C" -#include "../../utilitities/printutilities.C" +#include "../../utilities/parameters.C" +#include "../../utilities/printutilities.C" -R__LOAD_LIBRARY(/afs/ifh.de/group/cta/scratch/maierg/EVNDISP/EVNDISP-400/GITHUB_Eventdisplay/EventDisplay_v491-al9/lib/libVAnaSum.so) - - - -void plot_sensitivity_compare_one_cuts(double iObsTime=20., double iMinSigma=3., int iMinEvents=5) +void plot_sensitivity_compare_one_cuts( double iObsTime = 20., + double iMinSigma = 3., + int iMinEvents = 5, + string iVersion = "", + string iReferenceVersion = "" ) { + if( !loadVAnaSumLibrary() ) return; + double dE_log10 = 0.2; vector< string > cut; cut.push_back( "moderate2tel" ); cut.push_back( "soft2tel" ); cut.push_back( "hard2tel" ); cut.push_back( "hard3tel" ); - string data_dir = "$VERITAS_USER_DATA_DIR/analysis/Results/"; string anasum_file = "anasum_releaseTestingV6_SZE_0.5deg.combined.root"; vector< TGraphAsymmErrors* > sens_graph; @@ -37,30 +38,40 @@ void plot_sensitivity_compare_one_cuts(double iObsTime=20., double iMinSigma=3., TCanvas *c = 0; for( unsigned int i = 0; i < cut.size(); i++ ) { + string iCurrentAnasum = getCrabAnasumPath( iVersion, cut[i], "AP", anasum_file ); + if( iCurrentAnasum.size() == 0 ) return; + int color = VUtilities::color_id(i); b->setPlottingStyle(color, 1, 1., 20., 0.75); if( i == 0 ) { c = b->plotDifferentialSensitivityvsEnergyFromCrabSpectrum( 0, - data_dir + "v491/AP/Crab/V6_" + cut[i] + "/" + anasum_file, + iCurrentAnasum, color, "CU", dE_log10 ); } b->plotDifferentialSensitivityvsEnergyFromCrabSpectrum( c, - data_dir + "v491/AP/Crab/V6_" + cut[i] + "/" + anasum_file, + iCurrentAnasum, color, "CU", dE_log10 ); sens_graph.push_back( b->getSensitivityGraph() ); } - b->setPlottingStyle(VUtilities::color_id(cut.size()), 1, 1., 20., 0.75); - b->plotDifferentialSensitivityvsEnergyFromCrabSpectrum( - c, - "$VERITAS_USER_DATA_DIR/analysis/Results/v490/NN/Crab/V6_supersoftNN2tel/anasum_releaseTestingV6_SZE_0.5deg.combined.root", - VUtilities::color_id(cut.size()), "CU", dE_log10 - ); - sens_graph.push_back( b->getSensitivityGraph() ); + if( iReferenceVersion.size() > 0 ) + { + string iReferenceAnasum = getCrabAnasumPath( iReferenceVersion, "supersoftNN2tel", "NN", anasum_file ); + if( iReferenceAnasum.size() > 0 ) + { + b->setPlottingStyle(VUtilities::color_id(cut.size()), 1, 1., 20., 0.75); + b->plotDifferentialSensitivityvsEnergyFromCrabSpectrum( + c, + iReferenceAnasum, + VUtilities::color_id(cut.size()), "CU", dE_log10 + ); + sens_graph.push_back( b->getSensitivityGraph() ); + } + } TFile *fCTA = new TFile("/lustre/fs22/group/cta/users/maierg/analysis/AnalysisData/prod6-LaPalma-20deg-dark-sq230-LL/Phys-g20240826/DESY.g20240826.V3.ID0NIM3LST3MST3SST3SCMST3.prod6-LaPalma-20deg-dark-sq230-LL.N.Am-4LSTs09MSTs.180000s.root"); TH1F *hCTA = (TH1F*)fCTA->Get("DiffSensCU"); @@ -104,8 +115,15 @@ void plot_sensitivity_compare_one_cuts(double iObsTime=20., double iMinSigma=3., printCanvas(cRel, print_name.str() + "Rel", "./" ); } -void plot_sensitivity_compare_cuts() +void plot_sensitivity_compare_cuts( string iVersion = "", + string iReferenceVersion = "" ) { + if( iVersion.size() == 0 ) + { + const char* iVersionEnv = gSystem->Getenv( "VERITAS_EVNDISP_VERSION" ); + if( iVersionEnv ) iVersion = iVersionEnv; + } + vector< double > obs_time; obs_time.push_back( 100. ); obs_time.push_back( 50. ); @@ -115,7 +133,7 @@ void plot_sensitivity_compare_cuts() for( unsigned int i = 0; i < obs_time.size(); i++ ) { - plot_sensitivity_compare_one_cuts( obs_time[i], 3., 5 ); - plot_sensitivity_compare_one_cuts( obs_time[i], 5., 10 ); + plot_sensitivity_compare_one_cuts( obs_time[i], 3., 5, iVersion, iReferenceVersion ); + plot_sensitivity_compare_one_cuts( obs_time[i], 5., 10, iVersion, iReferenceVersion ); } } diff --git a/release_tests/sources/Crab/plot_skymaps.C b/release_tests/sources/Crab/plot_skymaps.C index 88c731a..98d905a 100644 --- a/release_tests/sources/Crab/plot_skymaps.C +++ b/release_tests/sources/Crab/plot_skymaps.C @@ -11,13 +11,13 @@ #include #include -#include "../../utilitities/parameters.C" -#include "../../utilitities/printutilities.C" - -R__LOAD_LIBRARY(/afs/ifh.de/group/cta/scratch/maierg/EVNDISP/EVNDISP-400/GITHUB_Eventdisplay/EventDisplay_v491-al9/lib/libVAnaSum.so) +#include "../../utilities/parameters.C" +#include "../../utilities/printutilities.C" void plot_skymaps( string anasumfile, string figureDir, bool skymaps = false ) { + if( !loadVAnaSumLibrary() ) return; + gSystem->mkdir( figureDir.c_str(), true ); VPlotAnasumHistograms f( anasumfile.c_str() ); diff --git a/release_tests/utilities/parameters.C b/release_tests/utilities/parameters.C index 62477dc..a6880a8 100644 --- a/release_tests/utilities/parameters.C +++ b/release_tests/utilities/parameters.C @@ -13,6 +13,88 @@ #include #include +/* + * 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" + */ +bool loadVAnaSumLibrary() +{ + static bool iLibraryLoaded = false; + if( iLibraryLoaded ) + { + return true; + } + + string iLibPath; + const char* iEnvLib = gSystem->Getenv( "VERITAS_VANASUM_LIBRARY" ); + if( iEnvLib ) + { + iLibPath = iEnvLib; + } + if( iLibPath.size() == 0 ) + { + const char* iEvndisp = gSystem->Getenv( "EVNDISP" ); + if( iEvndisp ) + { + iLibPath = string( iEvndisp ) + "/lib/libVAnaSum.so"; + } + } + + if( iLibPath.size() > 0 && !gSystem->AccessPathName( iLibPath.c_str() ) ) + { + if( gSystem->Load( iLibPath.c_str() ) >= 0 ) + { + iLibraryLoaded = true; + return true; + } + } + + if( gSystem->Load( "libVAnaSum.so" ) >= 0 ) + { + iLibraryLoaded = true; + return true; + } + + cout << "Error: unable to load libVAnaSum.so. " + << "Set VERITAS_VANASUM_LIBRARY or EVNDISP." << endl; + return false; +} + +/* + * Helper for release-test Crab products in the standard results tree. + */ +string getCrabAnasumPath( string iVersion, + string iCut, + string iAnalysisType = "AP", + string iAnasumFile = "anasum_releaseTestingV6_SZE_0.5deg.combined.root" ) +{ + if( iVersion.size() == 0 ) + { + const char* iVersionEnv = gSystem->Getenv( "VERITAS_EVNDISP_VERSION" ); + if( iVersionEnv ) + { + iVersion = iVersionEnv; + } + } + if( iVersion.size() == 0 ) + { + cout << "Error: release version not set (pass iVersion or set VERITAS_EVNDISP_VERSION)." << endl; + return ""; + } + + string iDataDir = "$VERITAS_USER_DATA_DIR/analysis/Results/"; + const char* iDataEnv = gSystem->Getenv( "VERITAS_USER_DATA_DIR" ); + if( iDataEnv ) + { + iDataDir = string( iDataEnv ) + "/analysis/Results/"; + } + + return iDataDir + iVersion + "/" + iAnalysisType + "/Crab/V6_" + iCut + "/" + iAnasumFile; +} + class RunParameterData { public: From 30f2fe281463187dbcbaa982a05db6318b590563 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 28 May 2026 09:07:12 +0200 Subject: [PATCH 6/7] precommit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f09276..bd67886 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: isort args: ["--profile", "black", "--filter-files"] - repo: https://github.com/psf/black - rev: 26.5.0 + rev: 26.5.1 hooks: - id: black args: ["--line-length=100"] From b5fd0f22a6d66d7a6766d9c4c24cf3abab2f71f6 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 28 May 2026 09:09:26 +0200 Subject: [PATCH 7/7] G7 --- .../sources/Crab/anasum_from_runlists.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/release_tests/sources/Crab/anasum_from_runlists.sh b/release_tests/sources/Crab/anasum_from_runlists.sh index af0628b..7f3226d 100755 --- a/release_tests/sources/Crab/anasum_from_runlists.sh +++ b/release_tests/sources/Crab/anasum_from_runlists.sh @@ -32,12 +32,20 @@ MEPOCH=($(grep MAJOREPOCH ${1} | grep "*" | awk '{print $3}')) # Source name OBJECT=($(grep SOURCE ${1} | grep "*" | awk '{print $3}')) CUTS="" -while IFS= read -r line; do - if [[ $line == "* CUT"* ]]; then - # Extract the fourth column from the line - CUTS="$CUTS $(echo "$line" | awk '{print $4}')" +# CUT lines contain both a full cut token and a short alias. +# Always consume the alias in field 4 to avoid mixing naming schemes. +while IFS= read -r cut_alias; do + if [[ -z "$cut_alias" ]]; then + echo "Error, malformed '* CUT' line in runparameter file: ${1}" + exit 1 fi -done < "${1}" + CUTS="$CUTS $cut_alias" +done < <(awk '/^\* CUT[[:space:]]+/ { if (NF < 4) { print ""; next } print $4 }' "${1}") + +if [[ -z "$CUTS" ]]; then + echo "Error, no CUT aliases (field 4 of '* CUT' lines) found in runparameter file: ${1}" + exit 1 +fi echo "CUTS $CUTS" # run lists