Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 54 of file AlignmentMuonHIPTrajectorySelector.cc.
Definition at line 115 of file AlignmentMuonHIPTrajectorySelector.cc.
References TrajectoryMeasurement::backwardPredictedState(), edm::AssociationMap< Tag >::begin(), edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, MuonSubdetId::CSC, MuonSubdetId::DT, edm::AssociationMap< Tag >::end(), TrajectoryMeasurement::forwardPredictedState(), iEvent, TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), m_hists, m_input, m_maxMuonResidual, m_minPt, m_minTrackerDOF, m_pt, m_resid_after, m_resid_before, m_tracker_dof, m_tracker_forwardredchi2, eostools::move(), DetId::Muon, LocalTrajectoryError::positionError(), TrajectoryMeasurement::recHit(), DetId::Tracker, PV3DBase< T, PVType, FrameType >::x(), hit::x, LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), hit::y, and LocalError::yy().
121 auto newTrajTrackMap = std::make_unique<TrajTrackAssociationCollection>();
126 iPair != originalTrajTrackMap->
end();
129 m_pt->Fill((*(*iPair).val).pt());
132 if ((*(*iPair).val).pt() >
m_minPt) {
133 std::vector<TrajectoryMeasurement> measurements = (*(*iPair).key).measurements();
135 bool has_bad_residual =
false;
137 double tracker_forwardchi2 = 0.;
138 double tracker_dof = 0.;
139 for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end();
143 const DetId id =
hit->geographicalId();
146 if (
hit->dimension() == 1) {
151 tracker_forwardchi2 += residual * residual / error2;
153 }
else if (
hit->dimension() == 2) {
163 tracker_forwardchi2 +=
164 (residualx * residualx + residualy * residualy) / (errorxx2 + 2. * errorxy2 + erroryy2);
176 has_bad_residual =
true;
181 double tracker_forwardredchi2 = tracker_forwardchi2 / tracker_dof;
187 for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end();
191 const DetId id =
hit->geographicalId();
193 if (!has_bad_residual) {
205 if (tracker_forwardredchi2 < m_maxTrackerForwardRedChi2 && tracker_dof >=
m_minTrackerDOF && !has_bad_residual) {
206 newTrajTrackMap->insert((*iPair).key, (*iPair).val);
const LocalTrajectoryError & localError() const
LocalPoint localPosition() const
friend struct const_iterator
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
LocalError positionError() const
const_iterator end() const
last iterator over the map (read only)
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
TH1F * m_tracker_forwardredchi2
const_iterator begin() const
first iterator over the map (read only)
ConstRecHitPointer const & recHit() const