59 template<
typename Hand,
typename T>
62 const std::vector<T> &
values,
63 const std::string &
label)
const ;
70 reco_(iConfig.getParameter<edm::InputTag>(
"src")),
71 l1_(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,
171 const std::string &
label)
const {
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 void beginRun(edm::Run &iRun, const edm::EventSetup &iSetup)
bool writeExtraInfo_
Write out additional info as ValueMaps.
virtual double pt() const =0
transverse momentum
#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.
virtual double mass() const =0
mass
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
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
std::string labelL1_
Labels to set as filter names in the output.
int bx() const
get bunch crossing identifier
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
pat::TriggerObjectStandAloneMatch PATTriggerAssociation
virtual int charge() const
electric charge
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
const L1MuGMTExtendedCand & gmtMuonCand() const
virtual const PolarLorentzVector & polarP4() const
four-momentum Lorentz vector
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)
Analysis-level trigger object class (stand-alone)