29 Cuts(
const Cuts& cut) =
default;
30 Cuts(Cuts&& cut) =
default;
31 Cuts& operator=(Cuts&&) =
default;
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());
53 void AddCuts(
const std::vector<SimpleCut>& cuts);
62 bool Apply(
const T&
object)
const {
64 throw std::runtime_error(
"Cuts::Apply - cut is not initialized!!");
66 for (
const auto& cut : cuts_) {
67 if (!cut.
Apply(
object))
75 bool Apply(std::vector<const BranchChannel*>& bch, std::vector<size_t>&
id)
const;
81 ANALYSISTREE_ATTR_NODISCARD
const std::set<std::string>& GetBranches()
const {
return branch_names_; }
82 ANALYSISTREE_ATTR_DEPRECATED()
83 ANALYSISTREE_ATTR_NODISCARD const std::
string&
84 GetBranchName()
const {
85 assert(branch_names_.size() == 1);
86 return *branch_names_.begin();
89 ANALYSISTREE_ATTR_NODISCARD std::set<size_t> GetBranchIds()
const {
return branch_ids_; }
90 ANALYSISTREE_ATTR_NODISCARD
const std::string& GetName()
const {
return name_; }
92 void SetName(
const std::string& name) { name_ = name; }
94 std::vector<SimpleCut>& GetCuts() {
return cuts_; }
96 friend bool operator==(
const Cuts& that,
const Cuts& other);
97 static bool Equal(
const Cuts* that,
const Cuts* other);
101 std::set<std::string> branch_names_{};
102 std::set<size_t> branch_ids_{};
103 std::vector<SimpleCut> cuts_{};
105 bool is_init_{
false};