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
pat::eventhypothesis::AndFilter::filters_
std::vector< std::unique_ptr< ParticleFilter > > filters_
Definition: EventHypothesisTools.h:26
pat::eventhypothesis::OrFilter::filters_
std::vector< std::unique_ptr< ParticleFilter > > filters_
Definition: EventHypothesisTools.h:42
pat::eventhypothesis::ByString
Definition: EventHypothesisTools.h:56
pat::eventhypothesis::ByString::~ByString
~ByString() override
Definition: EventHypothesisTools.h:59
pat::eventhypothesis::ByPdgId::pdgCode_
int32_t pdgCode_
Definition: EventHypothesisTools.h:52
pat::eventhypothesis::OrFilter::~OrFilter
~OrFilter() override
Definition: EventHypothesisTools.h:34
pat::eventhypothesis::ParticleFilter
Definition: EventHypothesis.h:24
pat::eventhypothesis::AndFilter::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:11
EventHypothesis.h
pat::eventhypothesis::ByString::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:41
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
pat::eventhypothesis::AndFilter::AndFilter
AndFilter()
Definition: EventHypothesisTools.h:16
pat::eventhypothesis::OrFilter
Definition: EventHypothesisTools.h:30
pat::eventhypothesis::AndFilter::~AndFilter
~AndFilter() override
Definition: EventHypothesisTools.h:18
DeadROC_duringRun.f2
f2
Definition: DeadROC_duringRun.py:220
cand
Definition: decayParser.h:32
pat
Definition: HeavyIon.h:7
pat::eventhypothesis::ByPdgId::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:35
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Ptr< Candidate >
pat::eventhypothesis::ByPdgId
Definition: EventHypothesisTools.h:45
pat::eventhypothesis::OrFilter::OrFilter
OrFilter()
Definition: EventHypothesisTools.h:32
StringCutObjectSelector.h
pat::eventhypothesis::OrFilter::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:24
pat::eventhypothesis::ByPdgId::antiparticle_
bool antiparticle_
Definition: EventHypothesisTools.h:53
PA_MinBiasSkim_cff.cut
cut
Definition: PA_MinBiasSkim_cff.py:13
StringCutObjectSelector< reco::Candidate >
pat::eventhypothesis::ByString::ByString
ByString(const std::string &cut)
Definition: EventHypothesisTools.cc:39
pat::eventhypothesis::AndFilter
Definition: EventHypothesisTools.h:14
pat::eventhypothesis::ByPdgId::ByPdgId
ByPdgId(int32_t pdgCode, bool alsoAntiparticle=true)
Definition: EventHypothesisTools.cc:32
pat::eventhypothesis::ByPdgId::~ByPdgId
~ByPdgId() override
Definition: EventHypothesisTools.h:48
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
pat::eventhypothesis::OrFilter::operator&=
OrFilter & operator&=(ParticleFilter *filter)
Definition: EventHypothesisTools.h:35
pat::eventhypothesis::AndFilter::operator&=
AndFilter & operator&=(ParticleFilter *filter)
Definition: EventHypothesisTools.h:19
pat::eventhypothesis::ByString::sel_
StringCutObjectSelector< reco::Candidate > sel_
Definition: EventHypothesisTools.h:63