CMS 3D CMS Logo

EventHypothesisTools.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatUtils_interface_EventHypothesisTools_h
2 #define PhysicsTools_PatUtils_interface_EventHypothesisTools_h
3 
6 
7 #include <memory>
8 #include <vector>
9 
10 namespace pat {
11  namespace eventhypothesis {
12 
14  class AndFilter : public ParticleFilter {
15  public:
16  AndFilter() : filters_(2) {}
18  ~AndFilter() override {}
20  filters_.emplace_back(filter);
21  return *this;
22  }
23  bool operator()(const CandRefType &cand, const std::string &role) const override;
24 
25  private:
26  std::vector<std::unique_ptr<ParticleFilter>> filters_;
27  };
28 
30  class OrFilter : public ParticleFilter {
31  public:
32  OrFilter() : filters_(2) {}
34  ~OrFilter() override {}
36  filters_.emplace_back(filter);
37  return *this;
38  }
39  bool operator()(const CandRefType &cand, const std::string &role) const override;
40 
41  private:
42  std::vector<std::unique_ptr<ParticleFilter>> filters_;
43  };
44 
45  class ByPdgId : public ParticleFilter {
46  public:
47  explicit ByPdgId(int32_t pdgCode, bool alsoAntiparticle = true);
48  ~ByPdgId() override {}
49  bool operator()(const CandRefType &cand, const std::string &role) const override;
50 
51  private:
52  int32_t pdgCode_;
54  };
55 
56  class ByString : public ParticleFilter {
57  public:
58  ByString(const std::string &cut); // not putting the explicit on purpose, I want to see what happens
59  ~ByString() override {}
60  bool operator()(const CandRefType &cand, const std::string &role) const override;
61 
62  private:
64  };
65 
66  } // namespace eventhypothesis
67 } // namespace pat
68 
69 #endif
ByPdgId(int32_t pdgCode, bool alsoAntiparticle=true)
std::vector< std::unique_ptr< ParticleFilter > > filters_
ByString(const std::string &cut)
bool operator()(const CandRefType &cand, const std::string &role) const override
OrFilter & operator &=(ParticleFilter *filter)
Definition: HeavyIon.h:7
bool operator()(const CandRefType &cand, const std::string &role) const override
StringCutObjectSelector< reco::Candidate > sel_
bool operator()(const CandRefType &cand, const std::string &role) const override
std::vector< std::unique_ptr< ParticleFilter > > filters_
bool operator()(const CandRefType &cand, const std::string &role) const override
AndFilter & operator &=(ParticleFilter *filter)