#include <EventHypothesisTools.h>
Public Member Functions | |
ByPdgId (int32_t pdgCode, bool alsoAntiparticle=true) | |
virtual bool | operator() (const CandRefType &cand, const std::string &role) const |
virtual | ~ByPdgId () |
Private Attributes | |
bool | antiparticle_ |
int32_t | pdgCode_ |
Definition at line 34 of file EventHypothesisTools.h.
ByPdgId::ByPdgId | ( | int32_t | pdgCode, |
bool | alsoAntiparticle = true |
||
) | [explicit] |
Definition at line 31 of file EventHypothesisTools.cc.
: pdgCode_(alsoAntiparticle ? std::abs(pdgCode) : pdgCode), antiparticle_(alsoAntiparticle) { }
virtual pat::eventhypothesis::ByPdgId::~ByPdgId | ( | ) | [inline, virtual] |
Definition at line 37 of file EventHypothesisTools.h.
{}
bool ByPdgId::operator() | ( | const CandRefType & | cand, |
const std::string & | role | ||
) | const [virtual] |
Implements pat::eventhypothesis::ParticleFilter.
Definition at line 37 of file EventHypothesisTools.cc.
References abs, antiparticle_, and pdgCode_.
{ return antiparticle_ ? (std::abs(cand->pdgId()) == pdgCode_) : (cand->pdgId() == pdgCode_); }
bool pat::eventhypothesis::ByPdgId::antiparticle_ [private] |
Definition at line 41 of file EventHypothesisTools.h.
Referenced by operator()().
int32_t pat::eventhypothesis::ByPdgId::pdgCode_ [private] |
Definition at line 40 of file EventHypothesisTools.h.
Referenced by operator()().