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 
4 #include "boost/ptr_container/ptr_vector.hpp"
7 
8 namespace pat { namespace eventhypothesis {
9 
11  class AndFilter : public ParticleFilter {
12  public:
13  AndFilter() : filters_(2) {}
15  ~AndFilter() override {}
16  AndFilter & operator&=(ParticleFilter *filter) { filters_.push_back(filter); return *this; }
17  bool operator()(const CandRefType &cand, const std::string &role) const override ;
18  private:
19  boost::ptr_vector<ParticleFilter> filters_;
20  };
21 
23  class OrFilter : public ParticleFilter {
24  public:
25  OrFilter() : filters_(2) {}
27  ~OrFilter() override {}
28  OrFilter & operator&=(ParticleFilter *filter) { filters_.push_back(filter); return *this; }
29  bool operator()(const CandRefType &cand, const std::string &role) const override ;
30  private:
31  boost::ptr_vector<ParticleFilter> filters_;
32  };
33 
34  class ByPdgId : public ParticleFilter {
35  public:
36  explicit ByPdgId(int32_t pdgCode, bool alsoAntiparticle=true) ;
37  ~ByPdgId() override {}
38  bool operator()(const CandRefType &cand, const std::string &role) const override ;
39  private:
40  int32_t pdgCode_;
42  };
43 
44  class ByString : public ParticleFilter {
45  public:
46  ByString(const std::string &cut) ; // not putting the explicit on purpose, I want to see what happens
47  ~ByString() override {}
48  bool operator()(const CandRefType &cand, const std::string &role) const override ;
49  private:
51 
52  };
53 
54 
55 
56 } }
57 
58 #endif
AndFilter & operator&=(ParticleFilter *filter)
Definition: HeavyIon.h:7
boost::ptr_vector< ParticleFilter > filters_
OrFilter & operator&=(ParticleFilter *filter)
StringCutObjectSelector< reco::Candidate > sel_
boost::ptr_vector< ParticleFilter > filters_
bool operator()(const CandRefType &cand, const std::string &role) const override