15bool Results::LoadConfig(std::string configfilename, std::string userconfig, std::string environment,
18 bool configLoaded = Core::LoadConfig(configfilename, userconfig, environment, userConfigRaw);
42void Results::Print(Option_t * option)
const
50 for (
auto & an : fAxes) {
52 printf(
"axis: %15s(%s)\t[val=%d] \t[", an.c_str(), fAxesTypes[iAxis].c_str(), fPoint[iAxis]);
53 if (fAxesLabels.find(an) == fAxesLabels.end()) {
58 for (
auto & al : fAxesLabels.at(an)) {
59 if (al.empty())
continue;
60 if (fAxesLabels.at(an).back() == al) {
61 printf(
"%s(%d)", al.c_str(), iLabel + 1);
64 printf(
"%s(%d),", al.c_str(), iLabel + 1);
74bool Results::LoadResults()
79 Printf(
"Opening file '%s' ...", fInputFileName.c_str());
81 fInputFile = TFile::Open(fInputFileName.c_str());
84 Printf(
"Error: Input file '%s' was not found !!!", fInputFileName.c_str());
88 fResultHnSparse = (THnSparse *)fInputFile->Get(fResultsHnSparseName.c_str());
89 if (!fResultHnSparse) {
90 Printf(
"Error: Results THnSparse histogram '%s' was not found !!!", fResultsHnSparseName.c_str());
94 fMapAxesType = (TH1 *)fInputFile->Get(fMapAxesTypeName.c_str());
96 Printf(
"Error: 'mapAxesType' histogram was not found !!!");
100 int pointsSize = gCfg[
"ndmspc"][
"result"][
"axes"].size() + 1;
101 if (fDataSource == DataSource::histogram) pointsSize += gCfg[
"ndmspc"][
"result"][
"data"][
"defaults"].size() + 1;
110 fAxesBinSizes.clear();
111 for (
int iDim = 0; iDim < fResultHnSparse->GetNdimensions(); iDim++) {
112 TAxis * a = (TAxis *)fResultHnSparse->GetAxis(iDim);
114 Printf(
"Error: Axis 'id=%d' was not found !!!", iDim);
117 fPoint.push_back(-1);
118 std::string axisName = a->GetName();
119 fAxes.push_back(axisName);
120 if (a->IsAlphanumeric()) {
121 for (
int iLabel = 0; iLabel < a->GetNbins(); iLabel++) {
122 fAxesLabels[axisName].push_back(a->GetBinLabel(iLabel));
125 fAxesBinSizes[axisName] = a->GetNbins();
126 fAxesTypes.push_back(fMapAxesType->GetXaxis()->GetBinLabel(iDim + 1));
129 if (fCurrentParameterName.empty()) {
130 int idxDefault = gCfg[
"ndmspc"][
"result"][
"parameters"][
"default"].get<
int>();
131 fCurrentParameterName = gCfg[
"ndmspc"][
"result"][
"parameters"][
"labels"][idxDefault].get<std::string>();
133 Printf(
"Paremeter: %s", fCurrentParameterName.c_str());
135 TAxis * a = (TAxis *)fResultHnSparse->GetListOfAxes()->FindObject(fParametesAxisName.c_str());
137 Printf(
"Error: Axis '%s' was not found !!!", fParametesAxisName.c_str());
140 Int_t
id = fResultHnSparse->GetListOfAxes()->IndexOf(a);
141 Int_t idBin = a->FindBin(fCurrentParameterName.c_str());
143 Printf(
"Could not find bin label '%s' in '%s' axis !!!", fParametesAxisName.c_str(), fCurrentParameterName.c_str());
147 Printf(
"Axis: %d [parameters] SetRange(%d,%d)",
id, idBin, idBin);
149 fResultHnSparse->GetAxis(
id)->SetRange(idBin, idBin);
227void Results::GenerateTitle()
232 fMapTitle = fCurrentParameterName +
" [";
235 for (
int iAxis = 1; iAxis < fResultHnSparse->GetNdimensions(); iAxis++) {
236 a = (TAxis *)fResultHnSparse->GetAxis(iAxis);
237 std::string l = a->GetBinLabel(fPoint[iAxis]);
239 fMapTitle += std::to_string(fPoint[iAxis]);
249 Printf(
"Map title: '%s'", fMapTitle.c_str());