diff --git a/[refs] b/[refs] index d46ac01aea71a..527715a5fe21f 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e -"refs/heads/CMSSW_7_1_X": 0f50de63a488818c809c7b0136721e4baaa6ee9e +"refs/heads/CMSSW_7_1_X": 35ad8cc855dad57602628ff6c03e05a445b60527 diff --git a/trunk/MuonAnalysis/MuonAssociators/plugins/MatcherByPulls.cc b/trunk/MuonAnalysis/MuonAssociators/plugins/MatcherByPulls.cc index 9ddfbc0ef0738..ac4f5b36d3413 100644 --- a/trunk/MuonAnalysis/MuonAssociators/plugins/MatcherByPulls.cc +++ b/trunk/MuonAnalysis/MuonAssociators/plugins/MatcherByPulls.cc @@ -14,7 +14,7 @@ // // Original Author: Giovanni Petrucciani (SNS Pisa and CERN PH-CMG) // Created: Sun Nov 16 16:14:09 CET 2008 -// $Id: MatcherByPulls.cc,v 1.1 2009/05/29 09:44:13 gpetrucc Exp $ +// $Id: MatcherByPulls.cc,v 1.2 2009/09/23 12:32:27 gpetrucc Exp $ // @@ -45,6 +45,7 @@ * \____|_|\__,_|___/___/ \__,_|\___|\___|_|\__,_|_| \__,_|\__|_|\___/|_| |_| */ namespace pat { + template class MatcherByPulls : public edm::EDProducer { public: explicit MatcherByPulls(const edm::ParameterSet&); @@ -66,8 +67,6 @@ namespace pat { }; } -using pat::MatcherByPulls; - /* ____ _ _ * / ___|___ _ __ ___| |_ _ __ _ _ ___| |_ ___ _ __ * | | / _ \| '_ \/ __| __| '__| | | |/ __| __/ _ \| '__| @@ -75,7 +74,8 @@ using pat::MatcherByPulls; * \____\___/|_| |_|___/\__|_| \__,_|\___|\__\___/|_| * */ -MatcherByPulls::MatcherByPulls(const edm::ParameterSet &iConfig) : +template +pat::MatcherByPulls::MatcherByPulls(const edm::ParameterSet &iConfig) : src_(iConfig.getParameter("src")), matched_(iConfig.getParameter("matched")), mcSel_(iConfig.getParameter("matchedSelector")), @@ -85,7 +85,8 @@ MatcherByPulls::MatcherByPulls(const edm::ParameterSet &iConfig) : produces >("pulls"); } -MatcherByPulls::~MatcherByPulls() +template +pat::MatcherByPulls::~MatcherByPulls() { } @@ -96,11 +97,13 @@ MatcherByPulls::~MatcherByPulls() * |_| |_| \___/ \__,_|\__,_|\___\___| * */ + +template void -MatcherByPulls::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) +pat::MatcherByPulls::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { typedef std::vector MCColl; - edm::Handle > src; + edm::Handle > src; edm::Handle cands; iEvent.getByLabel(src_, src); iEvent.getByLabel(matched_, cands); @@ -111,7 +114,7 @@ MatcherByPulls::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) std::vector matches(src->size(),-1); std::vector pulls(src->size(), 1e39); for (size_t i = 0, n = src->size(); i < n; ++i) { - const reco::RecoCandidate &tk = (*src)[i]; + const T &tk = (*src)[i]; std::pair m = algo_.match(tk, *cands, candGood); matches[i] = m.first; pulls[i] = m.second; @@ -132,4 +135,8 @@ MatcherByPulls::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) } //define this as a plug-in + +typedef pat::MatcherByPulls MatcherByPulls; +typedef pat::MatcherByPulls TrackMatcherByPulls; DEFINE_FWK_MODULE(MatcherByPulls); +DEFINE_FWK_MODULE(TrackMatcherByPulls);