Skip to content

Commit

Permalink
Merge pull request #188 from mach3-software/feature_removeSize
Browse files Browse the repository at this point in the history
Remvoe Size...
  • Loading branch information
KSkwarczynski authored Oct 28, 2024
2 parents d22fd56 + d8722bf commit f79d6fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
12 changes: 3 additions & 9 deletions covariance/covarianceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ covarianceBase::~covarianceBase(){
delete[] throwMatrixCholDecomp;

const int nThreads = MaCh3Utils::GetNThreads();
for (int iThread = 0;iThread < nThreads; iThread++) delete random_number[iThread];
for (int iThread = 0;iThread < nThreads; iThread++) delete random_number[iThread];
delete[] random_number;
if (throwMatrix != nullptr) delete throwMatrix;
}
Expand Down Expand Up @@ -133,12 +133,10 @@ void covarianceBase::init(std::string name, std::string file) {
for (int iThread = 0; iThread < nThreads; iThread++) {
random_number[iThread] = new TRandom3(0);
}

// Not using adaptive by default
use_adaptive = false;
// Set the covariance matrix
size = CovMat->GetNrows();
_fNumPar = size;
_fNumPar = CovMat->GetNrows();

InvertCovMatrix = new double*[_fNumPar]();
throwMatrixCholDecomp = new double*[_fNumPar]();
Expand Down Expand Up @@ -196,13 +194,10 @@ void covarianceBase::init(const std::vector<std::string>& YAMLFile) {
for (int iThread = 0; iThread < nThreads; iThread++) {
random_number[iThread] = new TRandom3(0);
}

PrintLength = 35;

// Set the covariance matrix
_fNumPar = _fYAMLDoc["Systematics"].size();
size = _fNumPar;

use_adaptive = false;

InvertCovMatrix = new double*[_fNumPar]();
Expand Down Expand Up @@ -321,8 +316,7 @@ void covarianceBase::init(const std::vector<std::string>& YAMLFile) {
// ********************************************
void covarianceBase::init(TMatrixDSym* covMat) {
// ********************************************
size = covMat->GetNrows();
_fNumPar = size;
_fNumPar = covMat->GetNrows();
InvertCovMatrix = new double*[_fNumPar]();
throwMatrixCholDecomp = new double*[_fNumPar]();
// Set the defaults to true
Expand Down
6 changes: 1 addition & 5 deletions covariance/covarianceBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ class covarianceBase {
//KS: Transfer to normal base
TransferToParam();
}
/// @brief Get number of params in normal Base, if you want something which will work with PCA as well please use getNpars()
inline int getSize() { return _fNumPar; }
/// @brief Get number of params which will be different depending if using Eigen decomposition or not
inline int getNpars() {
if (pca) return _fNumParPCA;
Expand Down Expand Up @@ -343,7 +341,7 @@ class covarianceBase {

/// @brief Getter to return a copy of the YAML node
YAML::Node GetConfig() const { return _fYAMLDoc; }
protected:
protected:
/// @brief Initialisation of the class using matrix from root file
void init(std::string name, std::string file);
/// @brief Initialisation of the class using config
Expand Down Expand Up @@ -387,8 +385,6 @@ class covarianceBase {
/// The input root file we read in
const std::string inputFile;

/// Total number of params, deprecated, please don't use it
int size;
/// Name of cov matrix
std::string matrixName;
/// The covariance matrix
Expand Down

0 comments on commit f79d6fc

Please sign in to comment.