102 produces<std::vector<Trajectory>>();
103 produces<TrajTrackAssociationCollection>();
149 auto trajectoryCollection = std::make_unique<std::vector<Trajectory>>();
159 reco::TrackCollection::const_iterator globalMuonTrack = globalMuonTracks->begin();
160 for (; globalMuonTrack != globalMuonTracks->end(); ++globalMuonTrack) {
162 if (fabs(
globalMuon->combinedMuon()->phi() - globalMuonTrack->phi()) < 1
e-10 &&
163 fabs(
globalMuon->combinedMuon()->eta() - globalMuonTrack->eta()) < 1
e-10)
166 if (globalMuonTrack == globalMuonTracks->end()) {
167 throw cms::Exception(
"BadConfig") <<
"The tracks label doesn't correspond to the same objects as the muons label"
175 if (trackerTrajectories.size() == 1) {
176 const Trajectory trackerTrajectory = *(trackerTrajectories.begin());
209 std::vector<TrajectoryStateOnSurface> TSOSes;
210 for (
auto const&
hit :
globalMuon->combinedMuon()->recHits()) {
214 bool extrapolated =
false;
223 if (extrapolated && extrapolation.
isValid()) {
225 TSOSes.push_back(extrapolation);
230 if (!muonHits.
empty()) {
235 for (
unsigned int i = 0;
i < muonHits.
size();
i++) {
241 trajectoryCollection->push_back(trajectory);
245 reference_map[trajCounter] = trackCounter;
251 unsigned int numTrajectories = trajectoryCollection->size();
257 auto trajTrackMap = std::make_unique<TrajTrackAssociationCollection>();
259 for (trajCounter = 0; trajCounter < numTrajectories; trajCounter++) {
262 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory>>(ohTrajs, trajCounter),