20 : helper_(conf), conf_(conf), trackerHitAssociatorConfig_(conf,
std::
move(iC)) {
40 for (
unsigned int j = 0; j < tPCH->size(); j++)
44 for (
size_t i = 0;
i < tCH->size(); ++
i)
47 associateMuons(recToSim, simToRec, muonBaseRefVector, type, tpc, event, setup);
66 muonHitRefs.push_back(std::make_pair(mur->
track()->recHitsBegin(), mur->
track()->recHitsEnd()));
68 muonHitRefs.push_back(std::make_pair(allTMRecHits.
data().end(), allTMRecHits.
data().end()));
76 muonHitRefs.push_back(std::make_pair(mur->
outerTrack()->recHitsBegin(), mur->
outerTrack()->recHitsEnd()));
78 muonHitRefs.push_back(std::make_pair(allTMRecHits.
data().end(), allTMRecHits.
data().end()));
86 muonHitRefs.push_back(std::make_pair(mur->
globalTrack()->recHitsBegin(), mur->
globalTrack()->recHitsEnd()));
88 muonHitRefs.push_back(std::make_pair(allTMRecHits.
data().end(), allTMRecHits.
data().end()));
94 hitExtractor.
init(*event, *setup);
96 std::vector<std::pair<size_t, size_t>> muonHitIndices;
99 std::pair<size_t, size_t> indices(allTMRecHits.
size(), allTMRecHits.
size());
101 std::vector<const TrackingRecHit *>
hits = hitExtractor.
getMuonHits(*mur);
102 for (std::vector<const TrackingRecHit *>::const_iterator ith = hits.begin(), edh = hits.end(); ith != edh;
106 indices.second += hits.size();
108 muonHitIndices.push_back(indices);
111 typedef std::pair<size_t, size_t> index_pair;
113 for (std::vector<std::pair<size_t, size_t>>::const_iterator idxs = muonHitIndices.begin(),
114 idxend = muonHitIndices.end();
117 muonHitRefs.push_back(std::make_pair(hitRefBegin + idxs->first, hitRefBegin + idxs->second));
134 bool printRtS =
true;
144 for (
auto it = recSimColl.begin(), ed = recSimColl.end(); it != ed; ++it) {
146 std::vector<std::pair<TrackingParticleRef, double>> &tpAss = recToSim[rec];
147 for (
auto const &
a : it->second) {
148 tpAss.
push_back(std::make_pair(tPC[
a.idx],
a.quality));
152 for (
auto it = simRecColl.begin(), ed = simRecColl.end(); it != ed; ++it) {
154 std::vector<std::pair<edm::RefToBase<reco::Muon>,
double>> &recAss = simToRec[
sim];
155 for (
auto const &
a : it->second) {
156 recAss.
push_back(std::make_pair(muons[
a.idx],
a.quality));
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.
const_iterator end() const
def setup(process, global_tag, zero_tesla=False)
void associateMuons(MuonToSimCollection &recoToSim, SimToMuonCollection &simToReco, const edm::RefToBaseVector< reco::Muon > &, MuonTrackType, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const override
IndexAssociation associateSimToRecoIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
bool isTrackerMuon() const override
std::vector< std::pair< trackingRecHit_iterator, trackingRecHit_iterator > > TrackHitsCollection
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
std::map< TrackingParticleRef, std::vector< std::pair< edm::RefToBase< reco::Muon >, double > > > SimToMuonCollection
const_iterator begin() const
IndexAssociation associateRecoToSimIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
base const & data() const
MuonAssociatorByHitsHelper helper_
void push_back(const RefToBase< T > &)
~MuonToSimAssociatorByHits() override
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
T const * product() const
TrackerHitAssociator::Config trackerHitAssociatorConfig_
MuonToSimAssociatorByHits(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
edm::ParameterSet const conf_
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector