59 template<
typename Hand,
typename T>
62 const std::vector<T> &
values,
70 recoToken_(consumes<edm::
View<
reco::
Candidate> >(iConfig.getParameter<edm::InputTag>(
"src"))),
71 l1Token_(consumes<std::vector<l1extra::
L1MuonParticle> >(iConfig.getParameter<edm::InputTag>(
"matched"))),
72 labelL1_(iConfig.getParameter<std::
string>(
"setL1Label")),
73 labelProp_(iConfig.getParameter<std::
string>(
"setPropLabel")),
74 writeExtraInfo_(iConfig.getParameter<bool>(
"writeExtraInfo"))
76 produces<PATPrimitiveCollection>(
"l1muons");
77 produces<PATPrimitiveCollection>(
"propagatedReco");
78 produces<PATTriggerAssociation>(
"propagatedReco");
79 produces<PATTriggerAssociation>();
81 produces<edm::ValueMap<float> >(
"deltaR");
82 produces<edm::ValueMap<float> >(
"deltaPhi");
83 produces<edm::ValueMap<int> >(
"quality");
84 produces<edm::ValueMap<int> >(
"bx");
85 produces<edm::ValueMap<int> >(
"isolated");
86 produces<edm::ValueMap<reco::CandidatePtr> >();
87 produces<edm::ValueMap<reco::CandidatePtr> >(
"l1ToReco");
104 std::vector<edm::Ptr<reco::Candidate> > l1rawMatches(
reco->size());
105 vector<int> isSelected(
l1s->size(), -1);
106 std::vector<edm::Ptr<reco::Candidate> > whichRecoMatch(
l1s->size());
107 vector<int> propMatches(
reco->size(), -1);
108 vector<int> fullMatches(
reco->size(), -1);
109 vector<float> deltaRs(
reco->size(), 999), deltaPhis(
reco->size(), 999);
110 vector<int> quality(
reco->size(), 0), bx(
reco->size(), -999), isolated(
reco->size(), -999);
111 for (
int i = 0,
n =
reco->size();
i <
n; ++
i) {
114 int match = matcher_.match(mu, *
l1s, deltaRs[
i], deltaPhis[i], propagated);
117 propMatches[
i] = propOut->size();
119 propOut->back().addFilterLabel(labelProp_);
120 propOut->back().setCharge(mu.
charge());
125 if (isSelected[match] == -1) {
126 isSelected[
match] = l1Out->size();
128 l1Out->back().addFilterLabel(labelL1_);
129 l1Out->back().setCharge(l1.
charge());
131 fullMatches[
i] = isSelected[
match];
135 isolated[
i] = gmt.
isol();
145 propFiller.
insert(
reco, propMatches.begin(), propMatches.end());
147 iEvent.
put(propAss,
"propagatedReco");
151 fullFiller.
insert(
reco, fullMatches.begin(), fullMatches.end());
155 if (writeExtraInfo_) {
156 storeExtraInfo(iEvent,
reco, deltaRs,
"deltaR");
157 storeExtraInfo(iEvent,
reco, deltaPhis,
"deltaPhi");
158 storeExtraInfo(iEvent,
reco, bx,
"bx");
159 storeExtraInfo(iEvent,
reco, isolated,
"isolated");
160 storeExtraInfo(iEvent,
reco, quality,
"quality");
161 storeExtraInfo(iEvent,
reco, l1rawMatches,
"");
162 storeExtraInfo(iEvent,
l1s, whichRecoMatch,
"l1ToReco");
166 template<
typename Hand,
typename T>
170 const std::vector<T> &
values,
172 using namespace edm;
using namespace std;
175 filler.
insert(handle, values.begin(), values.end());
177 iEvent.
put(valMap, label);
183 matcher_.init(iSetup);
virtual float mass() const =0
mass
bool writeExtraInfo_
Write out additional info as ValueMaps.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void storeExtraInfo(edm::Event &iEvent, const Hand &handle, const std::vector< T > &values, const std::string &label) const
Store extra information in a ValueMap.
Geom::Phi< T > phi() const
void insert(const H &h, I begin, I end)
L1MuonMatcher(const edm::ParameterSet &iConfig)
GlobalPoint globalPosition() const
pat::TriggerObjectStandAloneCollection PATPrimitiveCollection
L1MuonMatcherAlgo matcher_
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
pat::TriggerObjectStandAlone PATPrimitive
bool isol() const
get isolation
virtual void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
edm::EDGetTokenT< std::vector< l1extra::L1MuonParticle > > l1Token_
std::string labelL1_
Labels to set as filter names in the output.
virtual float pt() const =0
transverse momentum
int bx() const
get bunch crossing identifier
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
pat::TriggerObjectStandAloneMatch PATTriggerAssociation
Matcher of reconstructed objects to L1 Muons.
virtual int charge() const =0
electric charge
unsigned int quality() const
get quality
virtual const PolarLorentzVector & polarP4() const GCC11_FINAL
four-momentum Lorentz vector
virtual int charge() const GCC11_FINAL
electric charge
edm::EDGetTokenT< edm::View< reco::Candidate > > recoToken_
Tokens for input collections.
const L1MuGMTExtendedCand & gmtMuonCand() const
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.
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Analysis-level trigger object class (stand-alone)