CMS 3D CMS Logo

PdgIdExcluder.h
Go to the documentation of this file.
1 #ifndef CommonTools_Utils_PdgIdExcluder_h
2 #define CommonTools_Utils_PdgIdExcluder_h
3 /* \class PdgIdExcluder
4  *
5  * \author Luca Lista, INFN
6  *
7  * $Id: PdgIdExcluder.h,v 1.1 2009/02/24 15:01:17 llista Exp $
8  */
9 #include <vector>
10 #include <algorithm>
11 
12 struct PdgIdExcluder {
13  explicit PdgIdExcluder(const std::vector<int>& pdgId) {
14  pdgId_.reserve(pdgId.size());
15  for (int i : pdgId) {
16  pdgId_.push_back(abs(i));
17  }
18  }
19  template <typename T>
20  bool operator()(const T& t) const {
21  return std::find(pdgId_.begin(), pdgId_.end(), abs(t.pdgId())) == pdgId_.end();
22  }
23 
24 private:
25  std::vector<int> pdgId_;
26 };
27 
28 #endif
mps_fire.i
i
Definition: mps_fire.py:428
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
PdgIdExcluder::pdgId_
std::vector< int > pdgId_
Definition: PdgIdExcluder.h:25
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:118
PdgIdExcluder
Definition: PdgIdExcluder.h:12
T
long double T
Definition: Basic3DVectorLD.h:48
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PdgIdExcluder::PdgIdExcluder
PdgIdExcluder(const std::vector< int > &pdgId)
Definition: PdgIdExcluder.h:13
PdgIdExcluder::operator()
bool operator()(const T &t) const
Definition: PdgIdExcluder.h:20
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644