Skip to content

Commit fe6aad7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c978dba commit fe6aad7

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

source/framework/core/inc/TRestDataSet.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ class TRestDataSet : public TRestMetadata {
138138
TTree* GetTree() const {
139139
if (fTree == nullptr && fExternal) {
140140
RESTInfo << "The tree is not accessible. Only GetDataFrame can be used in an externally "
141-
"generated dataset" << RESTendl;
141+
"generated dataset"
142+
<< RESTendl;
142143
RESTInfo << "You may write a tree using GetDataFrame()->Snapshot(\"MyTree\", \"output.root\");"
143144
<< RESTendl;
144145
return fTree;

source/framework/core/src/TRestDataSet.cxx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ void TRestDataSet::GenerateDataSet() {
388388
fDataFrame = MakeCut(fCut);
389389

390390
// Adding new user columns added to the dataset
391-
for (const auto & [ cName, cExpression ] : fColumnNameExpressions) {
391+
for (const auto& [cName, cExpression] : fColumnNameExpressions) {
392392
RESTInfo << "Adding column to dataset: " << cName << RESTendl;
393393
finalList.emplace_back(cName);
394394
fDataFrame = DefineColumn(cName, cExpression);
@@ -429,7 +429,8 @@ std::vector<std::string> TRestDataSet::FileSelection() {
429429

430430
if (!time_stamp_end || !time_stamp_start) {
431431
RESTError << "TRestDataSet::FileSelect. Start or end dates not properly formed. Please, check "
432-
"REST_StringHelper::StringToTimeStamp documentation for valid formats" << RESTendl;
432+
"REST_StringHelper::StringToTimeStamp documentation for valid formats"
433+
<< RESTendl;
433434
return fFileSelection;
434435
}
435436

@@ -482,7 +483,7 @@ std::vector<std::string> TRestDataSet::FileSelection() {
482483
if (!accept) continue;
483484

484485
Double_t acc = 0;
485-
for (auto & [ name, properties ] : fQuantity) {
486+
for (auto& [name, properties] : fQuantity) {
486487
std::string value = run.ReplaceMetadataMembers(properties.metadata);
487488
const Double_t val = REST_StringHelper::StringToDouble(value);
488489

@@ -557,7 +558,7 @@ ROOT::RDF::RNode TRestDataSet::MakeCut(const TRestCut* cut) {
557558

558559
auto paramCut = cut->GetParamCut();
559560
auto obsList = df.GetColumnNames();
560-
for (const auto & [ param, condition ] : paramCut) {
561+
for (const auto& [param, condition] : paramCut) {
561562
if (std::find(obsList.begin(), obsList.end(), param) != obsList.end()) {
562563
std::string pCut = param + condition;
563564
RESTDebug << "Applying cut " << pCut << RESTendl;
@@ -618,7 +619,7 @@ ROOT::RDF::RNode TRestDataSet::DefineColumn(const std::string& columnName, const
618619
auto df = fDataFrame;
619620

620621
std::string evalFormula = formula;
621-
for (auto const & [ name, properties ] : fQuantity)
622+
for (auto const& [name, properties] : fQuantity)
622623
evalFormula = REST_StringHelper::Replace(evalFormula, name, properties.value);
623624

624625
df = df.Define(columnName, evalFormula);
@@ -684,7 +685,7 @@ void TRestDataSet::PrintMetadata() {
684685
RESTMetadata << " Relevant quantities: " << RESTendl;
685686
RESTMetadata << " -------------------- " << RESTendl;
686687

687-
for (auto const & [ name, properties ] : fQuantity) {
688+
for (auto const& [name, properties] : fQuantity) {
688689
RESTMetadata << " - Name : " << name << ". Value : " << properties.value
689690
<< ". Strategy: " << properties.strategy << RESTendl;
690691
RESTMetadata << " - Metadata: " << properties.metadata << RESTendl;
@@ -696,7 +697,7 @@ void TRestDataSet::PrintMetadata() {
696697
if (!fColumnNameExpressions.empty()) {
697698
RESTMetadata << " New columns added to generated dataframe: " << RESTendl;
698699
RESTMetadata << " ---------------------------------------- " << RESTendl;
699-
for (const auto & [ cName, cExpression ] : fColumnNameExpressions) {
700+
for (const auto& [cName, cExpression] : fColumnNameExpressions) {
700701
RESTMetadata << " - Name : " << cName << RESTendl;
701702
RESTMetadata << " - Expression: " << cExpression << RESTendl;
702703
RESTMetadata << " " << RESTendl;
@@ -862,10 +863,11 @@ void TRestDataSet::Export(const std::string& filename, std::vector<std::string>
862863

863864
std::vector<std::string> columns = fDataFrame.GetColumnNames();
864865
if (!excludeColumns.empty()) {
865-
columns.erase(std::remove_if(columns.begin(), columns.end(), [&excludeColumns](std::string elem) {
866-
return std::find(excludeColumns.begin(), excludeColumns.end(), elem) !=
867-
excludeColumns.end();
868-
}),
866+
columns.erase(std::remove_if(columns.begin(), columns.end(),
867+
[&excludeColumns](std::string elem) {
868+
return std::find(excludeColumns.begin(), excludeColumns.end(),
869+
elem) != excludeColumns.end();
870+
}),
869871
columns.end());
870872

871873
RESTInfo << "Re-Generating snapshot." << RESTendl;
@@ -900,7 +902,8 @@ void TRestDataSet::Export(const std::string& filename, std::vector<std::string>
900902
if (type != "Double_t" && type != "Int_t") {
901903
RESTError << "Branch name : " << bName << " is type : " << type << RESTendl;
902904
RESTError << "Only Int_t and Double_t types are allowed for "
903-
"exporting to ASCII table" << RESTendl;
905+
"exporting to ASCII table"
906+
<< RESTendl;
904907
RESTError << "File will not be generated" << RESTendl;
905908
return;
906909
}
@@ -935,7 +938,7 @@ void TRestDataSet::Export(const std::string& filename, std::vector<std::string>
935938
}
936939
fprintf(f, "###\n");
937940
fprintf(f, "### Relevant quantities: \n");
938-
for (auto & [ name, properties ] : fQuantity) {
941+
for (auto& [name, properties] : fQuantity) {
939942
fprintf(f, "### - %s : %s - %s\n", name.c_str(), properties.value.c_str(),
940943
properties.description.c_str());
941944
}

source/framework/sensitivity/src/TRestComponentDataSet.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ std::vector<Int_t> TRestComponentDataSet::ExtractNodeStatistics() {
440440
nEv = fDataSet.GetDataFrame().Filter(filter).Range(fSamples).Count();
441441
}
442442

443-
if ((Int_t) * nEv < fSamples) {
443+
if ((Int_t)*nEv < fSamples) {
444444
RESTWarning << "The number of requested samples (" << fSamples
445445
<< ") is higher than the number of dataset entries (" << *nEv << ")" << RESTendl;
446446
}

0 commit comments

Comments
 (0)