41 category_ =
"Muon|RecoMuon|CosmicMuon|CosmicMuonSmoother";
60 std::vector<Trajectory> && fitted =
fit(t);
62 std::vector<Trajectory> && smoothed =
smooth(fitted);
63 return smoothed.empty() ?
Trajectory() : smoothed.front();
73 if ( hits.empty() ||!firstPredTsos.
isValid() )
return vector<Trajectory>();
82 vector<Trajectory> fitted =
fit(seed, hits, firstTsos);
84 vector<Trajectory> smoothed =
smooth(fitted);
96 if ( t.
empty() )
return vector<Trajectory>();
103 return vector<Trajectory>();
111 <<hits.back()->globalPosition();
115 LogTrace(
category_)<<
"after sorting hit front" <<hits.front()->globalPosition()<<
" hit back"
116 <<hits.back()->globalPosition();
118 return fit(t.
seed(), hits, firstTsos);
132 if ( hits.empty() ) {
134 return vector<Trajectory>();
144 return vector<Trajectory>();
148 if ( hits.front()->isValid() ) {
152 auto preciseHit = hits.front();
154 LogTrace(
category_)<<
"first hit is at det "<< hits.front()->det()->surface().position();
159 <<
"an updated state is not valid. killing the trajectory.";
160 return vector<Trajectory>();
173 for ( ConstRecHitContainer::const_iterator ihit = hits.begin() + 1;
174 ihit != hits.end(); ++ihit ) {
176 if ( !(**ihit).isValid() ) {
187 <<
"Input state is not valid. This loop over hits is doomed: breaking out";
200 predTsos =
theService->propagator(
"StraightLinePropagator")->propagate(currTsos, (**ihit).det()->
surface());
212 }
else if ( (**ihit).isValid() ) {
216 auto preciseHit = *ihit;
218 if ( !preciseHit->isValid() ) {
225 <<
"an updated state is not valid. killing the trajectory.";
226 return vector<Trajectory>();
238 std::vector<TrajectoryMeasurement> mytms = myTraj.
measurements();
240 for (std::vector<TrajectoryMeasurement>::const_iterator itm = mytms.begin();
241 itm != mytms.end(); ++itm ) {
243 <<
"mom "<<itm->updatedState().globalMomentum();
247 return vector<Trajectory>(1, myTraj);
257 vector<Trajectory>
result;
259 for ( vector<Trajectory>::const_iterator it = tc.begin(); it != tc.end(); ++it ) {
260 vector<Trajectory> smoothed =
smooth(*it);
261 result.insert(result.end(), smoothed.begin(), smoothed.end());
276 return vector<Trajectory>();
283 if ( avtm.size() < 2 ) {
285 return vector<Trajectory>();
293 return vector<Trajectory>();
299 if ( avtm.back().recHit()->isValid() ) {
303 <<
"an updated state is not valid. killing the trajectory.";
304 return vector<Trajectory>();
308 avtm.back().updatedState(),
309 avtm.back().recHit(),
310 avtm.back().estimate()
325 for ( vector<TrajectoryMeasurement>::reverse_iterator itm = avtm.rbegin() + 1;
326 itm != avtm.rend() - 1; ++itm ) {
350 return vector<Trajectory>();
352 }
else if ( (*itm).recHit()->isValid() ) {
357 <<
"an updated state is not valid. killing the trajectory.";
358 return vector<Trajectory>();
363 return vector<Trajectory>();
370 return vector<Trajectory>();
386 return vector<Trajectory>();
404 avtm.front().recHit()));
406 if ( avtm.front().recHit()->isValid() ) {
413 avtm.front().recHit(),
421 if (myTraj.foundHits() >= 3)
422 return vector<Trajectory>(1, myTraj);
425 return vector<Trajectory>();
439 if ( !beamhaloFlag ) {
471 if (hits.size() < 2)
return;
476 std::reverse(hits.begin(),hits.end());
bool empty() const
True if trajectory has no measurements.
void rescaleError(double factor)
T getParameter(std::string const &) const
void sortHitsAlongMom(ConstRecHitContainer &hits, const TrajectoryStateOnSurface &) const
virtual TrajectoryContainer trajectories(const Trajectory &traj) const override
const MuonServiceProxy * theService
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
ConstRecHitContainer recHits() const
virtual ~CosmicMuonSmoother()
Trajectory trajectory(const Trajectory &) const override
const Propagator * propagatorOpposite() const
const Propagator * propagatorAlong() const
const Chi2MeasurementEstimator * theEstimator
U second(std::pair< T, U > const &p)
DataContainer const & measurements() const
const SurfaceType & surface() const
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const
const CosmicMuonUtilities * theUtilities
std::vector< Trajectory > smooth(const std::vector< Trajectory > &) const
TrajectoryMeasurement const & lastMeasurement() const
std::string thePropagatorAlongName
TrajectoryStateOnSurface stepPropagate(const TrajectoryStateOnSurface &, const ConstRecHitPointer &, const Propagator &) const
const KFUpdator * theUpdator
TrajectoryMeasurement const & firstMeasurement() const
TrajectoryStateOnSurface initialState(const Trajectory &) const
std::vector< Trajectory > fit(const Trajectory &) const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
GlobalVector globalMomentum() const
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const
CosmicMuonSmoother(const edm::ParameterSet &, const MuonServiceProxy *service)
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
TrajectoryStateOnSurface const & updatedState() const
void reverseDirection(TrajectoryStateOnSurface &, const MagneticField *) const
void push(const TrajectoryMeasurement &tm)
std::string thePropagatorOppositeName