![]() |
MaCh3
2.8.0
Reference Guide
|
Main namespace for MaCh3 software. More...
Namespaces | |
| detail | |
| Implementation details only for experts. | |
| Plotting | |
| Flexible, experiment-agnostic plotting utilities for MaCh3. | |
| rand | |
| Utils | |
| Utility helpers used across MaCh3. | |
Classes | |
| class | DynamicPlugin |
| Manages the lifecycle of a dynamically loaded plugin. More... | |
| class | MaCh3Program |
| Main program class that manages modules, plugins, and command-line parsing. More... | |
| class | MaCh3ArgumentParser |
| Extended ArgumentParser with MaCh3-specific functionality. More... | |
| class | IPlugin |
| Interface for MaCh3 plugins and modules. More... | |
| class | PluginBase |
| Base class for core modules in MaCh3. More... | |
| class | CombineModule |
| Allows you to combine multiple chains or ROOT files into a single output. More... | |
| class | DiagMCMCModule |
| Module for performing diagnostic analysis on MCMC chains. More... | |
| class | DiagModule |
| Module for MCMC diagnostics. More... | |
| class | GetPenaltyTermModule |
| Module for extracting specific penalty terms from MCMC chains. More... | |
| class | LLHMapModule |
| Module for processing LLHMap outputs. More... | |
| class | ProcessMCMCModule |
| Module for processing MCMC chains and producing various diagnostic plots. More... | |
| struct | ReweightConfig |
| Structure to hold reweight configuration. More... | |
| class | ReweightModule |
| Module for performing reweighting analysis on MCMC chains. More... | |
| class | RHatModule |
| Module for computing the R-hat diagnostic for MCMC chains. More... | |
| class | SmearModule |
| Allows you to smear contour. For example after performing sets of study one finds out that used sets of uncertainty doesn't fully cover analysis need. Then one can smear additionally contour. More... | |
| struct | WindowConfig |
| struct | UmbrellaConfig |
| class | UmbrellaModule |
| Module for performing Umbrella sampling. More... | |
| class | UmbrellaPlotModule |
| Module for Umbrella sampling plot analysis. More... | |
Typedefs | |
| using | float_t = double |
| using | int_t = int |
| using | uint_t = unsigned |
| typedef IPlugin | IModule |
| Alias for IPlugin, used for core modules. More... | |
| typedef PluginBase | IModuleBase |
| Alias for IPluginBase, used for core modules. More... | |
Enumerations | |
| enum | kInfCrit { kBIC , kDIC , kWAIC , kInfCrits } |
| KS: Different Information Criterion tests mostly based Gelman paper. More... | |
| enum class | BiasFunction { kGaussian , kVonMises , kGeneralisedGaussian } |
| enum | kReweightType { kGaussian , kGaussian , kTGraph , kTGraph2D , kReweightTypes } |
| Types of chain reweighting available. More... | |
Functions | |
| template<typename T > | |
| constexpr T | fmaf_t (T x, T y, T z) |
| Function template for fused multiply-add. More... | |
| int | GetNThreads () |
| number of threads which we need for example for TRandom3 More... | |
| void | AddPath (std::string &FilePath) |
| Prepends the MACH3 environment path to FilePath if it is not already present. More... | |
| bool | CaseInsentiveMatch (std::string Text, std::string Pattern) |
| Matches a string against a simple wildcard Pattern using regex. Is not case sensitive. More... | |
| bool | CaseInsensitiveMatchAny (std::string Text, const std::vector< std::string > &Patterns) |
| Matches a string against a simple wildcard Pattern using regex. Is not case sensitive. More... | |
| double * | MatrixMult (double *A, double *B, int n) |
| CW: Multi-threaded matrix multiplication. More... | |
| double ** | MatrixMult (double **A, double **B, int n) |
| CW: Multi-threaded matrix multiplication. More... | |
| TMatrixD | MatrixMult (TMatrixD A, TMatrixD B) |
| CW: Multi-threaded matrix multiplication. More... | |
| void | MatrixVectorMulti (double *_restrict_ VecMulti, double **_restrict_ matrix, const double *_restrict_ vector, const int n) |
| KS: Custom function to perform multiplication of matrix and vector with multithreading. More... | |
| double | MatrixVectorMultiSingle (double **_restrict_ matrix, const double *_restrict_ vector, const int Length, const int i) |
| KS: Custom function to perform multiplication of matrix and single element which is thread safe. More... | |
| void | FixSampleNamesQuotes (std::string &yamlStr) |
| KS: Yaml emitter has problem and drops "", if you have special signs in you like * then there is problem. This bit hacky code adds these "". More... | |
| void | AddTuneValues (YAML::Node &root, const std::vector< double > &Values, const std::string &Tune, const std::vector< std::string > &FancyNames={}) |
| KS: Add Tune values to YAML covariance matrix. More... | |
| void | MakeCorrelationMatrix (YAML::Node &root, const std::vector< double > &Values, const std::vector< double > &Errors, const std::vector< std::vector< double >> &Correlation, const std::string &OutYAMLName, const std::vector< std::string > &FancyNames={}) |
| KS: Replace correlation matrix and tune values in YAML covariance matrix. More... | |
| TMacro * | GetConfigMacroFromChain (TDirectory *CovarianceFolder) |
| KS: We store configuration macros inside the chain. In the past, multiple configs were stored, which required error-prone hardcoding like "Config_xsec_cov". Therefore, this code maintains backward compatibility by checking the number of macros present and using a hardcoded name only if necessary. More... | |
| TMatrixDSym * | GetCovMatrixFromChain (TDirectory *TempFile) |
| KS: Retrieve the cross-section covariance matrix from the given TDirectory. Historically, multiple covariance matrices could be stored, requiring fragile hardcoded paths like "CovarianceFolder/xsec_cov". This function maintains backward compatibility by: More... | |
| std::vector< std::vector< double > > | GetCholeskyDecomposedMatrix (const TMatrixDSym &matrix, const std::string &matrixName) |
| Computes Cholesky decomposition of a symmetric positive definite matrix using custom function which can be even 20 times faster. More... | |
| bool | CanDecomposeMatrix (const TMatrixDSym &matrix) |
| Checks if a matrix can be Cholesky decomposed. More... | |
| int | MakeMatrixPosDef (TMatrixDSym *cov) |
| Makes sure that matrix is positive-definite by adding a small number to on-diagonal elements. More... | |
| void | DumpParamHandlerToFile (const int _fNumPar, const std::vector< double > &_fPreFitValue, const std::vector< double > &_fError, const std::vector< double > &_fLowBound, const std::vector< double > &_fUpBound, const std::vector< double > &_fIndivStepScale, const std::vector< std::string > &_fFancyNames, const std::vector< bool > &_fFlatPrior, const std::vector< SplineParameter > &SplineParams, TMatrixDSym *covMatrix, TH2D *CorrMatrix, const std::string &Name) |
| Dump Matrix to ROOT file, useful when we need to pass matrix info to another fitting group. More... | |
| void | DebugPCA (const double sum, const TMatrixD &temp, const TMatrixD &eigen_vectors, const TVectorD &eigen_values, const TMatrixD &TransferMat, const TMatrixD &TransferMatT, const int NumPar, const int FirstPCAdpar, const int LastPCAdpar, const int nKeptPCApars, const double eigen_threshold) |
| KS: Let's dump all useful matrices to properly validate PCA. More... | |
| M3::BiasFunction | ParseBiasFunction (const std::string &biasFunctionName) |
| std::string | BiasFunction_ToString (const M3::BiasFunction &biasFunction) |
Variables | |
| constexpr static const char * | float_t_str_repr = "D" |
| constexpr static const double | _BAD_DOUBLE_ = -999.99 |
| Default value used for double initialisation. More... | |
| constexpr static const int | _BAD_INT_ = -999 |
| Default value used for int initialisation. More... | |
| constexpr static const double | _DEFAULT_RETURN_VAL_ = -999999.123456 |
| constexpr static const double | Unity_D = 1. |
| Some commonly used variables to which we set pointers to. More... | |
| constexpr static const float | Unity_F = 1. |
| constexpr static const float_t | Unity = Unity_D |
| constexpr static const double | Zero_D = 0. |
| constexpr static const float | Zero_F = 0. |
| constexpr static const float_t | Zero = Zero_D |
| constexpr static const double | KinematicLowBound = std::numeric_limits<double>::lowest() |
| When parameter has no bound this serves as it. Lowest possible value the system. More... | |
| constexpr static const double | KinematicUpBound = std::numeric_limits<double>::max() |
| When parameter has no bound this serves as it. Highest possible value the system. More... | |
| constexpr static const double | _LARGE_LOGL_ = 1234567890.0 |
| Large Likelihood is used it parameter go out of physical boundary, this indicates in MCMC that such step should be removed. More... | |
| constexpr static const double | _LOW_MC_BOUND_ = .00001 |
| MC prediction lower bound in bin to identify problematic binning definitions and handle LogL calculation. More... | |
| constexpr static const double | DefSplineKnotUpBound = 9999 |
| Default value for spline knot capping, default mean not capping is being applied. More... | |
| constexpr static const double | DefSplineKnotLowBound = -9999 |
| Default value for spline knot capping, default mean not capping is being applied. More... | |
| constexpr static const int | UnderOverFlowBin = -1 |
| Mark bin which is overflow or underflow in MaCh3 binning. More... | |
| constexpr double | UmbrellaGaussianNormFactor = 0.906402477055 |
| constexpr std::uint32_t | PLUGIN_API_VERSION = 1 |
| Fix API compatibility: increment when the plugin/parser contract changes incompatibly. More... | |
| bool | debug_mode = false |
Main namespace for MaCh3 software.
| typedef double M3::float_t |
Alias for IPlugin, used for core modules.
Definition at line 34 of file plugin.hpp.
Alias for IPluginBase, used for core modules.
Definition at line 52 of file plugin.hpp.
| using M3::uint_t = typedef unsigned |
|
strong |
| Enumerator | |
|---|---|
| kGaussian | |
| kVonMises | |
| kGeneralisedGaussian | |
Definition at line 15 of file MulticanonicalMCMCHandler.h.
| enum M3::kInfCrit |
KS: Different Information Criterion tests mostly based Gelman paper.
| Enumerator | |
|---|---|
| kBIC | Bayesian Information Criterion. |
| kDIC | Deviance Information Criterion. |
| kWAIC | Watanabe-Akaike information criterion. |
| kInfCrits | This only enumerates. |
Definition at line 33 of file StatisticalUtils.h.
| enum M3::kReweightType |
Types of chain reweighting available.
| Enumerator | |
|---|---|
| kGaussian | Assumes gaussian prior. |
| kGaussian | |
| kTGraph | Calculates Likelihood based on TGraph. |
| kTGraph2D | Calculates Likelihood based on TGraph2D. |
| kReweightTypes | This only enumerates. |
Definition at line 28 of file ReweightModule.hpp.
| void M3::AddPath | ( | std::string & | FilePath | ) |
Prepends the MACH3 environment path to FilePath if it is not already present.
| FilePath | Reference to the file path string to be modified. |
Definition at line 382 of file Monitor.cpp.
|
inline |
KS: Add Tune values to YAML covariance matrix.
| root | The root YAML node to be updated. |
| Values | The values to add for the specified tune. |
| Tune | The name of the tune (e.g., "PostFit"). |
| FancyNames | Optional list of fancy names to match systematics (must match Values size if provided). |
Definition at line 232 of file ParameterHandlerUtils.h.
|
inline |
Definition at line 34 of file MulticanonicalMCMCHandler.h.
|
inline |
Checks if a matrix can be Cholesky decomposed.
| matrix | Input symmetric matrix to test |
Definition at line 543 of file ParameterHandlerUtils.h.
|
inline |
Matches a string against a simple wildcard Pattern using regex. Is not case sensitive.
| Text | Input string to test. |
| Patterns | Collection wildcard patterns to match against. |
Definition at line 65 of file ParameterHandlerUtils.h.
|
inline |
Matches a string against a simple wildcard Pattern using regex. Is not case sensitive.
| Text | Input string to test. |
| Pattern | Wildcard pattern to match against. |
Definition at line 44 of file ParameterHandlerUtils.h.
|
inline |
KS: Let's dump all useful matrices to properly validate PCA.
Definition at line 709 of file ParameterHandlerUtils.h.
|
inline |
Dump Matrix to ROOT file, useful when we need to pass matrix info to another fitting group.
Definition at line 609 of file ParameterHandlerUtils.h.
|
inline |
KS: Yaml emitter has problem and drops "", if you have special signs in you like * then there is problem. This bit hacky code adds these "".
| yamlStr | The YAML string to be processed (modified in-place). |
Definition at line 197 of file ParameterHandlerUtils.h.
|
constexpr |
|
inline |
Computes Cholesky decomposition of a symmetric positive definite matrix using custom function which can be even 20 times faster.
| matrix | Input symmetric positive definite matrix |
| matrixName | Identifier for error reporting |
Definition at line 507 of file ParameterHandlerUtils.h.
|
inline |
KS: We store configuration macros inside the chain. In the past, multiple configs were stored, which required error-prone hardcoding like "Config_xsec_cov". Therefore, this code maintains backward compatibility by checking the number of macros present and using a hardcoded name only if necessary.
Definition at line 427 of file ParameterHandlerUtils.h.
|
inline |
KS: Retrieve the cross-section covariance matrix from the given TDirectory. Historically, multiple covariance matrices could be stored, requiring fragile hardcoded paths like "CovarianceFolder/xsec_cov". This function maintains backward compatibility by:
Definition at line 468 of file ParameterHandlerUtils.h.
| int M3::GetNThreads | ( | ) |
number of threads which we need for example for TRandom3
Definition at line 372 of file Monitor.cpp.
|
inline |
KS: Replace correlation matrix and tune values in YAML covariance matrix.
| root | The root YAML node to be updated. |
| Values | The new values for each systematic. |
| Errors | The new errors for each systematic. |
| Correlation | The new correlation matrix (must be square and match Values size). |
| OutYAMLName | The output filename for the updated YAML. |
| FancyNames | Optional list of fancy names to match systematics (must match Values size if provided). |
Definition at line 313 of file ParameterHandlerUtils.h.
|
inline |
Makes sure that matrix is positive-definite by adding a small number to on-diagonal elements.
Definition at line 551 of file ParameterHandlerUtils.h.
|
inline |
CW: Multi-threaded matrix multiplication.
Definition at line 107 of file ParameterHandlerUtils.h.
|
inline |
|
inline |
|
inline |
KS: Custom function to perform multiplication of matrix and vector with multithreading.
| VecMulti | Output Vector, VecMulti = matrix x vector |
| matrix | This matrix is used for multiplication VecMulti = matrix x vector |
| vector | This vector is used for multiplication VecMulti = matrix x vector |
| n | this is size of matrix and vector, we assume matrix is symmetric |
Definition at line 157 of file ParameterHandlerUtils.h.
|
inline |
KS: Custom function to perform multiplication of matrix and single element which is thread safe.
| matrix | This matrix is used for multiplication VecMulti = matrix x vector |
| vector | This vector is used for multiplication VecMulti = matrix x vector |
| Length | this is size of matrix and vector, we assume matrix is symmetric |
| i | Element of matrix that we want to multiply |
Definition at line 182 of file ParameterHandlerUtils.h.
|
inline |
Definition at line 21 of file MulticanonicalMCMCHandler.h.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
| bool M3::debug_mode = false |
Definition at line 20 of file UmbrellaModule.hpp.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
inlineconstexpr |
Fix API compatibility: increment when the plugin/parser contract changes incompatibly.
Definition at line 12 of file plugin.hpp.
|
constexpr |
Normalisation constant for the n=2 umbrella sampling Gaussian.
The factor comes from: 2n / Gamma(1/(2n)) with n = 2: 4 / Gamma(1/4) = 0.906402477055
Definition at line 53 of file MulticanonicalMCMCHandler.h.
|
staticconstexpr |
|
staticconstexpr |