Go to the documentation of this file.00001 #include "HLTriggerOffline/Muon/interface/L1MuonMatcherAlgo.h"
00002
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004
00005 L1MuonMatcherAlgo::L1MuonMatcherAlgo(const edm::ParameterSet & iConfig) :
00006 prop_(iConfig),
00007 preselectionCut_(iConfig.existsAs<std::string>("preselection") ? iConfig.getParameter<std::string>("preselection") : ""),
00008 deltaR2_(std::pow(iConfig.getParameter<double>("maxDeltaR"),2)),
00009 deltaPhi_(iConfig.existsAs<double>("maxDeltaPhi") ? iConfig.getParameter<double>("maxDeltaPhi") : 10),
00010 sortByDeltaPhi_(iConfig.existsAs<bool>("sortByDeltaPhi") ? iConfig.getParameter<bool>("sortByDeltaPhi") : false)
00011 {
00012 }
00013
00014 L1MuonMatcherAlgo::~L1MuonMatcherAlgo() {}
00015
00016 void
00017 L1MuonMatcherAlgo::init(const edm::EventSetup & iSetup) {
00018 prop_.init(iSetup);
00019 }
00020
00021 bool
00022 L1MuonMatcherAlgo::match(TrajectoryStateOnSurface & propagated, const l1extra::L1MuonParticle &l1, float &deltaR, float &deltaPhi) const {
00023 if (preselectionCut_(l1)) {
00024 GlobalPoint pos = propagated.globalPosition();
00025 double thisDeltaPhi = ::deltaPhi(double(pos.phi()), l1.phi());
00026 double thisDeltaR2 = ::deltaR2(double(pos.eta()), double(pos.phi()), l1.eta(), l1.phi());
00027 if ((fabs(thisDeltaPhi) < deltaPhi_) && (thisDeltaR2 < deltaR2_)) {
00028 deltaR = std::sqrt(thisDeltaR2);
00029 deltaPhi = thisDeltaPhi;
00030 return true;
00031 }
00032 }
00033 return false;
00034 }
00035
00036 int
00037 L1MuonMatcherAlgo::match(TrajectoryStateOnSurface & propagated, const std::vector<l1extra::L1MuonParticle> &l1s, float &deltaR, float &deltaPhi) const {
00038 return matchGeneric(propagated, l1s, preselectionCut_, deltaR, deltaPhi);
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 }
00062
00063