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");
ProductID id() const
Accessor for product ID.
unsigned short numberOfValidHits() const
number of valid hits found
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > l1Token_
Geom::Phi< T > phi() const
edm::EDGetTokenT< L3MuonTrajectorySeedCollection > theL3SeedsToken_
edm::EDGetTokenT< L2MuonTrajectorySeedCollection > theL2SeedsToken_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > theL2MuonsToken_
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
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_
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
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...