Skip to content

Commit

Permalink
apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
lubynets committed Feb 14, 2025
1 parent ac66d94 commit 574e9aa
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion infra/Cuts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void Cuts::AddCut(const SimpleCut& cut) {
}

void Cuts::AddCuts(const std::vector<SimpleCut>& cuts) {
for(auto& cut : cuts) {
for (auto& cut : cuts) {
AddCut(cut);
}
}
Expand Down
34 changes: 17 additions & 17 deletions infra/Cuts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ class Cuts {

void AddCuts(const std::vector<SimpleCut>& cuts);

// // Base case for variadic recursion (handles when there's just one argument left)
// template<typename T>
// void AddCuts(const T& t) {
// AddCuts(t); // Call the appropriate overload for a single argument (like std::vector<SimpleCut>)
// }
//
// // Recursive case for variadic template (multiple arguments)
// template<typename T, typename... Args>
// void AddCuts(const T& t, const Args&... args) {
// AddCuts(t);
// AddCuts(args...);
// }
//
// template<typename... Args> // TODO this constructor hangs. Needs debugging
// Cuts(std::string name, Args... args) : name_(std::move(name)) {
// AddCuts(args...);
// }
// // Base case for variadic recursion (handles when there's just one argument left)
// template<typename T>
// void AddCuts(const T& t) {
// AddCuts(t); // Call the appropriate overload for a single argument (like std::vector<SimpleCut>)
// }
//
// // Recursive case for variadic template (multiple arguments)
// template<typename T, typename... Args>
// void AddCuts(const T& t, const Args&... args) {
// AddCuts(t);
// AddCuts(args...);
// }
//
// template<typename... Args> // TODO this constructor hangs. Needs debugging
// Cuts(std::string name, Args... args) : name_(std::move(name)) {
// AddCuts(args...);
// }

/**
* @brief Evaluates all SimpleCuts
Expand Down
10 changes: 5 additions & 5 deletions infra/HelperFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ inline std::string ToStringWithPrecision(const T a_value, const int n) {

inline std::vector<AnalysisTree::SimpleCut> CreateSliceCuts(const std::vector<float>& ranges, const std::string& cutNamePrefix, const std::string& branchFieldName) {
std::vector<AnalysisTree::SimpleCut> sliceCuts;
for(int iRange=0; iRange<ranges.size()-1; iRange++) {
const std::string cutName = cutNamePrefix + ToStringWithPrecision(ranges.at(iRange), 2) + "_" + ToStringWithPrecision(ranges.at(iRange+1), 2);
sliceCuts.emplace_back(AnalysisTree::RangeCut(branchFieldName, ranges.at(iRange), ranges.at(iRange+1), cutName));
for (int iRange = 0; iRange < ranges.size() - 1; iRange++) {
const std::string cutName = cutNamePrefix + ToStringWithPrecision(ranges.at(iRange), 2) + "_" + ToStringWithPrecision(ranges.at(iRange + 1), 2);
sliceCuts.emplace_back(AnalysisTree::RangeCut(branchFieldName, ranges.at(iRange), ranges.at(iRange + 1), cutName));
}

return sliceCuts;
}

}
#endif // ANALYSISTREE_INFRA_HELPER_FUNCTIONS_HPP
}// namespace HelperFunctions
#endif// ANALYSISTREE_INFRA_HELPER_FUNCTIONS_HPP
2 changes: 1 addition & 1 deletion infra/SimpleCut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SimpleCut {

SimpleCut(const std::vector<Variable>& vars, std::function<bool(std::vector<double>&)> lambda, std::string title = "") : title_(std::move(title)),
lambda_(std::move(lambda)) {
for(auto& var : vars) {
for (auto& var : vars) {
vars_.emplace_back(var);
}
FillBranchNames();
Expand Down

0 comments on commit 574e9aa

Please sign in to comment.