#include <apfel/timer.h>
#include <algorithm>
#include <fstream>
#include <sys/stat.h>
#include <cstring>
int main(int argc, char* argv[])
{
if (argc < 5 || strcmp(argv[1], "--help") == 0)
{
std::cout << "\nInvalid Parameters:" << std::endl;
std::cout << "Syntax: ./ComputeMeanReplica <fit dir> <fit configuration file> <path to data folder> <path to tables folder> [replicas to be discarded]\n" << std::endl;
exit(-10);
}
std::vector<int> discard;
for (int i = 5; i < argc; i++)
discard.push_back(std::stoi(argv[i]));
apfel::Timer t;
YAML::Node fitconfig = YAML::LoadFile(argv[2]);
const std::string OutputFolder = std::string(argv[1]) + "/mean_replica";
mkdir((OutputFolder).c_str(), ACCESSPERMS);
const YAML::Node datasets = YAML::LoadFile(std::string(argv[3]) + "/datasets.yaml");
for (auto const& exp : datasets)
for (auto const& ds : exp.second)
{
std::cout << "Reading table for " << ds["name"].as<std::string>() << "..." << std::endl;
chi2.AddBlock(std::make_pair(dh, ct));
}
t.stop();
t.start();
const bool status =
NoMinimiser(chi2, fitconfig[
"Parameters"]);
std::cout << "Total chi2 = " << chi2() << "\n" << std::endl;
YAML::Emitter out;
out << chi2;
std::ofstream rout(OutputFolder + "/Report.yaml");
rout << "Status: " << status << std::endl;
rout << out.c_str() << std::endl;
rout.close();
delete NPFunc;
t.stop();
return 0;
}
The "ChiSquare" class computes the χ2's given a set of "DataHandler" objects and the corresponding "C...
Definition: chisquare.h:22
Class that implements the methods fot the numerical convolution of the interpolation tables with user...
Definition: convolutiontable.h:25
The "DataHandler" class provides a common interface to all datasets. It provides methods to get kinem...
Definition: datahandler.h:23
Parameterisation derived from the "Parameterisation" mother class to compute the mean replica of a Mo...
Definition: meanreplica.h:19
Mother class that implements the main feautures of a functional parameterisation of non-perturbative ...
Definition: parameterisation.h:20
bool NoMinimiser(ChiSquare const &chi2, YAML::Node const ¶meters)
The "NoMinimiser" function simply returns predictions.