CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MCMatchCandRefSelector.cc
Go to the documentation of this file.
11 
12 using namespace edm;
13 using namespace reco;
14 using namespace std;
15 
16 namespace reco {
17  namespace modules {
18 
20  public:
22  srcToken_(srcToken) { }
23  void newEvent(const Event& evt, const EventSetup&);
24  bool operator()(const CandidateBaseRef &) const;
25  private:
28  };
29 
30  void MCMatchCandRefSelector::newEvent(const Event& evt, const EventSetup&) {
32  evt.getByToken(srcToken_, match);
33  match_ = match.product();
34  }
35 
36  bool MCMatchCandRefSelector::operator()(const CandidateBaseRef & c) const {
37  GenParticleRef m = (*match_)[c];
38  return m.isNonnull();
39  }
40 
41  template<>
45  }
46  };
47 
48  }
49 }
50 
52 
54 
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
static MCMatchCandRefSelector make(const ParameterSet &cfg, edm::ConsumesCollector &iC)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
#define EVENTSETUP_STD_INIT(SELECTOR)
DEFINE_FWK_MODULE(HiMixingModule)
SingleObjectRefSelector< Candidate, reco::modules::MCMatchCandRefSelector > MCMatchCandRefSelector
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
T const * product() const
Definition: Handle.h:81
EDGetTokenT< GenParticleMatch > srcToken_
MCMatchCandRefSelector(const EDGetTokenT< GenParticleMatch > &srcToken)
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)