58 template<
typename Hand,
typename T>
61 const std::vector<T> &
values,
69 reco_(iConfig.getParameter<edm::InputTag>(
"src")),
70 l1_(iConfig.getParameter<edm::InputTag>(
"matched")),
71 labelL1_(iConfig.getParameter<std::
string>(
"setL1Label")),
72 labelProp_(iConfig.getParameter<std::
string>(
"setPropLabel")),
73 writeExtraInfo_(iConfig.getParameter<bool>(
"writeExtraInfo"))
75 produces<PATPrimitiveCollection>(
"l1muons");
76 produces<PATPrimitiveCollection>(
"propagatedReco");
77 produces<PATTriggerAssociation>(
"propagatedReco");
78 produces<PATTriggerAssociation>();
80 produces<edm::ValueMap<float> >(
"deltaR");
81 produces<edm::ValueMap<float> >(
"deltaPhi");
82 produces<edm::ValueMap<int> >(
"quality");
83 produces<edm::ValueMap<int> >(
"bx");
84 produces<edm::ValueMap<int> >(
"isolated");
85 produces<edm::ValueMap<reco::CandidatePtr> >();
86 produces<edm::ValueMap<reco::CandidatePtr> >(
"l1ToReco");
103 std::vector<edm::Ptr<reco::Candidate> > l1rawMatches(
reco->size());
104 vector<int> isSelected(
l1s->size(), -1);
105 std::vector<edm::Ptr<reco::Candidate> > whichRecoMatch(
l1s->size());
106 vector<int> propMatches(
reco->size(), -1);
107 vector<int> fullMatches(
reco->size(), -1);
108 vector<float> deltaRs(
reco->size(), 999), deltaPhis(
reco->size(), 999);
109 vector<int> quality(
reco->size(), 0), bx(
reco->size(), -999), isolated(
reco->size(), -999);
110 for (
int i = 0,
n =
reco->size();
i <
n; ++
i) {
113 int match = matcher_.match(mu, *
l1s, deltaRs[
i], deltaPhis[i], propagated);
116 propMatches[
i] = propOut->size();
118 propOut->back().addFilterLabel(labelProp_);
119 propOut->back().setCharge(mu.
charge());
124 if (isSelected[match] == -1) {
125 isSelected[
match] = l1Out->size();
127 l1Out->back().addFilterLabel(labelL1_);
128 l1Out->back().setCharge(l1.
charge());
130 fullMatches[
i] = isSelected[
match];
134 isolated[
i] = gmt.
isol();
144 propFiller.
insert(
reco, propMatches.begin(), propMatches.end());
146 iEvent.
put(propAss,
"propagatedReco");
150 fullFiller.
insert(
reco, fullMatches.begin(), fullMatches.end());
154 if (writeExtraInfo_) {
155 storeExtraInfo(iEvent,
reco, deltaRs,
"deltaR");
156 storeExtraInfo(iEvent,
reco, deltaPhis,
"deltaPhi");
157 storeExtraInfo(iEvent,
reco, bx,
"bx");
158 storeExtraInfo(iEvent,
reco, isolated,
"isolated");
159 storeExtraInfo(iEvent,
reco, quality,
"quality");
160 storeExtraInfo(iEvent,
reco, l1rawMatches,
"");
161 storeExtraInfo(iEvent,
l1s, whichRecoMatch,
"l1ToReco");
165 template<
typename Hand,
typename T>
169 const std::vector<T> &
values,
171 using namespace edm;
using namespace std;
174 filler.
insert(handle, values.begin(), values.end());
176 iEvent.
put(valMap, label);
182 matcher_.init(iSetup);
virtual float mass() const =0
mass
bool writeExtraInfo_
Write out additional info as ValueMaps.
#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.
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
const L1MuGMTExtendedCand & gmtMuonCand() const
edm::InputTag reco_
Labels for input collections.
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)