34 m_hitExtractor(&iHitExtractor),
35 m_resources(iResources),
58 std::vector<edm::OwnVector<TrackingRecHit> > TMRecHits;
67 muonHitRefs.push_back(std::make_pair(mur->
track()->recHitsBegin(), mur->
track()->recHitsEnd()));
69 muonHitRefs.push_back(std::make_pair(allTMRecHits.
data().end(), allTMRecHits.
data().end()));
77 muonHitRefs.push_back(std::make_pair(mur->
outerTrack()->recHitsBegin(), mur->
outerTrack()->recHitsEnd()));
79 muonHitRefs.push_back(std::make_pair(allTMRecHits.
data().end(), allTMRecHits.
data().end()));
87 muonHitRefs.push_back(std::make_pair(mur->
globalTrack()->recHitsBegin(), mur->
globalTrack()->recHitsEnd()));
89 muonHitRefs.push_back(std::make_pair(allTMRecHits.
data().end(), allTMRecHits.
data().end()));
95 std::vector<std::pair<size_t, size_t> > muonHitIndices;
98 std::pair<size_t, size_t> indices(allTMRecHits.
size(), allTMRecHits.
size());
101 for (std::vector<const TrackingRecHit *>::const_iterator ith = hits.begin(), edh = hits.end(); ith != edh; ++ith) {
104 indices.second += hits.size();
106 muonHitIndices.push_back(indices);
109 typedef std::pair<size_t, size_t> index_pair;
111 for (std::vector<std::pair<size_t, size_t> >::const_iterator idxs = muonHitIndices.begin(), idxend = muonHitIndices.end(); idxs != idxend; ++idxs) {
112 muonHitRefs.push_back(std::make_pair(hitRefBegin+idxs->first,
113 hitRefBegin+idxs->second));
120 <<
"\n"<<
"There are "<<muons.
size()<<
" selected reco::Muons.";
127 <<
" #"<<isel<<
", reco::Muon key = " <<mur.
key()
128 <<
", q*p = "<<mur->
charge()*mur->
p()<<
", pT = "<<mur->
pt()<<
", eta = "<<mur->
eta()<<
", phi = "<<mur->
phi();
133 <<
"\t this is a Global Muon with valid muon hits";
134 muonHitRefs.push_back(std::make_pair(mur->
globalTrack()->recHitsBegin(), mur->
globalTrack()->recHitsEnd()));
140 <<
"\t this is a Tracker Muon";
144 for (std::vector<const TrackingRecHit *>::const_iterator ith = hits.begin(), edh = hits.end(); ith != edh; ++ith) {
148 TMRecHits.push_back(TMvec);
150 muonHitRefs.push_back(std::make_pair(TMRecHits.rbegin()->data().begin(), TMRecHits.rbegin()->data().end()));
156 <<
"\t this is a Standalone muon";
157 muonHitRefs.push_back(std::make_pair(mur->
outerTrack()->recHitsBegin(), mur->
outerTrack()->recHitsEnd()));
162 <<
"\t what muon is this ?";
167 muonHitRefs.push_back(std::make_pair(noTM.
data().end(), noTM.
data().end()));
179 for (
auto it = recSimColl.begin(), ed = recSimColl.end(); it != ed; ++it) {
181 std::vector<std::pair<TrackingParticleRef, double> > & tpAss = recToSim[rec];
182 for (
auto const &
a : it->second) {
183 tpAss.
push_back(std::make_pair(tPC[
a.idx],
a.quality));
187 for (
auto it = simRecColl.begin(), ed = simRecColl.end(); it != ed; ++it) {
189 std::vector<std::pair<edm::RefToBase<reco::Muon>,
double> > & recAss = simToRec[
sim];
190 for (
auto const &
a: it->second ) {
191 recAss.
push_back(std::make_pair(muons[
a.idx],
a.quality));
204 for (
unsigned int j=0; j<tPCH->size();j++)
208 for (
size_t i = 0;
i < tCH->size(); ++
i)
bool isMuon() const override
std::map< edm::RefToBase< reco::Muon >, std::vector< std::pair< TrackingParticleRef, double > >, RefToBaseSort > MuonToSimCollection
TrackRef track() const override
reference to a Track
bool isNonnull() const
Checks for non-null.
double eta() const final
momentum pseudorapidity
bool isStandAloneMuon() const override
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
const_iterator end() const
double pt() const final
transverse momentum
int charge() const final
electric charge
MuonToTrackingParticleAssociatorByHitsImpl(TrackerMuonHitExtractor const &iHitExtractor, MuonAssociatorByHitsHelper::Resources const &iResources, MuonAssociatorByHitsHelper const *iHelper)
IndexAssociation associateSimToRecoIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
bool isTrackerMuon() const override
std::map< TrackingParticleRef, std::vector< std::pair< edm::RefToBase< reco::Muon >, double > > > SimToMuonCollection
std::vector< std::pair< trackingRecHit_iterator, trackingRecHit_iterator > > TrackHitsCollection
bool isGlobalMuon() const override
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
double p() const final
magnitude of momentum vector
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
double phi() const final
momentum azimuthal angle
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