CMS 3D CMS Logo

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 isNonnull() const
Checks for non-null.
Definition: Ref.h:253
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
#define EVENTSETUP_STD_INIT(SELECTOR)
SingleObjectRefSelector< Candidate, reco::modules::MCMatchCandRefSelector > MCMatchCandRefSelector
T const * product() const
Definition: Handle.h:81
fixed size matrix
HLT enums.
EDGetTokenT< GenParticleMatch > srcToken_
MCMatchCandRefSelector(const EDGetTokenT< GenParticleMatch > &srcToken)
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)