CMS 3D CMS Logo

EventHypothesisTools.cc
Go to the documentation of this file.
2 
3 using namespace pat::eventhypothesis;
4 
6  filters_.push_back(f1);
7  filters_.push_back(f2);
8 }
9 
10 bool AndFilter::operator()(const CandRefType &cand, const std::string &role) const {
11  for (boost::ptr_vector<ParticleFilter>::const_iterator it = filters_.begin(); it != filters_.end(); ++it) {
12  if (!(*it)(cand, role))
13  return false;
14  }
15  return true;
16 }
17 
19  filters_.push_back(f1);
20  filters_.push_back(f2);
21 }
22 
23 bool OrFilter::operator()(const CandRefType &cand, const std::string &role) const {
24  for (boost::ptr_vector<ParticleFilter>::const_iterator it = filters_.begin(); it != filters_.end(); ++it) {
25  if ((*it)(cand, role))
26  return true;
27  }
28  return false;
29 }
30 
31 ByPdgId::ByPdgId(int32_t pdgCode, bool alsoAntiparticle)
32  : pdgCode_(alsoAntiparticle ? std::abs(pdgCode) : pdgCode), antiparticle_(alsoAntiparticle) {}
33 
34 bool ByPdgId::operator()(const CandRefType &cand, const std::string &role) const {
35  return antiparticle_ ? (std::abs(cand->pdgId()) == pdgCode_) : (cand->pdgId() == pdgCode_);
36 }
37 
39 
40 bool ByString::operator()(const CandRefType &cand, const std::string &role) const { return sel_(*cand); }
pat::eventhypothesis
Definition: EventHypothesis.h:15
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
pat::eventhypothesis::ByPdgId::pdgCode_
int32_t pdgCode_
Definition: EventHypothesisTools.h:50
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
pat::eventhypothesis::ByString::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:40
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
DeadROC_duringRun.f2
f2
Definition: DeadROC_duringRun.py:220
EventHypothesisTools.h
cand
Definition: decayParser.h:34
pat::eventhypothesis::ByPdgId::operator()
bool operator()(const CandRefType &cand, const std::string &role) const override
Definition: EventHypothesisTools.cc:34
edm::Ptr< Candidate >
pat::eventhypothesis::OrFilter::OrFilter
OrFilter()
Definition: EventHypothesisTools.h:30
std
Definition: JetResolutionObject.h:76
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
pat::eventhypothesis::ByString::ByString
ByString(const std::string &cut)
Definition: EventHypothesisTools.cc:38
pat::eventhypothesis::ByPdgId::ByPdgId
ByPdgId(int32_t pdgCode, bool alsoAntiparticle=true)
Definition: EventHypothesisTools.cc:31
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
pat::eventhypothesis::ByString::sel_
StringCutObjectSelector< reco::Candidate > sel_
Definition: EventHypothesisTools.h:61