7 useStage2L1_(iConfig.existsAs<
bool>(
"useStage2L1") ? iConfig.getParameter<
bool>(
"useStage2L1") :
false),
8 preselectionCut_((iConfig.existsAs<
std::
string>(
"preselection")) ? iConfig.getParameter<
std::
string>(
"preselection") :
""),
9 deltaR2_(
std::
pow(iConfig.getParameter<double>(
"maxDeltaR"),2)),
10 deltaPhi_(iConfig.existsAs<double>(
"maxDeltaPhi") ? iConfig.getParameter<double>(
"maxDeltaPhi") : 10),
11 deltaEta_(iConfig.existsAs<double>(
"maxDeltaEta") ? iConfig.getParameter<double>(
"maxDeltaEta") : 10),
12 l1PhiOffset_(iConfig.existsAs<double>(
"l1PhiOffset") ? iConfig.getParameter<double>(
"l1PhiOffset") : 0)
15 bool reqPhi = iConfig.
existsAs<
bool>(
"sortByDeltaPhi") && iConfig.
getParameter<
bool>(
"sortByDeltaPhi");
16 bool reqEta = iConfig.
existsAs<
bool>(
"sortByDeltaEta") && iConfig.
getParameter<
bool>(
"sortByDeltaEta");
19 if (reqPhi + reqEta + reqPt + reqQual > 1)
throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set more than one 'sortBy<XXX>' parameter to True.\n";
20 if (sortBy ==
"deltaPhi") {
21 if (reqEta || reqPt || reqQual)
22 throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set sortBy = 'deltaPhi' and set also another 'sortBy<XXX>' parameter to True.\n";
25 if (sortBy ==
"deltaEta") {
26 if(reqPhi || reqPt || reqQual)
27 throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set sortBy = 'deltaEta' and set also another 'sortBy<XXX>' parameter to True.\n";
31 if(reqPhi || reqEta || reqQual)
32 throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set sortBy = 'pt' and set also another 'sortBy<XXX>' parameter to True.\n";
35 if (sortBy ==
"quality") {
36 if(reqPhi || reqEta || reqPt)
37 throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set sortBy = 'quality' and set also another 'sortBy<XXX>' parameter to True.\n";
40 if (sortBy ==
"deltaR") {
41 if(reqPhi || reqEta || reqPt || reqQual)
42 throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set sortBy = 'deltaR' and set also another 'sortBy<XXX>' parameter to True.\n";
65 double thisDeltaEta = pos.
eta() - l1.
eta();
69 deltaPhi = thisDeltaPhi;
L1Selector preselectionCut_
Preselection cut to apply to L1 candidates before matching.
T getParameter(std::string const &) const
void init(const edm::EventSetup &iSetup)
double eta() const final
momentum pseudorapidity
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
Geom::Phi< T > phi() const
GlobalPoint globalPosition() const
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
bool match(const reco::Track &tk, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
void init(const edm::EventSetup &iSetup)
int matchGeneric(const reco::Track &tk, const Collection &l1, const Selector &sel, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
L1MuonMatcherAlgo(const edm::ParameterSet &iConfig)
double l1PhiOffset_
offset to be added to the L1 phi before the match
double phi() const final
momentum azimuthal angle
double deltaR2_
Matching cuts.
Power< A, B >::type pow(const A &a, const B &b)