26 std::string userConfigRaw)
32 bool configLoaded =
Core::LoadConfig(configfilename, userconfig, environment, userConfigRaw);
33 if (!gCfg[
"ndmspc"][
"data"][
"histogram"][
"enabled"].is_null() ||
34 gCfg[
"ndmspc"][
"data"][
"histogram"][
"enabled"].is_boolean()) {
35 if (gCfg[
"ndmspc"][
"data"][
"histogram"][
"enabled"].get<bool>())
fDataSource = DataSource::histogram;
37 std::string hostUrl = gCfg[
"ndmspc"][
"output"][
"host"].get<std::string>();
39 if (!hostUrl.empty()) path = hostUrl +
"/";
40 path += gCfg[
"ndmspc"][
"output"][
"dir"].get<std::string>() +
"/";
42 for (
auto & cut : gCfg[
"ndmspc"][
"cuts"]) {
43 if (cut[
"enabled"].is_boolean() && cut[
"enabled"].get<bool>() ==
false)
continue;
44 path += cut[
"axis"].get<std::string>() +
"_";
45 fCuts.push_back(cut[
"axis"].get<std::string>());
48 path[path.size() - 1] =
'/';
50 path += environment +
"/";
64 for (
auto & an :
fAxes) {
66 printf(
"axis: %15s(%s)\t[val=%d] \t[", an.c_str(),
fAxesTypes[iAxis].c_str(),
fPoint[iAxis]);
73 if (al.empty())
continue;
75 printf(
"%s(%d)", al.c_str(), iLabel + 1);
78 printf(
"%s(%d),", al.c_str(), iLabel + 1);
98 Printf(
"Error: Input file '%s' was not found !!!",
fInputFileName.c_str());
104 Printf(
"Error: Results THnSparse histogram '%s' was not found !!!",
fResultsHnSparseName.c_str());
110 Printf(
"Error: 'mapAxesType' histogram was not found !!!");
114 int pointsSize = gCfg[
"ndmspc"][
"result"][
"axes"].size() + 1;
115 if (
fDataSource == DataSource::histogram) pointsSize += gCfg[
"ndmspc"][
"result"][
"data"][
"defaults"].size() + 1;
128 Printf(
"Error: Axis 'id=%d' was not found !!!", iDim);
132 std::string axisName = a->GetName();
133 fAxes.push_back(axisName);
134 if (a->IsAlphanumeric()) {
135 for (
int iLabel = 0; iLabel < a->GetNbins(); iLabel++) {
136 fAxesLabels[axisName].push_back(a->GetBinLabel(iLabel));
144 int idxDefault = gCfg[
"ndmspc"][
"result"][
"parameters"][
"default"].get<
int>();
145 fCurrentParameterName = gCfg[
"ndmspc"][
"result"][
"parameters"][
"labels"][idxDefault].get<std::string>();
161 Printf(
"Axis: %d [parameters] SetRange(%d,%d)",
id, idBin, idBin);
225 Printf(
"Apply points ...");
233 Printf(
"ApplyPoint : %s [%s] SetRange(%d,%d)",
fAxes[iAxis].c_str(),
fAxesTypes[iAxis].c_str(), p, p);
249 for (
int iAxis = 1; iAxis <
fResultHnSparse->GetNdimensions(); iAxis++) {
251 std::string l = a->GetBinLabel(
fPoint[iAxis]);
263 Printf(
"Map title: '%s'",
fMapTitle.c_str());
272 Printf(
"Draw results ...");
static bool LoadConfig(std::string config, std::string userConfig, std::string &environment, std::string userConfigRaw="", std::string binning="")
std::map< std::string, std::vector< std::string > > fAxesLabels
axes labels
std::vector< std::string > fAxesTypes
axes types
std::string fMapAxesTypeName
map axes type name
std::map< std::string, int > fAxesBinSizes
axes map
std::string fInputFileName
file name
THnSparse * fResultHnSparse
results sparse histogram
std::string fCurrentParameterName
current parameter name
bool LoadConfig(std::string configfilename="config.json", std::string userconfig="", std::string environment="", std::string userConfigRaw="")
virtual void Draw(Option_t *option="")
std::string fParametesAxisName
parameters axis name
std::string fMapTitle
map type title
std::string fResultsHnSparseName
results object name
std::vector< std::string > fCuts
cuts
std::vector< std::string > fAxes
axes names
DataSource fDataSource
data source
std::vector< int > fPoint
point
std::string fResultFileName
results file name
TFile * fInputFile
input file
TH1 * fMapAxesType
map axes type
virtual void Print(Option_t *option="") const