![]() |
MaCh3
2.4.2
Reference Guide
|
Main namespace for MaCh3 software. More...
Typedefs | |
| using | float_t = double |
| using | int_t = int |
| using | uint_t = unsigned |
Enumerations | |
| enum | kInfCrit { kBIC , kDIC , kWAIC , kInfCrits } |
| KS: Different Information Criterion tests mostly based Gelman paper. 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... | |
| int | GetThreadIndex () |
| thread index inside parallel loop More... | |
| TFile * | Open (const std::string &Name, const std::string &Type, const std::string &File, const int Line) |
| Opens a ROOT file with the given name and mode. More... | |
| void | ScaleHistogram (TH1 *Sample_Hist, const double scale) |
| Scale histogram to get divided by bin width. More... | |
| template<typename ObjectType > | |
| std::unique_ptr< ObjectType > | Clone (const ObjectType *obj, const std::string &name="") |
| KS: Creates a copy of a ROOT-like object and wraps it in a smart pointer. 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... | |
| void | MakeMatrixPosDef (TMatrixDSym *cov) |
| Makes sure that matrix is positive-definite by adding a small number to on-diagonal elements. More... | |
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... | |
Main namespace for MaCh3 software.
| using M3::float_t = typedef double |
| using M3::uint_t = typedef unsigned |
| 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 10 of file SampleSummary.h.
| 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 187 of file ParameterHandlerUtils.h.
|
inline |
Checks if a matrix can be Cholesky decomposed.
| matrix | Input symmetric matrix to test |
Definition at line 498 of file ParameterHandlerUtils.h.
| std::unique_ptr<ObjectType> M3::Clone | ( | const ObjectType * | obj, |
| const std::string & | name = "" |
||
| ) |
KS: Creates a copy of a ROOT-like object and wraps it in a smart pointer.
| ObjectType | The type of the object to clone for example TH1D or TH2Poly. |
| obj | Pointer to the object to clone. |
| name | Optional argument allowing to set new name of cloned object |
Definition at line 142 of file HistogramUtils.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 152 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 462 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 382 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 423 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 |
|
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 268 of file ParameterHandlerUtils.h.
|
inline |
Makes sure that matrix is positive-definite by adding a small number to on-diagonal elements.
Definition at line 506 of file ParameterHandlerUtils.h.
|
inline |
CW: Multi-threaded matrix multiplication.
Definition at line 62 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 112 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 137 of file ParameterHandlerUtils.h.
| TFile * M3::Open | ( | const std::string & | Name, |
| const std::string & | Type, | ||
| const std::string & | File, | ||
| const int | Line | ||
| ) |
Opens a ROOT file with the given name and mode.
This function wraps ROOT’s TFile constructor and checks whether the file was opened successfully and give some useful debugging information
| Name | The name or path of the file to open. |
| Type | The file open mode (e.g., "READ", "RECREATE", "UPDATE"). |
| File | The name of the file where the exception occurred. |
| Line | The line number where the exception occurred. |
Definition at line 627 of file HistogramUtils.cpp.
| void M3::ScaleHistogram | ( | TH1 * | Sample_Hist, |
| const double | scale | ||
| ) |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |