69 template <
typename Hand,
typename T>
72 const std::vector<T> &
values,
82 : matcher_(iConfig, consumesCollector()),
86 resolveAmbiguities_(iConfig.getParameter<
bool>(
"resolveAmbiguities")),
87 labelProp_(iConfig.getParameter<
std::string>(
"setPropLabel")),
88 writeExtraInfo_(iConfig.existsAs<
bool>(
"writeExtraInfo") ? iConfig.getParameter<
bool>(
"writeExtraInfo") :
false) {
89 produces<PATPrimitiveCollection>(
"propagatedReco");
90 produces<PATTriggerAssociation>(
"propagatedReco");
91 produces<PATTriggerAssociation>();
92 if (writeExtraInfo_) {
93 produces<edm::ValueMap<float> >(
"deltaR");
94 produces<edm::ValueMap<float> >(
"deltaPhi");
102 matcher_.init(iSetup);
111 vector<int> propMatches(
reco->size(), -1);
112 vector<int> fullMatches(
reco->size(), -1);
114 lockedItems_.clear();
115 for (
int i = 0,
n =
reco->size();
i <
n; ++
i) {
118 int match = matcher_.matchGeneric(
mu, *
l1s, *
this, deltaRs[
i],
deltaPhis[
i], propagated);
121 propMatches[
i] = propOut->size();
123 propOut->back().addFilterLabel(labelProp_);
124 propOut->back().setCharge(
mu.charge());
126 fullMatches[
i] = match;
128 lockedItems_.push_back(&(*
l1s)[match]);
131 lockedItems_.clear();
137 propFiller.
insert(
reco, propMatches.begin(), propMatches.end());
143 fullFiller.
insert(
reco, fullMatches.begin(), fullMatches.end());
147 if (writeExtraInfo_) {
148 storeExtraInfo(
iEvent,
reco, deltaRs,
"deltaR");
153 template <
typename Hand,
typename T>
156 const std::vector<T> &
values,
160 unique_ptr<ValueMap<T> > valMap(
new ValueMap<T>());
T getParameter(std::string const &) const
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
void insert(const H &h, I begin, I end)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
~HLTL1MuonMatcher() override
L1MuonMatcherAlgo matcher_
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.
GlobalPoint globalPosition() const
pat::TriggerObjectStandAlone PATPrimitive
pat::TriggerObjectStandAloneCollection PATPrimitiveCollection
void storeExtraInfo(edm::Event &iEvent, const Hand &handle, const std::vector< T > &values, const std::string &label) const
Store extra information in a ValueMap.
#define DEFINE_FWK_MODULE(type)
bool writeExtraInfo_
Write out additional info as ValueMaps.
StringCutObjectSelector< PATPrimitive > selector_
Select HLT objects.
bool operator()(const pat::TriggerObjectStandAlone &l1) const
select L1s with patName_ and filterLabel_ (public, so it can be used by L1MuonMatcherAlgo) ...
HLTL1MuonMatcher(const edm::ParameterSet &iConfig)
Matcher of reconstructed objects to L1 Muons.
std::string labelProp_
Labels to set as filter names in the output.
edm::EDGetTokenT< PATPrimitiveCollection > l1Token_
pat::TriggerObjectStandAloneMatch PATTriggerAssociation
Analysis-level trigger object class (stand-alone)