72 template<
typename Hand,
typename T>
75 const std::vector<T> &
values,
89 resolveAmbiguities_(iConfig.getParameter<bool>(
"resolveAmbiguities")),
90 labelProp_(iConfig.getParameter<std::
string>(
"setPropLabel")),
91 writeExtraInfo_(iConfig.existsAs<bool>(
"writeExtraInfo") ? iConfig.getParameter<bool>(
"writeExtraInfo") :
false)
93 produces<PATPrimitiveCollection>(
"propagatedReco");
94 produces<PATTriggerAssociation>(
"propagatedReco");
95 produces<PATTriggerAssociation>();
97 produces<edm::ValueMap<float> >(
"deltaR");
98 produces<edm::ValueMap<float> >(
"deltaPhi");
114 vector<int> propMatches(
reco->size(), -1);
115 vector<int> fullMatches(
reco->size(), -1);
116 vector<float> deltaRs(
reco->size(), 999), deltaPhis(
reco->size(), 999);
117 lockedItems_.clear();
118 for (
int i = 0,
n =
reco->size();
i <
n; ++
i) {
121 int match = matcher_.matchGeneric(mu, *
l1s, *
this, deltaRs[
i], deltaPhis[i], propagated);
124 propMatches[
i] = propOut->size();
126 propOut->back().addFilterLabel(labelProp_);
127 propOut->back().setCharge(mu.
charge());
131 lockedItems_.push_back(&(*
l1s)[match]);
134 lockedItems_.clear();
140 propFiller.
insert(
reco, propMatches.begin(), propMatches.end());
142 iEvent.
put(propAss,
"propagatedReco");
146 fullFiller.
insert(
reco, fullMatches.begin(), fullMatches.end());
150 if (writeExtraInfo_) {
151 storeExtraInfo(iEvent,
reco, deltaRs,
"deltaR");
152 storeExtraInfo(iEvent,
reco, deltaPhis,
"deltaPhi");
156 template<
typename Hand,
typename T>
160 const std::vector<T> &
values,
162 using namespace edm;
using namespace std;
165 filler.
insert(handle, values.begin(), values.end());
167 iEvent.
put(valMap, label);
173 matcher_.init(iSetup);
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual double pt() const =0
transverse momentum
#define DEFINE_FWK_MODULE(type)
virtual double mass() const =0
mass
Geom::Phi< T > phi() const
void insert(const H &h, I begin, I end)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
GlobalPoint globalPosition() const
L1MuonMatcherAlgo matcher_
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< const pat::TriggerObjectStandAlone * > lockedItems_
edm::EDGetTokenT< edm::View< reco::Candidate > > recoToken_
Tokens for input collections.
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
pat::TriggerObjectStandAlone PATPrimitive
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
pat::TriggerObjectStandAloneCollection PATPrimitiveCollection
virtual int charge() const =0
electric charge
bool writeExtraInfo_
Write out additional info as ValueMaps.
void storeExtraInfo(edm::Event &iEvent, const Hand &handle, const std::vector< T > &values, const std::string &label) const
Store extra information in a ValueMap.
virtual ~HLTL1MuonMatcher()
virtual void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
pat::PATTriggerMatchSelector< bool, PATPrimitive > selector_
HLTL1MuonMatcher(const edm::ParameterSet &iConfig)
Matcher of reconstructed objects to L1 Muons.
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::string labelProp_
Labels to set as filter names in the output.
volatile std::atomic< bool > shutdown_flag false
bool operator()(const pat::TriggerObjectStandAlone &l1) const
select L1s with patName_ and filterLabel_ (public, so it can be used by L1MuonMatcherAlgo) ...
edm::EDGetTokenT< PATPrimitiveCollection > l1Token_
pat::TriggerObjectStandAloneMatch PATTriggerAssociation
Analysis-level trigger object class (stand-alone)