CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PartonQualifier.h
Go to the documentation of this file.
1 #ifndef PartonQualifier_h
2 #define PartonQualifier_h
3 
4 #include <memory>
5 #include <string>
6 #include <vector>
7 
11 
13 
14  public:
17  bool operator()(const reco::GenParticle&);
18 
19  private:
20 
21  int status_;
22  std::vector<int> partons_;
23 };
24 
25 inline
27  status_ ( cfg.getParameter<int>( "status" ) ),
28  partons_( cfg.getParameter<std::vector<int> >( "partons" ) )
29 {
30 }
31 
32 inline bool
34 {
35  if( part.status()!=status_)
36  // does the particle have the correct status?
37  return false;
38 
39  if( !(std::count(partons_.begin(), partons_.end(), fabs(part.pdgId()))>0) )
40  // is the particle pdg contained in the list of partons?
41  return false;
42 
43  return true;
44 }
45 
46 #endif
virtual int pdgId() const
PDG identifier.
virtual int status() const
status word
PartonQualifier(const edm::ParameterSet &)
bool operator()(const reco::GenParticle &)
std::vector< int > partons_
part
Definition: HCALResponse.h:21