7 preselectionCut_(iConfig.existsAs<std::
string>(
"preselection") ? iConfig.getParameter<std::
string>(
"preselection") :
""),
8 deltaR2_(std::
pow(iConfig.getParameter<double>(
"maxDeltaR"),2)),
9 deltaPhi_(iConfig.existsAs<double>(
"maxDeltaPhi") ? iConfig.getParameter<double>(
"maxDeltaPhi") : 10),
10 deltaEta_(iConfig.existsAs<double>(
"maxDeltaEta") ? iConfig.getParameter<double>(
"maxDeltaEta") : 10),
11 l1PhiOffset_(iConfig.existsAs<double>(
"l1PhiOffset") ? iConfig.getParameter<double>(
"l1PhiOffset") : 0)
13 bool reqPhi = iConfig.
existsAs<
bool>(
"sortByDeltaPhi") && iConfig.
getParameter<
bool>(
"sortByDeltaPhi");
14 bool reqEta = iConfig.
existsAs<
bool>(
"sortByDeltaEta") && iConfig.
getParameter<
bool>(
"sortByDeltaEta");
17 if (reqPhi + reqEta + reqPt > 1)
throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set more than one 'sortBy<XXX>' parameter to True.\n";
18 if (sortBy ==
"deltaPhi") {
20 throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set sortBy = 'deltaPhi' and set also another 'sortBy<XXX>' parameter to True.\n";
23 if (sortBy ==
"deltaEta") {
25 throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set sortBy = 'deltaEta' and set also another 'sortBy<XXX>' parameter to True.\n";
30 throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set sortBy = 'pt' and set also another 'sortBy<XXX>' parameter to True.\n";
33 if (sortBy ==
"deltaR") {
34 if(reqPhi || reqEta || reqPt)
35 throw cms::Exception(
"Configuration") <<
"L1MuonMatcherAlgo: Can't set sortBy = 'deltaR' and set also another 'sortBy<XXX>' parameter to True.\n";
57 double thisDeltaEta = pos.
eta() - l1.
eta();
61 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)
Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators...
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
virtual double eta() const
momentum pseudorapidity
double deltaR2(const T1 &t1, const T2 &t2)
double deltaR(double eta1, double eta2, double phi1, double phi2)
bool match(const reco::Track &tk, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi, TrajectoryStateOnSurface &propagated) const
void init(const edm::EventSetup &iSetup)
Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators...
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
virtual double phi() const
momentum azimuthal angle
double deltaR2_
Matching cuts.
Power< A, B >::type pow(const A &a, const B &b)