25 produces<reco::MuonTrackLinksCollection>();
51 for(reco::MuonTrackLinksCollection::const_iterator
link = links->begin();
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){
58 if ( track->pt() <
ptMin )
continue;
59 if ( track->p() <
pMin )
continue;
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();
66 hit != track->extra()->recHitsEnd(); ++
hit ) {
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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::InputTag theLinkCollectionInInput
std::vector< MuonTrackLinks > MuonTrackLinksCollection
collection of MuonTrackLinks
edm::EDGetTokenT< reco::TrackCollection > trackToken_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
MuonLinksProducerForHLT(const edm::ParameterSet &)
edm::InputTag theInclusiveTrackCollectionInInput
virtual ~MuonLinksProducerForHLT()