From c2ab193077ba33925c04923066f90a92b647cee4 Mon Sep 17 00:00:00 2001 From: Kamil Skwarczynski Date: Fri, 20 Dec 2024 17:42:23 +0000 Subject: [PATCH 1/2] Use doxygen to add authros to several classes to give credits to people who did plenty of content ove the years --- Diagnostics/CombineMaCh3Chains.cpp | 4 ++++ covariance/PCAHandler.h | 1 + manager/MaCh3Modes.h | 1 + mcmc/MCMCProcessor.h | 23 ++++++++++++++--------- mcmc/MinuitFit.h | 3 ++- mcmc/PSO.h | 8 ++++++-- mcmc/SampleSummary.h | 2 ++ mcmc/StatisticalUtils.h | 1 + mcmc/gpuMCMCProcessorUtils.cuh | 3 +++ mcmc/mcmc.h | 1 + plotting/GetPostfitParamPlots.cpp | 6 +++++- plotting/PlotLLH.cpp | 3 +++ plotting/plottingUtils/plottingManager.h | 1 + plotting/plottingUtils/styleManager.h | 1 + samplePDF/samplePDFFDBase.h | 2 ++ splines/SplineMonolith.h | 2 ++ splines/splineFDBase.h | 3 +++ 17 files changed, 52 insertions(+), 13 deletions(-) diff --git a/Diagnostics/CombineMaCh3Chains.cpp b/Diagnostics/CombineMaCh3Chains.cpp index 628dbd6ed..7c53f4e04 100644 --- a/Diagnostics/CombineMaCh3Chains.cpp +++ b/Diagnostics/CombineMaCh3Chains.cpp @@ -11,6 +11,10 @@ // MaCh3 includes #include "manager/manager.h" +/// @file CombineMaCh3Chains +/// @author Ewan Miller +/// @author Kamil Skwarczynski + std::string OutFileName = ""; int targetCompression = 1; std::vector inpFileList; diff --git a/covariance/PCAHandler.h b/covariance/PCAHandler.h index 22e91c326..5d17cb727 100644 --- a/covariance/PCAHandler.h +++ b/covariance/PCAHandler.h @@ -26,6 +26,7 @@ /// @brief Class responsible for handling Principal Component Analysis (PCA) of covariance matrix /// @see For more details, visit the [Wiki](https://github.com/mach3-software/MaCh3/wiki/03.-Eigen-Decomposition-%E2%80%90-PCA). +/// @author Clarence Wret class PCAHandler{ public: diff --git a/manager/MaCh3Modes.h b/manager/MaCh3Modes.h index 9261f9f42..c8d9f92f0 100644 --- a/manager/MaCh3Modes.h +++ b/manager/MaCh3Modes.h @@ -30,6 +30,7 @@ struct MaCh3ModeInfo { /// @brief KS: Class describing MaCh3 modes used in the analysis, it is being initialised from config /// @see For more details, visit the [Wiki](https://github.com/mach3-software/MaCh3/wiki/08.-MaCh3-Modes). +/// @author Kamil Skwarczynski class MaCh3Modes { public: /// @brief KS: Initialise MaCh3 modes diff --git a/mcmc/MCMCProcessor.h b/mcmc/MCMCProcessor.h index 7b0b0d7e6..b278ab160 100644 --- a/mcmc/MCMCProcessor.h +++ b/mcmc/MCMCProcessor.h @@ -60,6 +60,8 @@ enum ParameterEnum { /// @brief Class responsible for processing MCMC chains, performing diagnostics, generating plots, and managing Bayesian analysis. /// @details This class provides utilities to handle MCMC output generated by mcmc::runMCMC. It is particularly useful for extracting values from previous MCMC runs and initiating new MCMC runs with those values. Inspired by nd280_utils/DrawComp.cpp. /// @see For more details and examples, visit the [Wiki](https://github.com/mach3-software/MaCh3/wiki/09.-Bayesian-Analysis,-Plotting-and-MCMC-Processor). +/// @author Clarence Wret +/// @author Kamil Skwarczynski class MCMCProcessor { public: /// @brief Constructs an MCMCProcessor object with the specified input file and options. @@ -80,7 +82,8 @@ class MCMCProcessor { /// @param Mute Allow silencing many messages, especially important if we calculate matrix many times void MakeCovariance_MP(const bool Mute = false); /// @brief Make and Draw SubOptimality - /// \cite roberts2009adaptive + /// @cite roberts2009adaptive + /// @author Henry Wallace void MakeSubOptimality(const int NIntervals = 10); /// @brief Reset 2D posteriors, in case we would like to calculate in again with different BurnInCut @@ -307,6 +310,7 @@ class MCMCProcessor { /// @brief KS: Calculate autocorrelations supports both OpenMP and CUDA :) inline void AutoCorrelation(); /// @brief MJR: Autocorrelation function using FFT algorithm for extra speed + /// @author Michael Reh inline void AutoCorrelation_FFT(); /// @brief KS: calc Effective Sample Size /// @param nLags Should be the same nLags as used in AutoCorrelation() @@ -315,24 +319,25 @@ class MCMCProcessor { /// This function computes the Effective Sample Size (ESS) using the autocorrelations /// calculated by AutoCorrelation(). Ensure that the parameter nLags here matches /// the number of lags used in AutoCorrelation() to obtain accurate results. - /// \cite StanManual - /// \cite hanson2008mcmc - /// \cite gabry2024visual + /// @cite StanManual + /// @cite hanson2008mcmc + /// @cite gabry2024visual inline void CalculateESS(const int nLags, const std::vector>& LagL); /// @brief Get the batched means variance estimation and variable indicating if number of batches is sensible - /// \cite chakraborty2019estimating - /// \cite rossetti2024batch + /// @cite chakraborty2019estimating + /// @cite rossetti2024batch inline void BatchedAnalysis(); /// @brief CW: Batched means, literally read from an array and chuck into TH1D inline void BatchedMeans(); /// @brief Geweke Diagnostic based on the methods described by Fang (2014) and Karlsbakk (2011). - /// \cite Fang2014GewekeDiagnostics - /// \cite karlsbakk2011 + /// @cite Fang2014GewekeDiagnostics + /// @cite karlsbakk2011 inline void GewekeDiagnostic(); /// @brief Acceptance Probability inline void AcceptanceProbabilities(); /// @brief RC: Perform spectral analysis of MCMC - /// \cite Dunkley:2004sv + /// @cite Dunkley:2004sv + /// @author Richard Calland inline void PowerSpectrumAnalysis(); /// Name of MCMC file diff --git a/mcmc/MinuitFit.h b/mcmc/MinuitFit.h index 710769e8c..618977f0d 100644 --- a/mcmc/MinuitFit.h +++ b/mcmc/MinuitFit.h @@ -9,7 +9,8 @@ #include "Math/Functor.h" /// @brief Implementation of Minuit fitting algorithm -/// \cite James:2004xla +/// @cite James:2004xla +/// @author Kamil Skwarczynski class MinuitFit : public LikelihoodFit { public: /// @brief Constructor diff --git a/mcmc/PSO.h b/mcmc/PSO.h index 9baf0758e..45def0d75 100644 --- a/mcmc/PSO.h +++ b/mcmc/PSO.h @@ -11,7 +11,9 @@ /// @brief Class particle - stores the position, velocity and personal best /// With functions which move particle and update velocity -/// @note Created by Emily Ip on 24/2/2023. +/// @author Emily Ip +/// @author Mark Scott +/// @date 24/2/2023 class particle{ public: particle(){}; @@ -69,7 +71,9 @@ class particle{ /// @brief Class PSO, consist of a vector of object Class Particle and global best /// Takes in the size (number of particle) and number of iteration /// functions includes: finding global best, updating velocity, actual minimisation function -/// @note Created by Emily Ip on 24/2/2023. +/// @author Emily Ip +/// @author Mark Scott +/// @date 24/2/2023 class PSO : public LikelihoodFit { public: /// @brief constructor diff --git a/mcmc/SampleSummary.h b/mcmc/SampleSummary.h index 19867aee9..50c035e5d 100644 --- a/mcmc/SampleSummary.h +++ b/mcmc/SampleSummary.h @@ -20,6 +20,8 @@ namespace M3 { // ******************* /// @brief Class to calculate pvalue produce posterior predictive and many fancy Bayesian stuff \cite gelman1996posterior /// @details For more information, visit the [Wiki](https://github.com/mach3-software/MaCh3/wiki/10.-Posterior-Predictive,-p%E2%80%90value-etc.). +/// @author Clarence Wret +/// @author Kamil Skwarczynski class SampleSummary { // ******************* public: diff --git a/mcmc/StatisticalUtils.h b/mcmc/StatisticalUtils.h index e44b1a74b..2889abbc4 100644 --- a/mcmc/StatisticalUtils.h +++ b/mcmc/StatisticalUtils.h @@ -14,6 +14,7 @@ /// @file StatisticalUtils.h /// @brief Utility functions for statistical interpretations in MaCh3 +/// @author Kamil Skwarczynski // ************************** /// @brief KS: Following H. Jeffreys \cite jeffreys1998theory diff --git a/mcmc/gpuMCMCProcessorUtils.cuh b/mcmc/gpuMCMCProcessorUtils.cuh index d3e1e6417..f64fa17eb 100644 --- a/mcmc/gpuMCMCProcessorUtils.cuh +++ b/mcmc/gpuMCMCProcessorUtils.cuh @@ -9,6 +9,9 @@ #include "manager/gpuUtils.cuh" +/// @file gpuMCMCProcessorUtils +/// @author Kamil Skwarczynski + /// @brief KS: Initialiser, here we allocate memory for variables and copy constants /// @param ParStep_gpu Parameter value at each step /// @param NumeratorSum_gpu Sum used for nominator of autocorrelation calculations diff --git a/mcmc/mcmc.h b/mcmc/mcmc.h index 9bb963aca..a3ec5927f 100644 --- a/mcmc/mcmc.h +++ b/mcmc/mcmc.h @@ -3,6 +3,7 @@ #include "mcmc/FitterBase.h" /// @brief Implementation of MR2T2 algorithm +/// @author Asher Kaboth class mcmc : public FitterBase { public: /// @brief Constructor diff --git a/plotting/GetPostfitParamPlots.cpp b/plotting/GetPostfitParamPlots.cpp index d4e188924..1733a6886 100644 --- a/plotting/GetPostfitParamPlots.cpp +++ b/plotting/GetPostfitParamPlots.cpp @@ -23,6 +23,7 @@ #include "plottingUtils/plottingUtils.h" #include "plottingUtils/plottingManager.h" +/// @file GetPostfitParamPlots /// This script generates post-fit parameter plots. The central postfit value is /// taken as the Highest Posterior Density (HPD), but can be easily changed to /// another method such as Gaussian. Be cautious as parameter names and the number @@ -34,7 +35,10 @@ /// ./GetPostfitParamPlots ProcessMCMC_Output1.root /// ``` /// -/// @note Originally written by Clarence, with changes by Will, updates by Kamil, and converted to a generic plotter by Ewan. +/// @author Clarence Wret +/// @author Will Parker +/// @author Kamil Skwarczynski +/// @author Ewan Miller //this file has lots of usage of the ROOT plotting interface that only takes floats, turn this warning off for this CU for now #pragma GCC diagnostic ignored "-Wfloat-conversion" diff --git a/plotting/PlotLLH.cpp b/plotting/PlotLLH.cpp index 5dde77b11..74c5979fe 100644 --- a/plotting/PlotLLH.cpp +++ b/plotting/PlotLLH.cpp @@ -9,6 +9,9 @@ #pragma GCC diagnostic ignored "-Wfloat-conversion" #pragma GCC diagnostic ignored "-Wconversion" +/// @file PlotLLH +/// @author Ewan Miller + // some options for the plots double ratioPlotSplit; double yTitleOffset; diff --git a/plotting/plottingUtils/plottingManager.h b/plotting/plottingUtils/plottingManager.h index 24db459e4..95fe9f940 100644 --- a/plotting/plottingUtils/plottingManager.h +++ b/plotting/plottingUtils/plottingManager.h @@ -34,6 +34,7 @@ namespace MaCh3Plotting { /// any style options you like from the StyleManager. Also a hopefully not too distant dream is to /// wrap this up in python so it is usable in .py scripts to take advantage of nice existing /// plotting libraries for e.g. MCMC plotting. +/// @author Ewan Miller class PlottingManager { public: // EM: cant make these static as std::getenv("MACH3") not known at compile time diff --git a/plotting/plottingUtils/styleManager.h b/plotting/plottingUtils/styleManager.h index bccc5d282..4b1290402 100644 --- a/plotting/plottingUtils/styleManager.h +++ b/plotting/plottingUtils/styleManager.h @@ -11,6 +11,7 @@ #include "TStyle.h" namespace MaCh3Plotting { +/// @author Ewan Miller class StyleManager { public: /// @brief Constructor diff --git a/samplePDF/samplePDFFDBase.h b/samplePDF/samplePDFFDBase.h index 1c19d9a79..2217c248e 100644 --- a/samplePDF/samplePDFFDBase.h +++ b/samplePDF/samplePDFFDBase.h @@ -13,6 +13,8 @@ class OscillatorBase; /// @brief Class responsible for handling implementation of samples used in analysis, reweighting and returning LLH +/// @author Dan Barrow +/// @author Ed Atkin class samplePDFFDBase : public samplePDFBase { public: diff --git a/splines/SplineMonolith.h b/splines/SplineMonolith.h index 5eb1ee46b..67569c905 100644 --- a/splines/SplineMonolith.h +++ b/splines/SplineMonolith.h @@ -7,6 +7,8 @@ class SMonolithGPU; /// @brief Even-by-event class calculating response for spline parameters. It is possible to use GPU acceleration /// @see For more details, visit the [Wiki](https://github.com/mach3-software/MaCh3/wiki/05.-Splines). +/// @author Clarence Wret +/// @author Kamil Skwarczynski class SMonolith : public SplineBase { public: /// @brief Constructor diff --git a/splines/splineFDBase.h b/splines/splineFDBase.h index d4bcfbb41..253a21303 100644 --- a/splines/splineFDBase.h +++ b/splines/splineFDBase.h @@ -9,6 +9,9 @@ /// @brief Bin-by-bin class calculating response for spline parameters. /// @see For more details, visit the [Wiki](https://github.com/mach3-software/MaCh3/wiki/05.-Splines). +/// @author Dan Barrow +/// @author Ed Atkin +/// @author Henry Wallace class splineFDBase : public SplineBase { /// @todo ETA - do all of these functions and members actually need to be public? public: From 93517402308f06dd89b6e874f4c5b748b4cd9fe3 Mon Sep 17 00:00:00 2001 From: Kamil Skwarczynski Date: Fri, 20 Dec 2024 17:44:33 +0000 Subject: [PATCH 2/2] some more --- covariance/covarianceXsec.h | 3 +++ manager/manager.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/covariance/covarianceXsec.h b/covariance/covarianceXsec.h index fe8308234..72d3f9357 100644 --- a/covariance/covarianceXsec.h +++ b/covariance/covarianceXsec.h @@ -6,6 +6,9 @@ /// @brief Class responsible for handling of systematic error parameters with different types defined in the config. Like spline, normalisation parameters etc. /// @see For more details, visit the [Wiki](https://github.com/mach3-software/MaCh3/wiki/02.-Implementation-of-Systematic). +/// @author Dan Barrow +/// @author Ed Atkin +/// @author Kamil Skwarczynski class covarianceXsec : public covarianceBase { public: /// @brief Constructor diff --git a/manager/manager.h b/manager/manager.h index 28ce9a930..045079273 100644 --- a/manager/manager.h +++ b/manager/manager.h @@ -13,6 +13,8 @@ class TFile; /// @brief The manager class is responsible for managing configurations and settings. /// @see For more details, visit the [Wiki](https://github.com/mach3-software/MaCh3/wiki/01.-Manager-and-config-handling). +/// @author Ed Atkin +/// @author Kamil Skwarczynski class manager { public: /// @brief Constructs a manager object with the specified file name.