23 produces<reco::MuonTrackLinksCollection>();
37 auto output = std::make_unique<reco::MuonTrackLinksCollection>();
45 for (reco::MuonTrackLinksCollection::const_iterator
link = links->begin();
link != links->end(); ++
link) {
47 unsigned int trackIndex = 0;
48 unsigned int muonTrackHits =
link->trackerTrack()->extra()->recHitsSize();
49 for (reco::TrackCollection::const_iterator
track = incTracks->begin();
track != incTracks->end();
50 ++
track, ++trackIndex) {
56 unsigned trackHits =
track->extra()->recHitsSize();
58 unsigned int smallestNumberOfHits = trackHits < muonTrackHits ? trackHits : muonTrackHits;
59 int numberOfCommonDetIds = 0;
60 for (
auto hit =
track->extra()->recHitsBegin();
hit !=
track->extra()->recHitsEnd(); ++
hit) {
61 for (
auto mit =
link->trackerTrack()->extra()->recHitsBegin();
62 mit !=
link->trackerTrack()->extra()->recHitsEnd();
64 if ((*hit)->geographicalId() == (*mit)->geographicalId() &&
66 numberOfCommonDetIds++;
71 double fraction = (double)numberOfCommonDetIds / smallestNumberOfHits;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::InputTag theLinkCollectionInInput
edm::EDGetTokenT< reco::TrackCollection > trackToken_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkToken_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
MuonLinksProducerForHLT(const edm::ParameterSet &)
T getParameter(std::string const &) const
~MuonLinksProducerForHLT() override
edm::InputTag theInclusiveTrackCollectionInInput