#include <L1MuonSeedsMerger.h>
Classes | |
struct | Less |
Public Types | |
typedef std::pair< const reco::Track *, SeedingHitSet > | TrackAndHits |
typedef std::vector< TrackAndHits > | TracksAndHits |
Public Member Functions | |
L1MuonSeedsMerger (const edm::ParameterSet &cfg) | |
virtual void | resolve (TracksAndHits &) const |
virtual | ~L1MuonSeedsMerger () |
Private Types | |
enum | Action { goAhead, killFirst, killSecond, mergeTwo } |
Private Member Functions | |
Action | compare (const TrackAndHits *, const TrackAndHits *) const |
const TrackAndHits * | merge (const TrackAndHits *, const TrackAndHits *) const |
Private Attributes | |
float | theDeltaEtaCut |
float | theDiffRelPtCut |
Definition at line 10 of file L1MuonSeedsMerger.h.
typedef std::pair<const reco::Track*, SeedingHitSet > L1MuonSeedsMerger::TrackAndHits |
Definition at line 12 of file L1MuonSeedsMerger.h.
typedef std::vector<TrackAndHits> L1MuonSeedsMerger::TracksAndHits |
Definition at line 13 of file L1MuonSeedsMerger.h.
enum L1MuonSeedsMerger::Action [private] |
Definition at line 18 of file L1MuonSeedsMerger.h.
{ goAhead, killFirst, killSecond, mergeTwo };
L1MuonSeedsMerger::L1MuonSeedsMerger | ( | const edm::ParameterSet & | cfg | ) |
Definition at line 6 of file L1MuonSeedsMerger.cc.
References edm::ParameterSet::getParameter(), theDeltaEtaCut, and theDiffRelPtCut.
{ theDeltaEtaCut = cfg.getParameter<double>("deltaEtaCut"); theDiffRelPtCut = cfg.getParameter<double>("diffRelPtCut"); }
virtual L1MuonSeedsMerger::~L1MuonSeedsMerger | ( | ) | [inline, virtual] |
Definition at line 15 of file L1MuonSeedsMerger.h.
{}
L1MuonSeedsMerger::Action L1MuonSeedsMerger::compare | ( | const TrackAndHits * | a, |
const TrackAndHits * | b | ||
) | const [private] |
Definition at line 60 of file L1MuonSeedsMerger.cc.
References goAhead, killFirst, killSecond, SeedingHitSet::size(), and theDiffRelPtCut.
Referenced by resolve().
{ int nshared = 0; const SeedingHitSet & hitsA = a->second; const SeedingHitSet & hitsB = b->second; for (unsigned int iHitA=0, nHitsA=hitsA.size(); iHitA < nHitsA; ++iHitA) { const TrackingRecHit* trhA = hitsA[iHitA]->hit(); for (unsigned int iHitB=0, nHitsB=hitsB.size(); iHitB < nHitsB; ++iHitB) { const TrackingRecHit* trhB = hitsB[iHitB]->hit(); if (trhA==trhB) nshared++; } } if (nshared >= 2) { if (hitsA.size() >= 3 && hitsB.size() >= 3 ) return (a->first->chi2() > b->first->chi2()) ? killFirst : killSecond; else if (hitsB.size() >= 3) return killFirst; else return killSecond; } else if (nshared >= 1) { if (hitsA.size() != hitsB.size()) return (hitsA.size() < hitsB.size()) ? killFirst : killSecond; else if ( hitsA.size() >= 3 && a->first->charge()==b->first->charge() && fabs(a->first->pt()-b->first->pt())/b->first->pt() < theDiffRelPtCut ) return (a->first->chi2() > b->first->chi2()) ? killFirst : killSecond; else if ( hitsA.size() == 2 ) return (a->first->pt() < b->first->pt()) ? killFirst : killSecond; else return goAhead; } else return goAhead; }
const L1MuonSeedsMerger::TrackAndHits * L1MuonSeedsMerger::merge | ( | const TrackAndHits * | a, |
const TrackAndHits * | b | ||
) | const [private] |
void L1MuonSeedsMerger::resolve | ( | TracksAndHits & | ) | const [virtual] |
Definition at line 12 of file L1MuonSeedsMerger.cc.
References compare(), goAhead, killFirst, killSecond, merge(), mergeTwo, python::multivaluedict::sort(), and theDeltaEtaCut.
Referenced by TSGFromL1Muon::produce().
{ sort(tracks.begin(),tracks.end(), Less()); typedef std::vector<TrackAndHits>::iterator Tracks_Itr; Tracks_Itr it1 = tracks.begin(); while (it1 != tracks.end() ) { for (Tracks_Itr it2 = it1+1; it1->first && it2<tracks.end(); it2++) { if (! it2->first) continue; if ( it2->first->eta() - it1->first->eta() > theDeltaEtaCut) break; switch ( compare( &(*it1), &(*it2) ) ) { case killFirst : delete it1->first; it1->first = 0; break; case killSecond : delete it2->first; it2->first = 0; break; case mergeTwo : *it2 = *(merge(&(*it1),&(*it2))); it1->first = 0; break; case goAhead : default: break; } } if (0 == it1->first) tracks.erase(it1); else it1++; } }
float L1MuonSeedsMerger::theDeltaEtaCut [private] |
Definition at line 23 of file L1MuonSeedsMerger.h.
Referenced by L1MuonSeedsMerger(), and resolve().
float L1MuonSeedsMerger::theDiffRelPtCut [private] |
Definition at line 24 of file L1MuonSeedsMerger.h.
Referenced by compare(), and L1MuonSeedsMerger().