71 template<
typename Hand,
typename T>
74 const std::vector<T> &
values,
85 reco_(iConfig.getParameter<edm::InputTag>(
"src")),
86 l1_(iConfig.getParameter<edm::InputTag>(
"matched")),
88 resolveAmbiguities_(iConfig.getParameter<bool>(
"resolveAmbiguities")),
89 labelProp_(iConfig.getParameter<std::
string>(
"setPropLabel")),
90 writeExtraInfo_(iConfig.existsAs<bool>(
"writeExtraInfo") ? iConfig.getParameter<bool>(
"writeExtraInfo") :
false)
92 produces<PATPrimitiveCollection>(
"propagatedReco");
93 produces<PATTriggerAssociation>(
"propagatedReco");
94 produces<PATTriggerAssociation>();
96 produces<edm::ValueMap<float> >(
"deltaR");
97 produces<edm::ValueMap<float> >(
"deltaPhi");
113 vector<int> propMatches(
reco->size(), -1);
114 vector<int> fullMatches(
reco->size(), -1);
115 vector<float> deltaRs(
reco->size(), 999), deltaPhis(
reco->size(), 999);
116 lockedItems_.clear();
117 for (
int i = 0,
n =
reco->size();
i <
n; ++
i) {
120 int match = matcher_.matchGeneric(mu, *
l1s, *
this, deltaRs[
i], deltaPhis[i], propagated);
123 propMatches[
i] = propOut->size();
125 propOut->back().addFilterLabel(labelProp_);
126 propOut->back().setCharge(mu.
charge());
130 lockedItems_.push_back(&(*
l1s)[match]);
133 lockedItems_.clear();
139 propFiller.
insert(
reco, propMatches.begin(), propMatches.end());
141 iEvent.
put(propAss,
"propagatedReco");
145 fullFiller.
insert(
reco, fullMatches.begin(), fullMatches.end());
149 if (writeExtraInfo_) {
150 storeExtraInfo(iEvent,
reco, deltaRs,
"deltaR");
151 storeExtraInfo(iEvent,
reco, deltaPhis,
"deltaPhi");
155 template<
typename Hand,
typename T>
159 const std::vector<T> &
values,
161 using namespace edm;
using namespace std;
164 filler.
insert(handle, values.begin(), values.end());
166 iEvent.
put(valMap, label);
172 matcher_.init(iSetup);
virtual float mass() const =0
mass
#define DEFINE_FWK_MODULE(type)
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_
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
virtual float pt() const =0
transverse momentum
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.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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()
edm::InputTag reco_
Labels for input collections.
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) ...
pat::TriggerObjectStandAloneMatch PATTriggerAssociation
Analysis-level trigger object class (stand-alone)