118 template <
typename T>
121 const std::vector<T> &
values,
128 using namespace reco;
134 l1matcherSetup_(
pset.getParameter<
edm::
ParameterSet>(
"l1matcherConfig"), consumesCollector()),
135 deltaR_(
pset.getParameter<double>(
"deltaR")),
136 minL1Quality_(
pset.getParameter<int32_t>(
"MinL1Quality")),
138 min_N_L2(
pset.getParameter<
int>(
"MinN_L2")),
139 max_Eta_L2(
pset.getParameter<double>(
"MaxEta_L2")),
140 min_Nhits_L2(
pset.getParameter<
int>(
"MinNhits_L2")),
141 max_Dr_L2(
pset.getParameter<double>(
"MaxDr_L2")),
142 max_Dz_L2(
pset.getParameter<double>(
"MaxDz_L2")),
143 min_Pt_L2(
pset.getParameter<double>(
"MinPt_L2")),
144 nsigma_Pt_L2(
pset.getParameter<double>(
"NSigmaPt_L2")),
145 min_N_L3(
pset.getParameter<
int>(
"MinN_L3")),
146 max_Eta_L3(
pset.getParameter<double>(
"MaxEta_L3")),
147 min_Nhits_L3(
pset.getParameter<
int>(
"MinNhits_L3")),
148 max_Dr_L3(
pset.getParameter<double>(
"MaxDr_L3")),
149 max_Dz_L3(
pset.getParameter<double>(
"MaxDz_L3")),
150 min_Pt_L3(
pset.getParameter<double>(
"MinPt_L3")),
151 nsigma_Pt_L3(
pset.getParameter<double>(
"NSigmaPt_L3")),
159 metname =
"TriggerMatcherToHLTDebug";
161 produces<edm::ValueMap<int> >(
"propagatesToM2");
162 produces<edm::ValueMap<int> >(
"hasL1Particle");
163 produces<edm::ValueMap<int> >(
"hasL1Filtered");
164 produces<edm::ValueMap<int> >(
"hasL2Seed");
165 produces<edm::ValueMap<int> >(
"hasL2Muon");
166 produces<edm::ValueMap<int> >(
"hasL2MuonFiltered");
167 produces<edm::ValueMap<int> >(
"hasL3Seed");
168 produces<edm::ValueMap<int> >(
"hasL3Track");
169 produces<edm::ValueMap<int> >(
"hasL3Muon");
170 produces<edm::ValueMap<int> >(
"hasL3MuonFiltered");
172 produces<edm::ValueMap<reco::CandidatePtr> >(
"l1Candidate");
173 produces<edm::ValueMap<reco::CandidatePtr> >(
"l2Candidate");
174 produces<edm::ValueMap<reco::CandidatePtr> >(
"l3Candidate");
215 size_t nmu =
muons->size();
216 std::vector<int> propagatesToM2(nmu), hasL1Particle(nmu), hasL1Filtered(nmu);
217 std::vector<int> hasL2Seed(nmu), hasL2Muon(nmu), hasL2MuonFiltered(nmu);
218 std::vector<int> hasL3Seed(nmu), hasL3Track(nmu), hasL3TrackFiltered(nmu), hasL3Muon(nmu), hasL3MuonFiltered(nmu);
219 std::vector<reco::CandidatePtr> l1ptr(nmu), l2ptr(nmu), l3ptr(nmu);
221 for (
size_t i = 0;
i < nmu; ++
i) {
228 propagatesToM2[
i] = 1;
232 l1extra::L1MuonParticleCollection::const_iterator it;
233 L2MuonTrajectorySeedCollection::const_iterator iSeed;
234 L3MuonTrajectorySeedCollection::const_iterator iSeedL3;
235 RecoChargedCandidateCollection::const_iterator iL2Muon;
236 reco::TrackCollection::const_iterator tktrackL3;
237 RecoChargedCandidateCollection::const_iterator iL3Muon;
244 double L1phi = (*it).phi();
245 double L1eta = (*it).eta();
246 double L1pt = (*it).pt();
247 double dR =
deltaR(etaTk, phiTk, L1eta, L1phi);
253 if (!hasL1Particle[
i])
257 if ((
quality <= 3) || (L1pt < 7))
259 if (!hasL1Filtered[
i])
266 for (iSeed = L2Seeds->begin(); iSeed != L2Seeds->end(); ++iSeed) {
270 <<
"You're using a different L1 collection than the one used by L2 seeds.\n";
271 if (l1FromSeed.
key() != thisL1.
key())
280 for (iL2Muon =
L2Muons->begin(); iL2Muon !=
L2Muons->end(); ++iL2Muon) {
293 for (
size_t jjj = 0; jjj <
seeds.size(); jjj++) {
294 if (
seeds[jjj]->l1Particle() != l1FromSeed)
307 double Eta_L2 = L2Track.
eta();
308 double Pt_L2 = L2Track.
pt();
310 double BSPos_L2 = L2Track.
dxy(
beamSpot.position());
311 double dz_L2 = L2Track.
dz();
312 double err0_L2 = L2Track.
error(0);
313 double abspar0_L2 = fabs(L2Track.
parameter(0));
314 double ptLx_L2 = Pt_L2;
323 if (!hasL2MuonFiltered[
i]) {
327 hasL2MuonFiltered[
i]++;
334 for (iSeedL3 = L3Seeds->begin(); iSeedL3 != L3Seeds->end(); ++iSeedL3) {
335 TrackRef staTrack = iSeedL3->l2Track();
336 if (staTrack != L2FilteredRef)
346 for (tktrackL3 = L3TkTracks->begin(); tktrackL3 != L3TkTracks->end(); ++tktrackL3) {
349 TrackRef staTrack2 = l3seedRef->l2Track();
351 if (staTrack2 != L2FilteredRef)
353 if (!hasL3Track[
i]) {
361 for (iL3Muon =
L3Muons->begin(); iL3Muon !=
L3Muons->end(); ++iL3Muon) {
364 TrackRef staTrack3 = l3seedRef2->l2Track();
366 if (staTrack3 != L2FilteredRef)
378 double Eta_L3 = L3Track.
eta();
379 double Pt_L3 = L3Track.
pt();
381 double BSPos_L3 = L3Track.
dxy(
beamSpot.position());
382 double dz_L3 = L3Track.
dz();
383 double err0_L3 = L3Track.
error(0);
384 double abspar0_L3 = fabs(L3Track.
parameter(0));
385 double ptLx_L3 = Pt_L3;
392 if (!hasL3MuonFiltered[
i]) {
397 hasL3MuonFiltered[
i]++;
407 storeValueMap<int>(
event,
muons, propagatesToM2,
"propagatesToM2");
408 storeValueMap<int>(
event,
muons, hasL1Particle,
"hasL1Particle");
409 storeValueMap<int>(
event,
muons, hasL1Filtered,
"hasL1Filtered");
410 storeValueMap<int>(
event,
muons, hasL2Seed,
"hasL2Seed");
411 storeValueMap<int>(
event,
muons, hasL2Muon,
"hasL2Muon");
412 storeValueMap<int>(
event,
muons, hasL2MuonFiltered,
"hasL2MuonFiltered");
413 storeValueMap<int>(
event,
muons, hasL3Seed,
"hasL3Seed");
414 storeValueMap<int>(
event,
muons, hasL3Track,
"hasL3Track");
415 storeValueMap<int>(
event,
muons, hasL3Muon,
"hasL3Muon");
416 storeValueMap<int>(
event,
muons, hasL3MuonFiltered,
"hasL3MuonFiltered");
417 storeValueMap<reco::CandidatePtr>(
event,
muons, l1ptr,
"l1Candidate");
418 storeValueMap<reco::CandidatePtr>(
event,
muons, l2ptr,
"l2Candidate");
419 storeValueMap<reco::CandidatePtr>(
event,
muons, l3ptr,
"l3Candidate");
422 template <
typename T>
425 const std::vector<T> &
values,
429 unique_ptr<ValueMap<T> > valMap(
new ValueMap<T>());
ProductID id() const
Accessor for product ID.
~TriggerMatcherToHLTDebug() override
Destructor.
unsigned short numberOfValidHits() const
number of valid hits found
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > l1Token_
Propagate an object (usually a track) to the second (default) or first muon station.
Geom::Phi< T > phi() const
edm::EDGetTokenT< L3MuonTrajectorySeedCollection > theL3SeedsToken_
edm::EDGetTokenT< L2MuonTrajectorySeedCollection > theL2SeedsToken_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > theL2MuonsToken_
edm::AssociationMap< edm::OneToMany< std::vector< L2MuonTrajectorySeed >, std::vector< L2MuonTrajectorySeed > > > SeedMap
double parameter(int i) const
i-th parameter ( i = 0, ... 4 )
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > theL3MuonsToken_
key_type key() const
Accessor for product key.
unsigned int quality() const
get quality
double pt() const
track transverse momentum
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
GlobalPoint globalPosition() const
PropagateToMuonSetup const l1matcherSetup_
TriggerMatcherToHLTDebug(const edm::ParameterSet &pset)
edm::EDGetTokenT< SeedMap > seedMapToken_
edm::EDGetTokenT< edm::View< reco::Muon > > tagToken_
double error(int i) const
error on specified element
double eta() const
pseudorapidity of momentum vector
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
void produce(edm::Event &event, const edm::EventSetup &eventSetup) override
void storeValueMap(edm::Event &iEvent, const edm::Handle< edm::View< reco::Muon > > &handle, const std::vector< T > &values, const std::string &label) const
Store extra information in a ValueMap.
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
edm::EDGetTokenT< reco::TrackCollection > theL3TkTracksToken_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...