Skip to content

Commit

Permalink
Merge pull request #240 from rest-for-physics/plotsRunTagSubstring
Browse files Browse the repository at this point in the history
TRestAnalysisPlot - it now accepts substrings of a runtag
  • Loading branch information
cmargalejo authored Jun 6, 2022
2 parents b5f2709 + e050f1c commit 33d5c1f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions source/framework/core/src/TRestAnalysisPlot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ TRestAnalysisPlot::Histo_Info_Set TRestAnalysisPlot::SetupHistogramFromConfigFil
}

void TRestAnalysisPlot::AddFile(TString fileName) {
RESTDebug << "TRestAnalysisPlot::AddFile. Adding file. " << RESTendl;
RESTDebug << "File name: " << fileName << RESTendl;
RESTInfo << "TRestAnalysisPlot::AddFile. Adding file. " << RESTendl;
RESTInfo << "File name: " << fileName << RESTendl;
fRunInputFileName.push_back((string)fileName);
fNFiles++;
}
Expand Down Expand Up @@ -738,13 +738,11 @@ void TRestAnalysisPlot::PlotCombinedCanvas() {
auto run = GetRunInfo(fRunInputFileName[j]);
// apply "classify" condition
bool flag = true;
auto iter = hist.classifyMap.begin();
while (iter != hist.classifyMap.end()) {
if (run->GetRunInformation(iter->first) != iter->second) {
for (const auto& [inputFile, info] : hist.classifyMap) {
if (run->GetRunInformation(inputFile).find(info) == string::npos) {
flag = false;
break;
}
iter++;
}
if (!flag) continue;

Expand Down Expand Up @@ -792,6 +790,9 @@ void TRestAnalysisPlot::PlotCombinedCanvas() {
hTotal->SetCanExtend(TH1::kAllAxes);
tree->Draw(plotString + ">>+" + hTotal->GetName(), cutString, optString,
fDrawNEntries, fDrawFirstEntry);
RESTInfo << "AnalysisTree->Draw(\"" << plotString << ">>+" << hTotal->GetName()
<< "\", \"" << cutString << "\", \"" << optString << "\", "
<< fDrawNEntries << ", " << fDrawFirstEntry << ")" << RESTendl;
hTotal->SetDirectory(0);
} else {
hTotal->Add(hh);
Expand Down

0 comments on commit 33d5c1f

Please sign in to comment.