108 if (m_refitTracker) {
114 produces<std::vector<Trajectory>>();
115 produces<TrajTrackAssociationCollection>();
150 auto trajectoryCollection = std::make_unique<std::vector<Trajectory>>();
156 for (reco::MuonCollection::const_iterator
globalMuon = globalMuons->begin();
globalMuon != globalMuons->end();
160 reco::TrackCollection::const_iterator globalMuonTrack = globalMuonTracks->begin();
161 for (; globalMuonTrack != globalMuonTracks->end(); ++globalMuonTrack) {
163 if (fabs(
globalMuon->combinedMuon()->phi() - globalMuonTrack->phi()) < 1
e-10 &&
164 fabs(
globalMuon->combinedMuon()->eta() - globalMuonTrack->eta()) < 1
e-10)
167 if (globalMuonTrack == globalMuonTracks->end()) {
168 throw cms::Exception(
"BadConfig") <<
"The tracks label doesn't correspond to the same objects as the muons label"
176 if (trackerTrajectories.size() == 1) {
177 const Trajectory trackerTrajectory = *(trackerTrajectories.begin());
210 std::vector<TrajectoryStateOnSurface> TSOSes;
211 for (
auto const&
hit :
globalMuon->combinedMuon()->recHits()) {
215 bool extrapolated =
false;
224 if (extrapolated && extrapolation.
isValid()) {
226 TSOSes.push_back(extrapolation);
231 if (!muonHits.
empty()) {
236 for (
unsigned int i = 0;
i < muonHits.
size();
i++) {
242 trajectoryCollection->push_back(trajectory);
246 reference_map[trajCounter] = trackCounter;
252 unsigned int numTrajectories = trajectoryCollection->size();
258 auto trajTrackMap = std::make_unique<TrajTrackAssociationCollection>();
260 for (trajCounter = 0; trajCounter < numTrajectories; trajCounter++) {
263 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory>>(ohTrajs, trajCounter),
RecHitPointer build(const TrackingRecHit *p, edm::ESHandle< GlobalTrackingGeometry > trackingGeometry) const
Call the MuonTransientTrackingRecHit::specificBuild.
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ConstRecHitPointer const & recHit() const
#define DEFINE_FWK_MODULE(type)
constexpr uint32_t rawId() const
get the raw id
edm::InputTag m_globalMuons
~TrackerToMuonPropagator() override
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > m_esTokenDT
const Plane & surface() const
The nominal surface of the GeomDet.
const edm::ESGetToken< Propagator, TrackingComponentsRecord > m_esTokenProp
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > m_esTokenCSC
TrackTransformer * m_trackTransformer
bool getData(T &iHolder) const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_esTokenTk
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > m_esTokenGTGeo
edm::InputTag m_globalMuonTracks
const GeomDet * idToDet(DetId) const override
void produce(edm::Event &, const edm::EventSetup &) override
TrackerToMuonPropagator(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const TrackerGeomDet * idToDet(DetId) const override
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
TrajectoryMeasurement const & firstMeasurement() const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_esTokenMF
T getParameter(std::string const &) const
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
void push(const TrajectoryMeasurement &tm)
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
const GeomDet * idToDet(DetId) const override