32 Cuts& operator=(
const Cuts& cut) =
default;
33 virtual ~Cuts() =
default;
35 Cuts(std::string name, std::vector<SimpleCut> cuts) : name_(std::move(name)),
36 cuts_(std::move(cuts)) {
37 for (
const auto& v : cuts_) {
38 const auto& br = v.GetBranches();
39 branch_names_.insert(br.begin(), br.end());
43 Cuts(std::string name, std::initializer_list<SimpleCut> cuts) : name_(std::move(name)),
44 cuts_(cuts.begin(), cuts.end()) {
45 for (
const auto& v : cuts_) {
46 const auto& br = v.GetBranches();
47 branch_names_.insert(br.begin(), br.end());
58 bool Apply(
const T&
object)
const {
60 throw std::runtime_error(
"Cuts::Apply - cut is not initialized!!");
62 for (
const auto& cut : cuts_) {
63 if (!cut.
Apply(
object))
71 bool Apply(std::vector<const BranchChannel*>& bch, std::vector<size_t>&
id)
const;
77 ANALYSISTREE_ATTR_NODISCARD
const std::set<std::string>& GetBranches()
const {
return branch_names_; }
78 ANALYSISTREE_ATTR_DEPRECATED()
79 ANALYSISTREE_ATTR_NODISCARD const std::
string&
80 GetBranchName()
const {
81 assert(branch_names_.size() == 1);
82 return *branch_names_.begin();
85 ANALYSISTREE_ATTR_NODISCARD std::set<size_t> GetBranchIds()
const {
return branch_ids_; }
86 ANALYSISTREE_ATTR_NODISCARD
const std::string& GetName()
const {
return name_; }
88 std::vector<SimpleCut>& GetCuts() {
return cuts_; }
90 friend bool operator==(
const Cuts& that,
const Cuts& other);
91 static bool Equal(
const Cuts* that,
const Cuts* other);
95 std::set<std::string> branch_names_{};
96 std::set<size_t> branch_ids_{};
97 std::vector<SimpleCut> cuts_{};