119 template <
typename T>
122 const std::vector<T> &
values,
129 using namespace reco;
136 deltaR_(
pset.getParameter<double>(
"deltaR")),
137 minL1Quality_(
pset.getParameter<int32_t>(
"MinL1Quality")),
139 min_N_L2(
pset.getParameter<
int>(
"MinN_L2")),
140 max_Eta_L2(
pset.getParameter<double>(
"MaxEta_L2")),
141 min_Nhits_L2(
pset.getParameter<
int>(
"MinNhits_L2")),
142 max_Dr_L2(
pset.getParameter<double>(
"MaxDr_L2")),
143 max_Dz_L2(
pset.getParameter<double>(
"MaxDz_L2")),
144 min_Pt_L2(
pset.getParameter<double>(
"MinPt_L2")),
145 nsigma_Pt_L2(
pset.getParameter<double>(
"NSigmaPt_L2")),
146 min_N_L3(
pset.getParameter<
int>(
"MinN_L3")),
147 max_Eta_L3(
pset.getParameter<double>(
"MaxEta_L3")),
148 min_Nhits_L3(
pset.getParameter<
int>(
"MinNhits_L3")),
149 max_Dr_L3(
pset.getParameter<double>(
"MaxDr_L3")),
150 max_Dz_L3(
pset.getParameter<double>(
"MaxDz_L3")),
151 min_Pt_L3(
pset.getParameter<double>(
"MinPt_L3")),
152 nsigma_Pt_L3(
pset.getParameter<double>(
"NSigmaPt_L3")),
160 metname =
"TriggerMatcherToHLTDebug";
162 produces<edm::ValueMap<int> >(
"propagatesToM2");
163 produces<edm::ValueMap<int> >(
"hasL1Particle");
164 produces<edm::ValueMap<int> >(
"hasL1Filtered");
165 produces<edm::ValueMap<int> >(
"hasL2Seed");
166 produces<edm::ValueMap<int> >(
"hasL2Muon");
167 produces<edm::ValueMap<int> >(
"hasL2MuonFiltered");
168 produces<edm::ValueMap<int> >(
"hasL3Seed");
169 produces<edm::ValueMap<int> >(
"hasL3Track");
170 produces<edm::ValueMap<int> >(
"hasL3Muon");
171 produces<edm::ValueMap<int> >(
"hasL3MuonFiltered");
173 produces<edm::ValueMap<reco::CandidatePtr> >(
"l1Candidate");
174 produces<edm::ValueMap<reco::CandidatePtr> >(
"l2Candidate");
175 produces<edm::ValueMap<reco::CandidatePtr> >(
"l3Candidate");
214 size_t nmu =
muons->size();
215 std::vector<int> propagatesToM2(nmu), hasL1Particle(nmu), hasL1Filtered(nmu);
216 std::vector<int> hasL2Seed(nmu), hasL2Muon(nmu), hasL2MuonFiltered(nmu);
217 std::vector<int> hasL3Seed(nmu), hasL3Track(nmu), hasL3TrackFiltered(nmu), hasL3Muon(nmu), hasL3MuonFiltered(nmu);
218 std::vector<reco::CandidatePtr> l1ptr(nmu), l2ptr(nmu), l3ptr(nmu);
220 for (
size_t i = 0;
i < nmu; ++
i) {
227 propagatesToM2[
i] = 1;
231 l1extra::L1MuonParticleCollection::const_iterator it;
232 L2MuonTrajectorySeedCollection::const_iterator iSeed;
233 L3MuonTrajectorySeedCollection::const_iterator iSeedL3;
234 RecoChargedCandidateCollection::const_iterator iL2Muon;
235 reco::TrackCollection::const_iterator tktrackL3;
236 RecoChargedCandidateCollection::const_iterator iL3Muon;
243 double L1phi = (*it).phi();
244 double L1eta = (*it).eta();
245 double L1pt = (*it).pt();
246 double dR =
deltaR(etaTk, phiTk, L1eta, L1phi);
252 if (!hasL1Particle[
i])
256 if ((
quality <= 3) || (L1pt < 7))
258 if (!hasL1Filtered[
i])
265 for (iSeed = L2Seeds->begin(); iSeed != L2Seeds->end(); ++iSeed) {
269 <<
"You're using a different L1 collection than the one used by L2 seeds.\n";
270 if (l1FromSeed.
key() != thisL1.
key())
279 for (iL2Muon =
L2Muons->begin(); iL2Muon !=
L2Muons->end(); ++iL2Muon) {
292 for (
size_t jjj = 0; jjj <
seeds.size(); jjj++) {
293 if (
seeds[jjj]->l1Particle() != l1FromSeed)
306 double Eta_L2 = L2Track.
eta();
307 double Pt_L2 = L2Track.
pt();
309 double BSPos_L2 = L2Track.
dxy(
beamSpot.position());
310 double dz_L2 = L2Track.
dz();
311 double err0_L2 = L2Track.
error(0);
312 double abspar0_L2 = fabs(L2Track.
parameter(0));
313 double ptLx_L2 = Pt_L2;
322 if (!hasL2MuonFiltered[
i]) {
326 hasL2MuonFiltered[
i]++;
333 for (iSeedL3 = L3Seeds->begin(); iSeedL3 != L3Seeds->end(); ++iSeedL3) {
334 TrackRef staTrack = iSeedL3->l2Track();
335 if (staTrack != L2FilteredRef)
345 for (tktrackL3 = L3TkTracks->begin(); tktrackL3 != L3TkTracks->end(); ++tktrackL3) {
348 TrackRef staTrack2 = l3seedRef->l2Track();
350 if (staTrack2 != L2FilteredRef)
352 if (!hasL3Track[
i]) {
360 for (iL3Muon =
L3Muons->begin(); iL3Muon !=
L3Muons->end(); ++iL3Muon) {
363 TrackRef staTrack3 = l3seedRef2->l2Track();
365 if (staTrack3 != L2FilteredRef)
377 double Eta_L3 = L3Track.
eta();
378 double Pt_L3 = L3Track.
pt();
380 double BSPos_L3 = L3Track.
dxy(
beamSpot.position());
381 double dz_L3 = L3Track.
dz();
382 double err0_L3 = L3Track.
error(0);
383 double abspar0_L3 = fabs(L3Track.
parameter(0));
384 double ptLx_L3 = Pt_L3;
391 if (!hasL3MuonFiltered[
i]) {
396 hasL3MuonFiltered[
i]++;
406 storeValueMap<int>(
event,
muons, propagatesToM2,
"propagatesToM2");
407 storeValueMap<int>(
event,
muons, hasL1Particle,
"hasL1Particle");
408 storeValueMap<int>(
event,
muons, hasL1Filtered,
"hasL1Filtered");
409 storeValueMap<int>(
event,
muons, hasL2Seed,
"hasL2Seed");
410 storeValueMap<int>(
event,
muons, hasL2Muon,
"hasL2Muon");
411 storeValueMap<int>(
event,
muons, hasL2MuonFiltered,
"hasL2MuonFiltered");
412 storeValueMap<int>(
event,
muons, hasL3Seed,
"hasL3Seed");
413 storeValueMap<int>(
event,
muons, hasL3Track,
"hasL3Track");
414 storeValueMap<int>(
event,
muons, hasL3Muon,
"hasL3Muon");
415 storeValueMap<int>(
event,
muons, hasL3MuonFiltered,
"hasL3MuonFiltered");
416 storeValueMap<reco::CandidatePtr>(
event,
muons, l1ptr,
"l1Candidate");
417 storeValueMap<reco::CandidatePtr>(
event,
muons, l2ptr,
"l2Candidate");
418 storeValueMap<reco::CandidatePtr>(
event,
muons, l3ptr,
"l3Candidate");
425 template <
typename T>
428 const std::vector<T> &
values,
432 unique_ptr<ValueMap<T> > valMap(
new ValueMap<T>());