Skip to content

Commit 2739f50

Browse files
authored
Merge pull request cms-sw#34232 from guitargeek/plugins_1
Avoid illegal import from PhysicsTools/PatAlgos/plugins in MuonAnalysis
2 parents f49be4f + dcea548 commit 2739f50

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CommonTools/UtilAlgos/interface/MatchByDEta.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
#include "FWCore/ParameterSet/interface/ParameterSet.h"
88

9+
#include <cmath>
10+
911
namespace reco {
1012
template <typename T1, typename T2>
1113
class MatchByDEta {
1214
public:
1315
MatchByDEta(const edm::ParameterSet& cfg) : maxDEta_(cfg.getParameter<double>("maxDeltaEta")) {}
14-
bool operator()(const T1& t1, const T2& t2) const { return fabs(t1.eta() - t2.eta()) < maxDEta_; }
16+
bool operator()(const T1& t1, const T2& t2) const { return std::abs(t1.eta() - t2.eta()) < maxDEta_; }
1517

1618
private:
1719
double maxDEta_;

MuonAnalysis/MuonAssociators/plugins/HLTL1MuonMatcher.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "DataFormats/Common/interface/View.h"
2323

2424
#include "MuonAnalysis/MuonAssociators/interface/L1MuonMatcherAlgo.h"
25-
#include "PhysicsTools/PatAlgos/plugins/PATTriggerMatchSelector.h"
25+
#include "CommonTools/Utils/interface/StringCutObjectSelector.h"
2626

2727
#include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h"
2828

@@ -43,7 +43,7 @@ namespace pat {
4343
bool operator()(const pat::TriggerObjectStandAlone &l1) const {
4444
if (resolveAmbiguities_ && (std::find(lockedItems_.begin(), lockedItems_.end(), &l1) != lockedItems_.end()))
4545
return false;
46-
return selector_(false, l1);
46+
return selector_(l1);
4747
}
4848

4949
private:
@@ -58,8 +58,7 @@ namespace pat {
5858
edm::EDGetTokenT<PATPrimitiveCollection> l1Token_;
5959

6060
/// Select HLT objects.
61-
/// First template argument is dummy and useless,
62-
pat::PATTriggerMatchSelector<bool, PATPrimitive> selector_;
61+
StringCutObjectSelector<PATPrimitive> selector_;
6362
bool resolveAmbiguities_;
6463

6564
/// Labels to set as filter names in the output
@@ -85,7 +84,7 @@ pat::HLTL1MuonMatcher::HLTL1MuonMatcher(const edm::ParameterSet &iConfig)
8584
: matcher_(iConfig),
8685
recoToken_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("src"))),
8786
l1Token_(consumes<PATPrimitiveCollection>(iConfig.getParameter<edm::InputTag>("matched"))),
88-
selector_(iConfig),
87+
selector_{iConfig.getParameter<std::string>("matchedCuts")},
8988
resolveAmbiguities_(iConfig.getParameter<bool>("resolveAmbiguities")),
9089
labelProp_(iConfig.getParameter<std::string>("setPropLabel")),
9190
writeExtraInfo_(iConfig.existsAs<bool>("writeExtraInfo") ? iConfig.getParameter<bool>("writeExtraInfo") : false) {

0 commit comments

Comments
 (0)