25 produces<reco::MuonTrackLinksCollection>();
43 auto output = std::make_unique<reco::MuonTrackLinksCollection>();
51 for(reco::MuonTrackLinksCollection::const_iterator link = links->begin();
52 link != links->end(); ++link){
54 unsigned int trackIndex = 0;
55 unsigned int muonTrackHits = link->trackerTrack()->extra()->recHitsSize();
56 for(reco::TrackCollection::const_iterator
track = incTracks->begin();
57 track != incTracks->end(); ++
track, ++trackIndex){
61 unsigned trackHits =
track->extra()->recHitsSize();
63 unsigned int smallestNumberOfHits = trackHits < muonTrackHits ? trackHits : muonTrackHits;
64 int numberOfCommonDetIds = 0;
65 for (
auto hit =
track->extra()->recHitsBegin();
67 for (
auto mit = link->trackerTrack()->extra()->recHitsBegin();
68 mit != link->trackerTrack()->extra()->recHitsEnd(); ++mit ) {
69 if ( (*hit)->geographicalId() == (*mit)->geographicalId() &&
71 numberOfCommonDetIds++;
76 double fraction = (double)numberOfCommonDetIds/smallestNumberOfHits;
80 link->standAloneTrack(),
81 link->globalTrack() ) );
88 link->standAloneTrack(),
89 link->globalTrack() ) );
T getParameter(std::string const &) const
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
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_
MuonLinksProducerForHLT(const edm::ParameterSet &)
edm::InputTag theInclusiveTrackCollectionInInput
virtual ~MuonLinksProducerForHLT()