CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.2 2009/09/04 12:37:20 hegner Exp $
8  */
9 #include <vector>
10 #include <algorithm>
11 
12 struct PdgIdExcluder {
13  PdgIdExcluder( const std::vector<int> & pdgId ) {
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  }
20  pdgId_( o.pdgId_ ), begin_( pdgId_.begin() ), end_( pdgId_.end() ) { }
22  * this = o; return * this;
23  }
24  template<typename T>
25  bool operator()( const T & t ) const {
26  return std::find( begin_, end_, abs( t.pdgId() ) ) == end_;
27  }
28  private:
29  std::vector<int> pdgId_;
30  std::vector<int>::const_iterator begin_, end_;
31 };
32 
33 #endif
int i
Definition: DBlmapReader.cc:9
bool operator()(const T &t) const
Definition: PdgIdExcluder.h:25
std::vector< int > pdgId_
Definition: PdgIdExcluder.h:29
#define abs(x)
Definition: mlp_lapack.h:159
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
PdgIdExcluder & operator=(const PdgIdExcluder &o)
Definition: PdgIdExcluder.h:21
#define end
Definition: vmac.h:38
PdgIdExcluder(const PdgIdExcluder &o)
Definition: PdgIdExcluder.h:19
#define begin
Definition: vmac.h:31
PdgIdExcluder(const std::vector< int > &pdgId)
Definition: PdgIdExcluder.h:13
std::vector< int >::const_iterator end_
Definition: PdgIdExcluder.h:30
long double T
std::vector< int >::const_iterator begin_
Definition: PdgIdExcluder.h:30