test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~AndFilter() {}
16  AndFilter & operator&=(ParticleFilter *filter) { filters_.push_back(filter); return *this; }
17  virtual bool operator()(const CandRefType &cand, const std::string &role) const ;
18  private:
19  boost::ptr_vector<ParticleFilter> filters_;
20  };
21 
23  class OrFilter : public ParticleFilter {
24  public:
25  OrFilter() : filters_(2) {}
27  virtual ~OrFilter() {}
28  OrFilter & operator&=(ParticleFilter *filter) { filters_.push_back(filter); return *this; }
29  virtual bool operator()(const CandRefType &cand, const std::string &role) const ;
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  virtual ~ByPdgId() {}
38  virtual bool operator()(const CandRefType &cand, const std::string &role) const ;
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  virtual ~ByString() {}
48  virtual bool operator()(const CandRefType &cand, const std::string &role) const ;
49  private:
51 
52  };
53 
54 
55 
56 } }
57 
58 #endif
virtual bool operator()(const CandRefType &cand, const std::string &role) const
ByPdgId(int32_t pdgCode, bool alsoAntiparticle=true)
AndFilter & operator&=(ParticleFilter *filter)
virtual bool operator()(const CandRefType &cand, const std::string &role) const
ByString(const std::string &cut)
virtual bool operator()(const CandRefType &cand, const std::string &role) const
boost::ptr_vector< ParticleFilter > filters_
OrFilter & operator&=(ParticleFilter *filter)
StringCutObjectSelector< reco::Candidate > sel_
virtual bool operator()(const CandRefType &cand, const std::string &role) const
boost::ptr_vector< ParticleFilter > filters_