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 {
9  namespace eventhypothesis {
10 
12  class AndFilter : public ParticleFilter {
13  public:
14  AndFilter() : filters_(2) {}
16  ~AndFilter() override {}
18  filters_.push_back(filter);
19  return *this;
20  }
21  bool operator()(const CandRefType &cand, const std::string &role) const override;
22 
23  private:
24  boost::ptr_vector<ParticleFilter> filters_;
25  };
26 
28  class OrFilter : public ParticleFilter {
29  public:
30  OrFilter() : filters_(2) {}
32  ~OrFilter() override {}
34  filters_.push_back(filter);
35  return *this;
36  }
37  bool operator()(const CandRefType &cand, const std::string &role) const override;
38 
39  private:
40  boost::ptr_vector<ParticleFilter> filters_;
41  };
42 
43  class ByPdgId : public ParticleFilter {
44  public:
45  explicit ByPdgId(int32_t pdgCode, bool alsoAntiparticle = true);
46  ~ByPdgId() override {}
47  bool operator()(const CandRefType &cand, const std::string &role) const override;
48 
49  private:
50  int32_t pdgCode_;
52  };
53 
54  class ByString : public ParticleFilter {
55  public:
56  ByString(const std::string &cut); // not putting the explicit on purpose, I want to see what happens
57  ~ByString() override {}
58  bool operator()(const CandRefType &cand, const std::string &role) const override;
59 
60  private:
62  };
63 
64  } // namespace eventhypothesis
65 } // namespace pat
66 
67 #endif
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
pat::eventhypothesis::ByString
Definition: EventHypothesisTools.h:54
pat::eventhypothesis::ByString::~ByString
~ByString() override
Definition: EventHypothesisTools.h:57
pat::eventhypothesis::ByPdgId::pdgCode_
int32_t pdgCode_
Definition: EventHypothesisTools.h:50
pat::eventhypothesis::OrFilter::~OrFilter
~OrFilter() override
Definition: EventHypothesisTools.h:32
pat::eventhypothesis::ParticleFilter
Definition: EventHypothesis.h:24
pat::eventhypothesis::OrFilter::filters_
boost::ptr_vector< ParticleFilter > filters_
Definition: EventHypothesisTools.h:40
pat::eventhypothesis::AndFilter::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:10
EventHypothesis.h
pat::eventhypothesis::ByString::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:40
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
pat::eventhypothesis::AndFilter::AndFilter
AndFilter()
Definition: EventHypothesisTools.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pat::eventhypothesis::AndFilter::filters_
boost::ptr_vector< ParticleFilter > filters_
Definition: EventHypothesisTools.h:24
pat::eventhypothesis::OrFilter
Definition: EventHypothesisTools.h:28
pat::eventhypothesis::AndFilter::~AndFilter
~AndFilter() override
Definition: EventHypothesisTools.h:16
DeadROC_duringRun.f2
f2
Definition: DeadROC_duringRun.py:220
cand
Definition: decayParser.h:34
pat
Definition: HeavyIon.h:7
pat::eventhypothesis::ByPdgId::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:34
edm::Ptr< Candidate >
pat::eventhypothesis::ByPdgId
Definition: EventHypothesisTools.h:43
pat::eventhypothesis::OrFilter::OrFilter
OrFilter()
Definition: EventHypothesisTools.h:30
StringCutObjectSelector.h
pat::eventhypothesis::OrFilter::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:23
pat::eventhypothesis::ByPdgId::antiparticle_
bool antiparticle_
Definition: EventHypothesisTools.h:51
StringCutObjectSelector< reco::Candidate >
pat::eventhypothesis::ByString::ByString
ByString(const std::string &cut)
Definition: EventHypothesisTools.cc:38
pat::eventhypothesis::AndFilter
Definition: EventHypothesisTools.h:12
pat::eventhypothesis::ByPdgId::ByPdgId
ByPdgId(int32_t pdgCode, bool alsoAntiparticle=true)
Definition: EventHypothesisTools.cc:31
pat::eventhypothesis::ByPdgId::~ByPdgId
~ByPdgId() override
Definition: EventHypothesisTools.h:46
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
pat::eventhypothesis::OrFilter::operator&=
OrFilter & operator&=(ParticleFilter *filter)
Definition: EventHypothesisTools.h:33
pat::eventhypothesis::AndFilter::operator&=
AndFilter & operator&=(ParticleFilter *filter)
Definition: EventHypothesisTools.h:17
pat::eventhypothesis::ByString::sel_
StringCutObjectSelector< reco::Candidate > sel_
Definition: EventHypothesisTools.h:61