diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 186e1ac..2f09276 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: # https://pycqa.github.io/isort/docs/configuration/black_compatibility.html#integration-with-pre-commit - repo: https://github.com/pycqa/isort - rev: 7.0.0 + rev: 9.0.0a3 hooks: - id: isort args: ["--profile", "black", "--filter-files"] - repo: https://github.com/psf/black - rev: 25.12.0 + rev: 26.5.0 hooks: - id: black args: ["--line-length=100"] diff --git a/CITATION.cff b/CITATION.cff index ddbe445..ee21c34 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,8 +4,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using these metadata. title: "Eventdisplay Release Tests" # doi: 10.5281/zenodo.3559075 -version: 4.91.0 -date-released: 2024-11-30 +version: 4.92.0 +date-released: 2026-05-18 keywords: - "gamma-ray astronomy" - "astronomy software" @@ -19,7 +19,3 @@ authors: family-names: Maier affiliation: DESY orcid: https://orcid.org/0000-0001-9868-4700 -- given-names: M. - family-names: Nievas -- given-names: S. - family-names: Patel diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b94321d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Welcome to the Eventdisplay contributing guidelines + +You are very welcome to contribute to Eventdisplay! + +## Reporting Issues + +Please try to be as concise as possible when reporting issue. Whenever possible add a small code example and a clear description of the problem. + +Report your system configuration by pasting the output of the following command to the issue: + +```console +make config +``` + +## Contributing Code + +Best to contact the developers first or to open an issue describe the new development before starting a larger project. + +Eventdisplay is an old project and without strict coding guidelines. Please provide reasonable structured and readable code. + +## Contributing Documentation + +Documentation is always incomplete and contributions are welcome - either to the markdown-based documentation in this repository or on the [VERITAS wiki page](https://veritas.sao.arizona.edu/wiki/Eventdisplay_Manual). + +## Authorship and Credits + +We distinguish between "Contributors" and "Authors" to ensure fair credit: + +* **Contributors:** Every person who contributes code or documentation is a contributor. You will be automatically credited in our git history, see the [Contributors](https://github.com/VERITAS-Observatory/EventDisplay_ReleaseTests_code/graphs/contributors?all=1) GitHub page. +* **Authors:** Authors are individuals who have made substantial or sustained contributions to the project. Authorship recognizes contributions and requires individuals to take responsibility for the project. +Authors are listed in the [CITATION.cff](CITATION.cff) file. diff --git a/LICENSE b/LICENSE index 07563aa..a259a5b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2022-2025 Eventdisplay Developers & Gernot Maier (DESY). +Copyright (c) 2022-2026 Eventdisplay Developers & Gernot Maier (DESY). All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/environment.yml b/environment.yml index 78cd6e5..161c0e2 100644 --- a/environment.yml +++ b/environment.yml @@ -6,7 +6,7 @@ dependencies: - pre-commit - towncrier -# cheatsheet +# cheat sheet # create: conda env create -f environment.yml # activate: conda activate eventdisplay-release-tests # update (conda/mamba): conda env update -f environment.yml --prune diff --git a/release_tests/montecarlo/irf_plotting/README.md b/release_tests/montecarlo/irf_plotting/README.md index bbf08e5..871c57e 100644 --- a/release_tests/montecarlo/irf_plotting/README.md +++ b/release_tests/montecarlo/irf_plotting/README.md @@ -1,13 +1,12 @@ # IRF plotting -**in development - not working yet** +plot effective areas and angular resolution for all points in parameter space -Goal: plot effective areas and angular resolution for all points in parameter space +use `irf_plotting.sh`, but note some hardwired values. -Note: only skeleton yet, missing is the loop over the full parameter space -## Usage +e.g. -```console -root -l -q -b 'plot_effectiveAreas.C' +``` +./irf_plotting.sh /afs/ifh.de/group/cta/scratch/maierg/EVNDISP/EVNDISP-400/GITHUB_Eventdisplay/EventDisplay_Release_v492/runparameter/V6.AP.runparameter.dat ``` diff --git a/release_tests/montecarlo/irf_plotting/irf_plotting.sh b/release_tests/montecarlo/irf_plotting/irf_plotting.sh index d8f6db4..02ddf03 100755 --- a/release_tests/montecarlo/irf_plotting/irf_plotting.sh +++ b/release_tests/montecarlo/irf_plotting/irf_plotting.sh @@ -15,12 +15,13 @@ fi #### TEMP FIXED VALUES CUT="NTel3-PointSource-Hard-TMVA-BDT" -CUT="NTel2-PointSource-Moderate-TMVA-BDT" CUT="NTel2-PointSource-Soft-TMVA-BDT" +CUT="NTel2-PointSource-Moderate-TMVA-BDT" CUT="NTel2-PointSource-Moderate" -# Comparision plots - version and simtype hardwired -COMPAREVERSION="v490" -COMPARESIMTYPE="CARE_June2020" +# Comparison plots - version and simtype hardwired +COMPAREVERSION="v492" +COMPARESIMTYPE="CARE_202404" +COMPARECUT="NTel2-PointSource-ModerateXGB" #### (END TEMP FIXED VALUES) # Analysis type @@ -71,7 +72,7 @@ do fi for A in "${ATMO[@]}" do - if [[ ${E} == "V6_2023_2024w" ]] && [[ ${A} == "61" ]]; then + if [[ ${E} == "V6_2016_2017" ]] && [[ ${A} == "61" ]]; then IRFDIR="${DDIR}/${E}_ATM${A}_gamma/EffectiveAreas_Cut-${CUT}_DISP" IRFFILE="EffArea-${SIMTYPE}-${E}-ID0-Ze${Z}deg-${W}wob-${N}-Cut-${CUT}" echo "IRFDIR $IRFDIR" @@ -80,11 +81,14 @@ do COMP_IRFDIR=${IRFDIR//"$VERSION"/"$COMPAREVERSION"} COMP_IRFDIR=${COMP_IRFDIR//"$SIMTYPE"/"$COMPARESIMTYPE"} COMP_IRFFILE=${IRFFILE//"$SIMTYPE"/"$COMPARESIMTYPE"} - echo "IRFDIR (comparision): $COMP_IRFDIR" - echo "IRFFILE (comparision): $COMP_IRFFILE" - root -l -q -b "plot_irf.C(\"${IRFDIR}\",\"${IRFFILE}\",\"${E}\",\"${A}\",\"${CUT}\",\"${Z}\",\"${W}\",\"${N}\",\"${ODIR}\", \"${COMP_IRFDIR}\",\"${COMP_IRFFILE}\")" + # compare TMVA with XGB file + COMP_IRFDIR=${COMP_IRFDIR//"$CUT"/"$COMPARECUT"} + COMP_IRFFILE=${COMP_IRFFILE//"$CUT"/"$COMPARECUT"} + echo "COMPIRFDIR (comparison): $COMP_IRFDIR" + echo "COMPIRFFILE (comparison): $COMP_IRFFILE" + root -l -q -b "plot_irf.C(\"${IRFDIR}\",\"${IRFFILE}\",\"${E}\",\"${A}\",\"${CUT}\",\"${Z}\",\"${W}\",\"${N}\",\"${MCAZ}\",\"${ODIR}\", \"${COMP_IRFDIR}\",\"${COMP_IRFFILE}\")" else - root -l -q -b "plot_irf.C(\"${IRFDIR}\",\"${IRFFILE}\",\"${E}\",\"${A}\",\"${CUT}\",\"${Z}\",\"${W}\",\"${N}\",\"${ODIR}\")" + root -l -q -b "plot_irf.C(\"${IRFDIR}\",\"${IRFFILE}\",\"${E}\",\"${A}\",\"${CUT}\",\"${Z}\",\"${W}\",\"${N}\",\"${MCAZ}\",\"${ODIR}\")" fi fi done diff --git a/release_tests/montecarlo/irf_plotting/plot_effectiveAreas.C b/release_tests/montecarlo/irf_plotting/plot_effectiveAreas.C deleted file mode 100644 index 7cc65e4..0000000 --- a/release_tests/montecarlo/irf_plotting/plot_effectiveAreas.C +++ /dev/null @@ -1,52 +0,0 @@ -/* - * compare effective areas between two epochs - * - * - * root -l -q -b 'plot_effectiveAreas.C' - * - */ - -#include -#include - -void printCanvas( TCanvas *c, string iName ) -{ - string iSuffix = ".pdf"; - if( c ) - { - string iPrintName = iName + iSuffix; - c->Print( ("figures/"+iPrintName).c_str() ); - } -} - - -void plot_effectiveAreas( string Epoch1 = "2012_2013a", string Epoch2 = "2019_2020", string iCut = "Soft", bool iRedHV = false ) -{ - int i_load = gSystem->Load( "$EVNDISPSYS/lib/libVAnaSum.so" ); - if( i_load < 0 ) - { - cout << "Error loading shared library" << endl; - return; - } - - string iEffAreaDir = "$VERITAS_EVNDISP_AUX_DIR/EffectiveAreas/"; - - string Epoch1_file = "effArea-v483-auxv01-CARE_RedHV-Cut-NTel2-PointSource-" + iCut + "-TMVA-BDT-GEO-V6_"; - Epoch1_file += Epoch1 + "-ATM61-T1234.root"; - string Epoch2_file = "effArea-v483-auxv01-CARE_RedHV-Cut-NTel2-PointSource-" + iCut + "-TMVA-BDT-GEO-V6_"; - Epoch2_file += Epoch2 + "-ATM61-T1234.root"; - - string v480_file = "/lustre/fs19/group/cta/VERITAS//analysis/AnalysisData-VTS-v470/EffectiveAreas/"; - v480_file += "effArea-v470-auxv01-CARE-Cut-NTel2-PointSource-Soft-GEO-V6-ATM21-redHV-T1234.root"; - - VPlotInstrumentResponseFunction a; - a.addInstrumentResponseData( (iEffAreaDir+Epoch1_file).c_str(), 20., 0.5, 0, 1.6, 150); - a.addInstrumentResponseData( (iEffAreaDir+Epoch2_file).c_str(), 20., 0.5, 0, 1.6, 150); - //a.addInstrumentResponseData( v480_file.c_str(), 20., 0.5, 0, 1.5, 200); - //a.addInstrumentResponseData("/lustre/fs19/group/cta/users/maierg/VERITAS/analysis/Results/v483/CARE_RedHV/V6_2012_2013a_ATM61_gamma/EffectiveAreas_Cut-NTel2-PointSource-Soft/EffArea-CARE_RedHV-V6_2012_2013a-ID0-Ze20deg-0.5wob-150-Cut-NTel2-PointSource-Soft.root", 20., 0.5, 0, 1.6, 150); - - TCanvas *cEff = (TCanvas*)a.plotEffectiveArea( 4.e5 ); - printCanvas( cEff, "effArea_" + iCut + "_" + Epoch1 + "-" + Epoch2 ); - TCanvas *cEffRatio = (TCanvas*)a.plotEffectiveAreaRatio(); - printCanvas( cEffRatio, "effAreaRatio_" + iCut + "_" + Epoch1 + "-" + Epoch2 ); -} diff --git a/release_tests/montecarlo/irf_plotting/plot_irf.C b/release_tests/montecarlo/irf_plotting/plot_irf.C index 3b1d916..cfcc655 100644 --- a/release_tests/montecarlo/irf_plotting/plot_irf.C +++ b/release_tests/montecarlo/irf_plotting/plot_irf.C @@ -7,14 +7,19 @@ #include #include +#include "TImage.h" + R__LOAD_LIBRARY($EVNDISPSYS/lib/libVAnaSum.so); void printCanvas( TCanvas *c, string iName, string oDir ) { - string iSuffix = ".pdf"; + string iSuffix = ".png"; if( c ) { string iPrintName = iName + iSuffix; + c->SetCanvasSize(c->GetWw()*2, c->GetWh()*2); + c->Modified(); + c->Update(); c->Print( (oDir+"/"+iPrintName).c_str() ); } } @@ -32,21 +37,24 @@ void plot_irf( string ze = "20", string woff = "0.5", string nsb = "200", + string az = "0", string odir = "./figures/", string IRFDirectory_compare = "", string IRFFile_compare = "" ) { + float base_index = 1.5; + VPlotInstrumentResponseFunction a; a.addInstrumentResponseData( (IRFDirectory+"/"+IRFFile+".root").c_str(), - atoi(ze.c_str()), atof(woff.c_str()), 0, 1.6, atoi(nsb.c_str()), "A_MC", + atoi(ze.c_str()), atof(woff.c_str()), atoi(az.c_str()), base_index, atoi(nsb.c_str()), "A_MC", -99, -99, -99, 1.5 ); if( IRFDirectory_compare.size() > 0 && IRFFile.size() > 0 ) { a.addInstrumentResponseData( (IRFDirectory_compare+"/"+IRFFile_compare+".root").c_str(), - atoi(ze.c_str()), atof(woff.c_str()), 0, 1.6, atoi(nsb.c_str()), "A_MC", + atoi(ze.c_str()), atof(woff.c_str()), atoi(az.c_str()), base_index, atoi(nsb.c_str()), "A_MC", -99, -99, -99, 1.5 ); } a.setPlottingAxis( "energy_Lin", "X", false, 0.05, 100., "energy [TeV]" ); @@ -109,11 +117,12 @@ void plot_irf( c = a.plotEnergyReconstructionBias("mean", -0.4, 0.4); printCanvas( c, "EBias_"+IRFFile, odir); + /* // plot comparision of 4 and 3-telescope effective areas VPlotInstrumentResponseFunction b; b.addInstrumentResponseData( (IRFDirectory+"/"+IRFFile+".root").c_str(), - atoi(ze.c_str()), atof(woff.c_str()), 0, 1.6, atoi(nsb.c_str()), "A_MC", + atoi(ze.c_str()), atof(woff.c_str()), 0, base_index, atoi(nsb.c_str()), "A_MC", -99, -99, -99, 1.5 ); for( unsigned int i = 2; i <=5; i++ ) { @@ -121,7 +130,7 @@ void plot_irf( IRFFile3Tel.replace(IRFFile3Tel.find("ID0"), 3, "ID" + std::to_string(i) ); b.addInstrumentResponseData( (IRFDirectory+"/"+IRFFile3Tel+".root").c_str(), - atoi(ze.c_str()), atof(woff.c_str()), 0, 1.6, atoi(nsb.c_str()), "A_MC", + atoi(ze.c_str()), atof(woff.c_str()), 0, base_index, atoi(nsb.c_str()), "A_MC", -99, -99, -99, 1.5 ); } b.setPlottingAxis( "energy_Lin", "X", false, 0.05, 100., "energy [TeV]" ); @@ -129,6 +138,6 @@ void plot_irf( printCanvas( c, "EffArea3Tel_"+IRFFile, odir); c = b.plotEffectiveAreaRatio( 0, 0., 2. ); - printCanvas( c, "EffArea3TelRatio_"+IRFFile, odir); + printCanvas( c, "EffArea3TelRatio_"+IRFFile, odir); */ } diff --git a/release_tests/sources/Crab/README.md b/release_tests/sources/Crab/README.md index a7b9a9c..34f56af 100644 --- a/release_tests/sources/Crab/README.md +++ b/release_tests/sources/Crab/README.md @@ -13,7 +13,7 @@ Parameters required for the analysis are all listed in parameter files. This inc - object to be analyzed - ... -Most important parameter files are: +Most important parameter files are (examples for v491): - [AP StdHV V6](https://github.com/VERITAS-Observatory/EventDisplay_Release_v491/blob/main/runparameter/V6.AP.runparameter.dat) - [AP RedHV V6](https://github.com/VERITAS-Observatory/EventDisplay_Release_v491/blob/main/runparameter/V6redHV.AP.runparameter.dat) diff --git a/release_tests/sources/Crab/runlist_releaseTestingV6.dat b/release_tests/sources/Crab/runlist_releaseTestingV6.dat index 8690547..10bc219 100644 --- a/release_tests/sources/Crab/runlist_releaseTestingV6.dat +++ b/release_tests/sources/Crab/runlist_releaseTestingV6.dat @@ -969,3 +969,62 @@ 110899 110999 111000 +111332 +111425 +112774 +112797 +112799 +112810 +112829 +112831 +112854 +112855 +112870 +112905 +112906 +112926 +112927 +112973 +113073 +113074 +113224 +113298 +113299 +113303 +113352 +113375 +113515 +113637 +113689 +113704 +113710 +113724 +113749 +113790 +113830 +113840 +113841 +113842 +113877 +113878 +113879 +113880 +113881 +113882 +113883 +113884 +113885 +113886 +113887 +113888 +113890 +113891 +113892 +113893 +113894 +113895 +113896 +113897 +113963 +113994 +113995 diff --git a/release_tests/sources/Crab/runlist_releaseTestingV6redHV.dat b/release_tests/sources/Crab/runlist_releaseTestingV6redHV.dat index ff67c27..df43692 100644 --- a/release_tests/sources/Crab/runlist_releaseTestingV6redHV.dat +++ b/release_tests/sources/Crab/runlist_releaseTestingV6redHV.dat @@ -94,6 +94,7 @@ 107016 107019 107038 +107099 107417 107418 107463 @@ -103,3 +104,31 @@ 107857 107859 107861 +107882 +109598 +109599 +109600 +109601 +109624 +109625 +109626 +110078 +110381 +110466 +110467 +110482 +110483 +110488 +110770 +110771 +110772 +111168 +111169 +111247 +112981 +113001 +113594 +113619 +113658 +113711 +113989 diff --git a/release_tests/utilitities/parameters.C b/release_tests/utilities/parameters.C similarity index 100% rename from release_tests/utilitities/parameters.C rename to release_tests/utilities/parameters.C diff --git a/release_tests/utilitities/printutilities.C b/release_tests/utilities/printutilities.C similarity index 100% rename from release_tests/utilitities/printutilities.C rename to release_tests/utilities/printutilities.C diff --git a/release_tests/utilitities/test.runparameter.dat b/release_tests/utilities/test.runparameter.dat similarity index 100% rename from release_tests/utilitities/test.runparameter.dat rename to release_tests/utilities/test.runparameter.dat diff --git a/towncrier.toml b/towncrier.toml index b278ea1..cf5cd19 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -8,7 +8,7 @@ issue_format = "[#{issue}](https://github.com/VERITAS-Observatory/EventDisplay_R start_string = "\n" [tool.towncrier.fragment.feature] -name = "New Feature" +name = "New Features" showcontent = true [tool.towncrier.fragment.bugfix]