CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PdgIdSelector Struct Reference

#include <PdgIdSelector.h>

Inheritance diagram for PdgIdSelector:
reco::PdgIdSelectorHandler

Public Member Functions

template<typename T >
bool operator() (const T &t) const
 
PdgIdSelectoroperator= (const PdgIdSelector &o)=default
 
PdgIdSelectoroperator== (const PdgIdSelector &o)
 
 PdgIdSelector (const std::vector< int > &pdgId)
 
 PdgIdSelector (const PdgIdSelector &o)
 

Private Attributes

std::vector< int >::const_iterator begin_
 
std::vector< int >::const_iterator end_
 
std::vector< int > pdgId_
 

Detailed Description

Definition at line 12 of file PdgIdSelector.h.

Constructor & Destructor Documentation

◆ PdgIdSelector() [1/2]

PdgIdSelector::PdgIdSelector ( const std::vector< int > &  pdgId)
inline

Definition at line 13 of file PdgIdSelector.h.

References funct::abs(), begin_, end_, mps_fire::i, EgammaValidation_cff::pdgId, and pdgId_.

13  {
14  for (std::vector<int>::const_iterator i = pdgId.begin(); i != pdgId.end(); ++i)
15  pdgId_.push_back(abs(*i));
16  begin_ = pdgId_.begin();
17  end_ = pdgId_.end();
18  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< int >::const_iterator end_
Definition: PdgIdSelector.h:32
std::vector< int >::const_iterator begin_
Definition: PdgIdSelector.h:32
std::vector< int > pdgId_
Definition: PdgIdSelector.h:31

◆ PdgIdSelector() [2/2]

PdgIdSelector::PdgIdSelector ( const PdgIdSelector o)
inline

Definition at line 19 of file PdgIdSelector.h.

19 : pdgId_(o.pdgId_), begin_(pdgId_.begin()), end_(pdgId_.end()) {}
std::vector< int >::const_iterator end_
Definition: PdgIdSelector.h:32
std::vector< int >::const_iterator begin_
Definition: PdgIdSelector.h:32
std::vector< int > pdgId_
Definition: PdgIdSelector.h:31

Member Function Documentation

◆ operator()()

template<typename T >
bool PdgIdSelector::operator() ( const T t) const
inline

Definition at line 26 of file PdgIdSelector.h.

References funct::abs(), begin_, end_, spr::find(), and submitPVValidationJobs::t.

26  {
27  return std::find(begin_, end_, abs(t.pdgId())) != end_;
28  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< int >::const_iterator end_
Definition: PdgIdSelector.h:32
std::vector< int >::const_iterator begin_
Definition: PdgIdSelector.h:32

◆ operator=()

PdgIdSelector& PdgIdSelector::operator= ( const PdgIdSelector o)
default

◆ operator==()

PdgIdSelector& PdgIdSelector::operator== ( const PdgIdSelector o)
inline

Definition at line 21 of file PdgIdSelector.h.

References EcalTangentSkim_cfg::o.

21  {
22  *this = o;
23  return *this;
24  }

Member Data Documentation

◆ begin_

std::vector<int>::const_iterator PdgIdSelector::begin_
private

Definition at line 32 of file PdgIdSelector.h.

Referenced by operator()(), and PdgIdSelector().

◆ end_

std::vector<int>::const_iterator PdgIdSelector::end_
private

Definition at line 32 of file PdgIdSelector.h.

Referenced by operator()(), and PdgIdSelector().

◆ pdgId_

std::vector<int> PdgIdSelector::pdgId_
private

Definition at line 31 of file PdgIdSelector.h.

Referenced by PdgIdSelector().