CMS 3D CMS Logo

Public Member Functions | Private Attributes

pat::eventhypothesis::ByPdgId Class Reference

#include <EventHypothesisTools.h>

Inheritance diagram for pat::eventhypothesis::ByPdgId:
pat::eventhypothesis::ParticleFilter

List of all members.

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_

Detailed Description

Definition at line 34 of file EventHypothesisTools.h.


Constructor & Destructor Documentation

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.

{}

Member Function Documentation

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_);
}

Member Data Documentation

Definition at line 41 of file EventHypothesisTools.h.

Referenced by operator()().

Definition at line 40 of file EventHypothesisTools.h.

Referenced by operator()().