294#include "TRestDataSetPlot.h"
297#include "TDirectory.h"
298#include "TRestTools.h"
351 TiXmlElement* cutele =
GetElement(
"addCut", ele);
352 while (cutele !=
nullptr) {
354 if (!cutName.empty()) {
355 if (cut ==
nullptr) {
373 RESTWarning <<
"Plot metadata already initialized" <<
RESTendl;
377 while (panelele !=
nullptr) {
378 std::string active =
GetParameter(
"value", panelele,
"ON");
379 if (
ToUpper(active) !=
"ON")
continue;
384 panel.delimiter =
GetParameter(
"delimiter", panelele,
": ");
386 panel.panelCut =
ReadCut(panel.panelCut, panelele);
388 TiXmlElement* labelele =
GetElement(
"variable", panelele);
389 while (labelele !=
nullptr) {
390 std::array<std::string, 3> label;
397 panel.variablePos.push_back(std::make_pair(label, TVector2(posX, posY)));
401 TiXmlElement* metadata =
GetElement(
"metadata", panelele);
402 while (metadata !=
nullptr) {
403 std::array<std::string, 3> label;
410 panel.metadataPos.push_back(std::make_pair(label, TVector2(posX, posY)));
414 TiXmlElement* observable =
GetElement(
"observable", panelele);
415 while (observable !=
nullptr) {
416 std::array<std::string, 3> label;
423 panel.obsPos.push_back(std::make_pair(label, TVector2(posX, posY)));
427 TiXmlElement* expression =
GetElement(
"expression", panelele);
428 while (expression !=
nullptr) {
429 std::array<std::string, 4> label;
437 panel.expPos.push_back(std::make_pair(label, TVector2(posX, posY)));
453 RESTWarning <<
"Plot metadata already initialized" <<
RESTendl;
458 while (plotele !=
nullptr) {
459 std::string active =
GetParameter(
"value", plotele,
"ON");
460 if (
ToUpper(active) !=
"ON")
continue;
465 plot.logX = StringToBool(
GetParameter(
"logX", plotele,
"false"));
466 plot.logY = StringToBool(
GetParameter(
"logY", plotele,
"false"));
467 plot.logZ = StringToBool(
GetParameter(
"logZ", plotele,
"false"));
468 plot.gridY = StringToBool(
GetParameter(
"gridY", plotele,
"false"));
469 plot.gridX = StringToBool(
GetParameter(
"gridX", plotele,
"false"));
478 plot.legendOn = StringToBool(
GetParameter(
"legend", plotele,
"OFF"));
479 plot.stackDrawOption =
GetParameter(
"stackOption", plotele,
"nostack");
483 plot.timeDisplay = StringToBool(
GetParameter(
"timeDisplay", plotele,
"OFF"));
486 TiXmlElement* histele =
GetElement(
"histo", plotele);
487 if (histele ==
nullptr) {
490 while (histele !=
nullptr) {
493 hist.drawOption =
GetParameter(
"option", histele,
"colz");
494 TiXmlElement* varele =
GetElement(
"variable", histele);
495 while (varele !=
nullptr) {
508 hist.statistics = StringToBool(
GetParameter(
"stats", histele,
"OFF"));
510 hist.histoCut =
ReadCut(hist.histoCut, histele);
511 plot.histos.push_back(hist);
513 if (histele == plotele) {
530 std::vector<std::string> obsList;
533 if (
fCut !=
nullptr) {
534 const auto paramCut =
fCut->GetParamCut();
535 for (
const auto& [param, condition] : paramCut) {
536 obsList.push_back(param);
541 for (
const auto& plots :
fPlots) {
542 for (
const auto& hist : plots.histos) {
543 for (
const auto& var : hist.variable) {
544 obsList.push_back(var);
546 if (hist.histoCut ==
nullptr)
continue;
547 const auto paramCut = hist.histoCut->GetParamCut();
548 for (
const auto& [param, condition] : paramCut) {
549 obsList.push_back(param);
554 std::map<std::string, TRestDataSet::RelevantQuantity> quantity;
558 for (
auto& [key, posLabel] : panel.expPos) {
560 auto&& [exp, label,
units, precision] = key;
561 std::string text = exp;
562 while (text.find_last_of(
'[') != std::string::npos) {
563 int squareBracketCorrector = 0;
564 size_t posOpen = text.find_last_of(
'[');
565 size_t posClose = text.find_first_of(
']', posOpen);
567 if (text[posOpen - 1] ==
'[') {
568 squareBracketCorrector = 1;
571 std::string varOrMeta = text.substr(posOpen - squareBracketCorrector,
572 posClose + 1 - posOpen + 2 * squareBracketCorrector);
573 if (squareBracketCorrector == 0) {
579 quantity[label] = quant;
581 text =
Replace(text, varOrMeta,
"1");
585 while (text.find(
"_") != std::string::npos) {
586 size_t pos_ = text.find(
"_");
587 size_t beginning = text.find_last_of(
" -+*/)(^%", pos_) + 1;
588 size_t end = text.find_first_of(
" -+*/)(^%", pos_);
589 std::string obs = text.substr(beginning, end - beginning);
590 text =
Replace(text, obs,
"1");
591 obsList.push_back(obs);
595 RESTWarning <<
"The expression " << exp
596 <<
" has not been correctly parsed into variables, metadata and observables"
601 for (
auto& [key, posLabel] : panel.obsPos) {
602 auto&& [obs, label,
units] = key;
603 obsList.push_back(obs);
606 for (
auto& [key, posLabel] : panel.metadataPos) {
607 auto&& [metadata, label,
units] = key;
611 quantity[label] = quant;
616 std::sort(obsList.begin(), obsList.end());
617 obsList.erase(std::unique(obsList.begin(), obsList.end()), obsList.end());
619 dataSet.SetObservablesList(obsList);
620 dataSet.SetQuantity(quantity);
630 dataSet.EnableMultiThreading(
true);
636 if (dataSet.
GetTree() ==
nullptr) {
637 RESTWarning <<
"Cannot import dataSet, trying to generate it with pattern " <<
fDataSetName
639 RESTWarning <<
"Note that the generation of a dataSet inside TRestDataSetPlot is deplecated. Check "
640 "TRestDataSet documentation to generate a dataSet"
643 if (dataSet.
GetTree() ==
nullptr) {
644 RESTError <<
"Cannot generate dataSet " <<
RESTendl;
653 combinedCanvas.Divide((Int_t)fCanvasDivisions.X(), (Int_t)fCanvasDivisions.Y(),
654 fCanvasDivisionMargins.X(), fCanvasDivisionMargins.Y());
659 const double startTime = dataSet.GetStartTime();
660 const double endTime = dataSet.GetEndTime();
663 std::map<std::string, std::string> paramMap;
668 const auto quantity = dataSet.GetQuantity();
673 combinedCanvas.cd(canvasIndex);
675 auto dataFrame = dataSet.
MakeCut(panel.panelCut);
676 const int entries = *dataFrame.Count();
677 const double meanRate = entries / duration;
678 const double runLength = duration / 3600.;
683 paramMap[
"[[cutNames]]"] =
"";
684 paramMap[
"[[cuts]]"] =
"";
686 for (
const auto& cut :
fCut->GetCuts()) {
687 if (paramMap[
"[[cutNames]]"].empty())
688 paramMap[
"[[cutNames]]"] += cut.GetName();
690 paramMap[
"[[cutNames]]"] +=
"," + (std::string)cut.GetName();
691 if (paramMap[
"[[cuts]]"].empty())
692 paramMap[
"[[cuts]]"] += cut.GetTitle();
694 paramMap[
"[[cuts]]"] +=
" && " + (std::string)cut.GetTitle();
698 paramMap[
"[[panelCutNames]]"] =
"";
699 paramMap[
"[[panelCuts]]"] =
"";
700 if (panel.panelCut) {
701 for (
const auto& cut : panel.panelCut->GetCuts()) {
702 if (paramMap[
"[[panelCutNames]]"].empty())
703 paramMap[
"[[panelCutNames]]"] += cut.GetName();
705 paramMap[
"[[panelCutNames]]"] +=
"," + (std::string)cut.GetName();
706 if (paramMap[
"[[panelCuts]]"].empty())
707 paramMap[
"[[panelCuts]]"] += cut.GetTitle();
709 paramMap[
"[[panelCuts]]"] +=
" && " + (std::string)cut.GetTitle();
713 RESTInfo <<
"Global cuts: " << paramMap[
"[[cuts]]"] <<
RESTendl;
714 if (!paramMap[
"[[panelCuts]]"].empty())
715 RESTInfo <<
"Additional panel cuts: " << paramMap[
"[[panelCuts]]"] <<
RESTendl;
718 for (
const auto& [key, posLabel] : panel.variablePos) {
719 auto&& [variable, label,
units] = key;
721 std::string var = variable;
723 for (
const auto& [param, val] : paramMap) {
726 var =
Replace(var, param, val, pos);
731 if (!found) RESTWarning <<
"Variable " << variable <<
" not found" <<
RESTendl;
734 if (var.find(
'.') == std::string::npos) {
736 var = StringWithPrecision(dblVar, panel.precision);
739 var = StringWithPrecision(dblVar, panel.precision);
743 label + panel.delimiter.Data() + StringWithPrecision(var, panel.precision) +
" " +
units;
744 panel.text.emplace_back(
new TLatex(posLabel.X(), posLabel.Y(), lab.c_str()));
748 for (
const auto& [key, posLabel] : panel.metadataPos) {
749 auto&& [metadata, label,
units] = key;
750 std::string value =
"";
752 for (
const auto& [name, quant] : quantity) {
753 if (quant.metadata == metadata) value = quant.value;
757 RESTWarning <<
"Metadata quantity " << metadata <<
" not found in dataSet" <<
RESTendl;
762 label + panel.delimiter.Data() + StringWithPrecision(value, panel.precision) +
" " +
units;
763 panel.text.emplace_back(
new TLatex(posLabel.X(), posLabel.Y(), lab.c_str()));
767 for (
const auto& [key, posLabel] : panel.obsPos) {
768 auto&& [obs, label,
units] = key;
769 auto value = *dataFrame.Mean(obs);
772 label + panel.delimiter.Data() + StringWithPrecision(value, panel.precision) +
" " +
units;
773 panel.text.emplace_back(
new TLatex(posLabel.X(), posLabel.Y(), lab.c_str()));
777 for (
const auto& [key, posLabel] : panel.expPos) {
778 auto&& [text, label,
units, precision] = key;
779 std::string var = text;
782 std::vector<std::string> subtexts;
783 while (var.find_last_of(
'{') != std::string::npos) {
784 size_t posOpen = var.find_last_of(
'{');
785 size_t posClose = var.find_first_of(
'}', posOpen);
786 if (posClose == std::string::npos) {
787 RESTWarning <<
"Unmatched { in expression: " << var <<
RESTendl;
790 std::string subtext = var.substr(posOpen + 1, posClose - posOpen - 1);
791 subtexts.push_back(subtext);
793 var.erase(posOpen, posClose - posOpen + 1);
798 std::vector<std::string> precisionParts;
799 for (
const auto& part :
Split(precision,
",",
false,
true)) {
800 precisionParts.push_back(part);
802 if (precisionParts.size() != subtexts.size()) {
803 RESTDebug <<
"Not enough precision values provided for the expression: `" << text
804 <<
"`. Using " << precisionParts.back() <<
" for last subtexts." <<
RESTendl;
805 precisionParts.resize(subtexts.size(), precisionParts.back());
808 size_t precisionIndex = precisionParts.size() - 1;
809 for (
const auto& subtext : subtexts) {
810 std::string subVar = subtext;
812 for (
const auto& [param, val] : paramMap) {
813 subVar =
Replace(subVar, param, val);
816 for (
const auto& [name, quant] : quantity) {
817 subVar =
Replace(subVar,
"[" + name +
"]", quant.value);
818 subVar =
Replace(subVar, name, quant.value);
821 for (
const auto& obs : dataFrame.GetColumnNames()) {
822 if (var.find(obs) == std::string::npos)
continue;
825 double value = *dataFrame.Mean(obs);
828 subVar =
Replace(subVar,
"[",
"(");
829 subVar =
Replace(subVar,
"]",
")");
833 std::string prec = precisionParts[precisionIndex--];
834 if (prec.find(
'%') != std::string::npos) {
839 RESTWarning <<
"Unknown precision format: " << prec
840 <<
". Using panels precision: " << panel.precision <<
RESTendl;
841 subVar = StringWithPrecision(value, panel.precision);
844 var =
Replace(var,
"{" + subtext +
"}", subVar);
847 std::string lab = label + panel.delimiter.Data() + var +
" " +
units;
848 panel.text.emplace_back(
new TLatex(posLabel.X(), posLabel.Y(), lab.c_str()));
852 for (
const auto& text : panel.text) {
853 text->SetTextColor(1);
854 text->SetTextSize(panel.font_size);
860 for (
auto& plots :
fPlots) {
862 combinedCanvas.cd(canvasIndex);
863 plots.hs =
new THStack(plots.name.c_str(), plots.title.c_str());
864 if (plots.legendOn) plots.legend =
new TLegend(
fLegendX1, fLegendY1, fLegendX2, fLegendY2);
866 for (
auto& hist : plots.histos) {
867 auto dataFrame = dataSet.
MakeCut(hist.histoCut);
868 if (hist.variable.front() ==
"timeStamp") {
869 hist.range.front().SetX(startTime);
870 hist.range.front().SetY(endTime);
873 if (hist.variable.size() == 1) {
874 auto histo = dataFrame.Histo1D({hist.name.c_str(), hist.name.c_str(), hist.nBins.front(),
875 hist.range.front().X(), hist.range.front().Y()},
876 hist.variable.front());
877 hist.histo =
static_cast<TH1*
>(histo->DrawClone());
879 }
else if (hist.variable.size() == 2) {
880 auto histo = dataFrame.Histo2D(
881 {hist.name.c_str(), hist.name.c_str(), hist.nBins.front(), hist.range.front().X(),
882 hist.range.front().Y(), hist.nBins.back(), hist.range.back().X(), hist.range.back().Y()},
883 hist.variable.front(), hist.variable.back());
884 hist.histo =
static_cast<TH1*
>(histo->DrawClone());
886 RESTError <<
"Only 1D or 2D histograms are supported " <<
RESTendl;
889 hist.histo->SetLineColor(hist.lineColor);
890 hist.histo->SetLineWidth(hist.lineWidth);
891 hist.histo->SetLineStyle(hist.lineStyle);
892 hist.histo->SetFillColor(hist.fillColor);
893 hist.histo->SetFillStyle(hist.fillStyle);
895 if (hist.statistics) {
896 hist.histo->SetStats(
true);
898 combinedCanvas.Update();
900 hist.histo->SetStats(
false);
903 if (plots.normalize > 0) {
904 const double integral = hist.histo->Integral();
905 if (integral > 0) hist.histo->Scale(plots.normalize / integral);
908 if (plots.scale !=
"") {
909 std::string inputScale = plots.scale;
910 double binSize = hist.histo->GetXaxis()->GetBinWidth(1);
911 double entries = hist.histo->GetEntries();
913 double integral = hist.histo->Integral(
"width");
920 std::string scale =
"1./(" + inputScale +
")";
925 plots.hs->Add(hist.histo, hist.drawOption.c_str());
927 if (plots.legend !=
nullptr) plots.legend->AddEntry(hist.histo, hist.histo->GetName(),
"lf");
932 for (
auto& plots :
fPlots) {
933 if (plots.hs ==
nullptr)
continue;
935 TPad* targetPad = (TPad*)combinedCanvas.cd(canvasIndex);
936 targetPad->SetLogx(plots.logX);
937 targetPad->SetLogy(plots.logY);
938 targetPad->SetLogz(plots.logZ);
939 targetPad->SetGridx(plots.gridX);
940 targetPad->SetGridy(plots.gridY);
941 targetPad->SetLeftMargin(plots.marginLeft);
942 targetPad->SetRightMargin(plots.marginRight);
943 targetPad->SetBottomMargin(plots.marginBottom);
944 targetPad->SetTopMargin(plots.marginTop);
947 plots.hs->Draw(plots.stackDrawOption.c_str());
948 plots.hs->GetXaxis()->SetTitle(plots.labelX.c_str());
949 plots.hs->GetYaxis()->SetTitle(plots.labelY.c_str());
950 plots.hs->GetXaxis()->SetLabelSize(1.1 * plots.hs->GetXaxis()->GetLabelSize());
951 plots.hs->GetYaxis()->SetLabelSize(1.1 * plots.hs->GetYaxis()->GetLabelSize());
952 plots.hs->GetXaxis()->SetTitleSize(1.1 * plots.hs->GetXaxis()->GetTitleSize());
953 plots.hs->GetYaxis()->SetTitleSize(1.1 * plots.hs->GetYaxis()->GetTitleSize());
955 if (plots.timeDisplay) plots.hs->GetXaxis()->SetTimeDisplay(1);
956 if (plots.legend !=
nullptr) plots.legend->Draw();
959 combinedCanvas.Update();
965 combinedCanvas.Resize();
970 for (
auto& plots :
fPlots) {
971 if (plots.save.empty())
continue;
972 std::unique_ptr<TCanvas> canvas(
new TCanvas());
973 canvas->SetLogx(plots.logX);
974 canvas->SetLogy(plots.logY);
975 canvas->SetLogz(plots.logZ);
976 canvas->SetGridx(plots.gridX);
977 canvas->SetGridy(plots.gridY);
978 canvas->SetLeftMargin(plots.marginLeft);
979 canvas->SetRightMargin(plots.marginRight);
980 canvas->SetBottomMargin(plots.marginBottom);
981 canvas->SetTopMargin(plots.marginTop);
982 plots.hs->Draw(plots.stackDrawOption.c_str());
983 canvas->Print(plots.save.c_str());
988 for (
const auto& [name, quant] : quantity) {
997 RESTError << file.Error() <<
RESTendl;
1000 for (
auto& plots :
fPlots) {
1001 for (
auto& hist : plots.histos) {
1002 hist.histo->Write();
1006 if (!file.Close()) RESTError << file.Error() <<
RESTendl;
1018 for (
auto& plots :
fPlots) {
1019 for (
auto& hist : plots.histos) {
1023 delete plots.legend;
1027 for (
auto& text : panel.text) {
1040 if (in.find_first_not_of(
"0123456789") == std::string::npos) {
1043 auto it = mapStr.find(in);
1044 if (it != mapStr.end()) {
1047 RESTWarning <<
"cannot find ID with name \"" << in <<
"\"" <<
RESTendl;
1062 RESTMetadata <<
"Canvas divisions: (" << fCanvasDivisions.X() <<
" ," << fCanvasDivisions.Y() <<
")"
1064 RESTMetadata <<
"-------------------" <<
RESTendl;
1065 for (
const auto& plot :
fPlots) {
1066 RESTMetadata <<
"-------------------" <<
RESTendl;
1067 RESTMetadata <<
"Plot name/title: " << plot.name <<
" " << plot.title <<
RESTendl;
1068 RESTMetadata <<
"Save string: " << plot.save <<
RESTendl;
1069 RESTMetadata <<
"Set log X,Y,Z: " << plot.logX <<
", " << plot.logY <<
", " << plot.logZ <<
RESTendl;
1070 RESTMetadata <<
"Stack draw Option: " << plot.stackDrawOption <<
RESTendl;
1071 if (plot.legend) RESTMetadata <<
"Legend is ON" <<
RESTendl;
1072 if (plot.timeDisplay) RESTMetadata <<
"Time display is ON" <<
RESTendl;
1073 RESTMetadata <<
"Labels X,Y: " << plot.labelX <<
", " << plot.labelY <<
RESTendl;
1074 for (
const auto& hist : plot.histos) {
1075 RESTMetadata <<
"****************" <<
RESTendl;
1076 RESTMetadata <<
"Histo name: " << hist.name <<
RESTendl;
1077 RESTMetadata <<
"Draw Option: " << hist.drawOption <<
RESTendl;
1078 RESTMetadata <<
"Histogram size: " << hist.variable.size() <<
" with parameters:" <<
RESTendl;
1079 for (
size_t i = 0; i < hist.variable.size(); i++) {
1080 RESTMetadata <<
"\t" << i <<
" " << hist.variable[i] <<
", " << hist.nBins[i] <<
", "
1081 << hist.range[i].X() <<
", " << hist.range[i].Y() <<
RESTendl;
1083 RESTMetadata <<
"****************" <<
RESTendl;
1086 RESTMetadata <<
"-------------------" <<
RESTendl;
1088 RESTMetadata <<
"-------------------" <<
RESTendl;
1089 RESTMetadata <<
"Panel font size/precision " << panel.font_size <<
", " << panel.precision
1091 RESTMetadata <<
"****************" <<
RESTendl;
1092 for (
auto& [key, posLabel] : panel.variablePos) {
1093 auto&& [obs, label,
units] = key;
1094 RESTMetadata <<
"Label variable " << obs <<
", label " << label <<
", units " <<
units <<
" Pos ("
1095 << posLabel.X() <<
", " << posLabel.Y() <<
")" <<
RESTendl;
1097 RESTMetadata <<
"****************" <<
RESTendl;
1098 for (
auto& [key, posLabel] : panel.metadataPos) {
1099 auto&& [obs, label,
units] = key;
1100 RESTMetadata <<
"Label metadata " << obs <<
", label " << label <<
", units " <<
units <<
" Pos ("
1101 << posLabel.X() <<
", " << posLabel.Y() <<
")" <<
RESTendl;
1103 RESTMetadata <<
"****************" <<
RESTendl;
1104 for (
auto& [key, posLabel] : panel.obsPos) {
1105 auto&& [obs, label,
units] = key;
1106 RESTMetadata <<
"Label Observable " << obs <<
", label " << label <<
", units " <<
units
1107 <<
" Pos (" << posLabel.X() <<
", " << posLabel.Y() <<
")" <<
RESTendl;
1109 RESTMetadata <<
"****************" <<
RESTendl;
1110 for (
auto& [key, posLabel] : panel.expPos) {
1111 auto&& [obs, label,
units, precision] = key;
1112 RESTMetadata <<
"Label Expression " << obs <<
", label " << label <<
", units " <<
units
1113 <<
", precision " << precision <<
" Pos (" << posLabel.X() <<
", " << posLabel.Y()
1116 RESTMetadata <<
"****************" <<
RESTendl;
1118 RESTMetadata <<
"-------------------" <<
RESTendl;
A class to help on cuts definitions. To be used with TRestAnalysisTree.
Perform the plot over datasets.
Int_t GetIDFromMapString(const std::map< std::string, int > &mapStr, const std::string &in)
This functions gets the ID from a map string that is passed by reference. It is used to translate col...
std::vector< PanelInfo > fPanels
Vector with panels/label options.
TRestCut * ReadCut(TRestCut *cut, TiXmlElement *ele=nullptr)
this function is used to add the different cuts provided in different metadata sections,...
void Initialize() override
Function to initialize input/output event members and define the section name.
void PlotCombinedCanvas()
This functions performs the plot of the combined canvas with the different panels and plots.
const std::map< std::string, int > LineStyleMap
LineStyleMap as enum "ELineStyle" defined in TAttLine.h.
std::string fDataSetName
Name of the dataset to be imported.
void ReadPlotInfo()
This function reads the config file plot info and stores it in a vector of PlotInfo.
void ReadPanelInfo()
This function reads the config file panel info and stores it in a vector of PanelInfo.
void GenerateDataSetFromFilePattern(TRestDataSet &dataSet)
This functions generates a dataSet based on the information of the rml file. A TRestDataSet is pased ...
Int_t fPaletteStyle
Palette style.
const std::map< std::string, int > FillStyleMap
FillStyleMap as enum "EFillStyle" defined in TAttFill.h.
TRestDataSetPlot()
Default constructor.
TRestCut * fCut
Global cut for the entire dataSet.
Bool_t fPreviewPlot
Preview plot.
const std::map< std::string, int > ColorIdMap
Maps for internal use only.
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestDataSetPlot.
TVector2 fCanvasSize
Canvas options, size, divisions and margins.
std::string fOutputFileName
OutputFileName.
~TRestDataSetPlot()
Default destructor.
Double_t fLegendX1
Legend position and size.
std::vector< PlotInfo > fPlots
Vector with plots/pads options.
void InitFromConfigFile() override
Initialization of specific TRestDataSetPlot members through an RML file.
void CleanUp()
Clean up histos and text but note that the metadata is unchanged.
It allows to group a number of runs that satisfy given metadata conditions.
void Import(const std::string &fileName)
This function imports metadata from a root file it import metadata info from the previous dataSet whi...
Double_t GetTotalTimeInSeconds() const
It returns the accumulated run time in seconds.
ROOT::RDF::RNode MakeCut(const TRestCut *cut)
This function applies a TRestCut to the dataframe and returns a dataframe with the applied cuts....
void GenerateDataSet()
This function generates the data frame with the filelist and column names (or observables) that have ...
TTree * GetTree() const
Gives access to the tree.
static TRestRootFileHandle Open(const std::string &filename, TRestRootFileMode mode)
@ REST_Info
+show most of the information for each steps
Int_t GetChar(std::string hint="Press a KEY to continue ...")
Helps to pause the program, printing a message before pausing.
std::string IntegerToString(Int_t n, std::string format="%d")
Gets a string from an integer.
std::vector< std::string > Split(std::string in, std::string separator, bool allowBlankString=false, bool removeWhiteSpaces=false, int startPos=-1)
Split the input string according to the given separator. Returning a vector of fragments.
Double_t StringToDouble(std::string in)
Gets a double from a string.
std::string ToUpper(std::string in)
Convert string to its upper case. Alternative of TString::ToUpper.
Int_t StringToInteger(std::string in)
Gets an integer from a string.
Int_t isAExpression(const std::string &in)
Returns 1 only if valid mathematical expression keywords (or numbers) are found in the string in....
std::string DoubleToString(Double_t d, std::string format="%8.6e")
Gets a string from a double.
TVector2 StringTo2DVector(std::string in)
Gets a 2D-vector from a string.
std::string EvaluateExpression(std::string exp)
Evaluates a complex numerical expression and returns the resulting value using TFormula.
Int_t isANumber(std::string in)
Returns 1 only if a valid number is found in the string in. If not it returns 0.
std::string RemoveWhiteSpaces(std::string in)
Returns the input string removing all white spaces.
std::string ToDateTimeString(time_t time)
Format time_t into string.
std::string Replace(std::string in, std::string thisString, std::string byThisString, size_t fromPosition=0, Int_t N=0)
Replace any occurences of thisSring by byThisString inside string in.
Nested classes for internal use only.
Auxiliary class for panels/labels.
Auxiliary struct for plots/pads.
std::string metadata
The associated metadata member used to register the relevant quantity.
std::string strategy
It determines how to produce the relevant quantity (accumulate/unique/last/max/min)