34 m_hitExtractor(&iHitExtractor),
35 m_resources(iResources),
62 muonHitRefs.push_back(std::make_pair(mur->
track()->recHitsBegin(), mur->
track()->recHitsEnd()));
64 muonHitRefs.push_back(std::make_pair(allTMRecHits.
data().end(), allTMRecHits.
data().end()));
72 muonHitRefs.push_back(std::make_pair(mur->
outerTrack()->recHitsBegin(), mur->
outerTrack()->recHitsEnd()));
74 muonHitRefs.push_back(std::make_pair(allTMRecHits.
data().end(), allTMRecHits.
data().end()));
82 muonHitRefs.push_back(std::make_pair(mur->
globalTrack()->recHitsBegin(), mur->
globalTrack()->recHitsEnd()));
84 muonHitRefs.push_back(std::make_pair(allTMRecHits.
data().end(), allTMRecHits.
data().end()));
90 std::vector<std::pair<size_t, size_t> > muonHitIndices;
93 std::pair<size_t, size_t> indices(allTMRecHits.
size(), allTMRecHits.
size());
96 for (std::vector<const TrackingRecHit *>::const_iterator ith = hits.begin(), edh = hits.end(); ith != edh; ++ith) {
99 indices.second += hits.size();
101 muonHitIndices.push_back(indices);
104 typedef std::pair<size_t, size_t> index_pair;
106 for (std::vector<std::pair<size_t, size_t> >::const_iterator idxs = muonHitIndices.begin(), idxend = muonHitIndices.end(); idxs != idxend; ++idxs) {
107 muonHitRefs.push_back(std::make_pair(hitRefBegin+idxs->first,
108 hitRefBegin+idxs->second));
117 for (
auto it = recSimColl.begin(), ed = recSimColl.end(); it != ed; ++it) {
119 std::vector<std::pair<TrackingParticleRef, double> > & tpAss = recToSim[rec];
120 for (
auto const &
a : it->second) {
121 tpAss.
push_back(std::make_pair(tPC[
a.idx],
a.quality));
125 for (
auto it = simRecColl.begin(), ed = simRecColl.end(); it != ed; ++it) {
127 std::vector<std::pair<edm::RefToBase<reco::Muon>,
double> > & recAss = simToRec[
sim];
128 for (
auto const &
a: it->second ) {
129 recAss.
push_back(std::make_pair(muons[
a.idx],
a.quality));
142 for (
unsigned int j=0; j<tPCH->size();j++)
146 for (
size_t i = 0;
i < tCH->size(); ++
i)
std::map< edm::RefToBase< reco::Muon >, std::vector< std::pair< TrackingParticleRef, double > >, RefToBaseSort > MuonToSimCollection
bool isNonnull() const
Checks for non-null.
TrackerMuonHitExtractor const * m_hitExtractor
void associateMuons(reco::MuonToSimCollection &recoToSim, reco::SimToMuonCollection &simToReco, const edm::RefToBaseVector< reco::Muon > &muons, reco::MuonTrackType type, const edm::RefVector< TrackingParticleCollection > &tpColl) const override
bool isTrackerMuon() const
const_iterator end() const
virtual TrackRef track() const
reference to a Track
MuonToTrackingParticleAssociatorByHitsImpl(TrackerMuonHitExtractor const &iHitExtractor, MuonAssociatorByHitsHelper::Resources const &iResources, MuonAssociatorByHitsHelper const *iHelper)
IndexAssociation associateSimToRecoIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
std::map< TrackingParticleRef, std::vector< std::pair< edm::RefToBase< reco::Muon >, double > > > SimToMuonCollection
std::vector< std::pair< trackingRecHit_iterator, trackingRecHit_iterator > > TrackHitsCollection
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
const_iterator begin() const
IndexAssociation associateRecoToSimIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
base const & data() const
void push_back(const RefToBase< T > &)
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
MuonAssociatorByHitsHelper const * m_helper
MuonAssociatorByHitsHelper::Resources m_resources
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector