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() ) {
151 LogTrace(
category_)<<
"first hit is at det "<< hits.front()->det()->surface().position();
153 currTsos =
theUpdator->update(predTsos, *preciseHit);
156 <<
"an updated state is not valid. killing the trajectory.";
157 return vector<Trajectory>();
170 for ( ConstRecHitContainer::const_iterator ihit = hits.begin() + 1;
171 ihit != hits.end(); ++ihit ) {
173 if ( !(**ihit).isValid() ) {
193 predTsos =
theService->propagator(
"StraightLinePropagator")->propagate(currTsos, (**ihit).det()->
surface());
205 }
else if ( (**ihit).isValid() ) {
209 if ( !preciseHit->isValid() ) {
213 currTsos =
theUpdator->update(predTsos, *preciseHit);
216 <<
"an updated state is not valid. killing the trajectory.";
217 return vector<Trajectory>();
229 std::vector<TrajectoryMeasurement> mytms = myTraj.
measurements();
231 for (std::vector<TrajectoryMeasurement>::const_iterator itm = mytms.begin();
232 itm != mytms.end(); ++itm ) {
234 <<
"mom "<<itm->updatedState().globalMomentum();
238 return vector<Trajectory>(1, myTraj);
248 vector<Trajectory>
result;
250 for ( vector<Trajectory>::const_iterator it = tc.begin(); it != tc.end(); ++it ) {
251 vector<Trajectory> smoothed =
smooth(*it);
252 result.insert(result.end(), smoothed.begin(), smoothed.end());
267 return vector<Trajectory>();
274 if ( avtm.size() < 2 ) {
276 return vector<Trajectory>();
284 return vector<Trajectory>();
290 if ( avtm.back().recHit()->isValid() ) {
291 currTsos =
theUpdator->update(predTsos, (*avtm.back().recHit()));
294 <<
"an updated state is not valid. killing the trajectory.";
295 return vector<Trajectory>();
299 avtm.back().updatedState(),
300 avtm.back().recHit(),
301 avtm.back().estimate()
316 for ( vector<TrajectoryMeasurement>::reverse_iterator itm = avtm.rbegin() + 1;
317 itm != avtm.rend() - 1; ++itm ) {
341 return vector<Trajectory>();
343 }
else if ( (*itm).recHit()->isValid() ) {
345 currTsos =
theUpdator->update(predTsos, (*(*itm).recHit()));
348 <<
"an updated state is not valid. killing the trajectory.";
349 return vector<Trajectory>();
354 return vector<Trajectory>();
361 return vector<Trajectory>();
368 theEstimator->estimate(combTsos, (*(*itm).recHit())).second
377 return vector<Trajectory>();
395 avtm.front().recHit()));
397 if ( avtm.front().recHit()->isValid() ) {
399 currTsos =
theUpdator->update(predTsos, (*avtm.front().recHit()));
404 avtm.front().recHit(),
405 theEstimator->estimate(predTsos, (*avtm.front().recHit())).second
412 if (myTraj.foundHits() >= 3)
413 return vector<Trajectory>(1, myTraj);
416 return vector<Trajectory>();
430 if ( !beamhaloFlag ) {
462 if (hits.size() < 2)
return;
467 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
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
virtual ~CosmicMuonSmoother()
const Propagator * propagatorOpposite() const
const Propagator * propagatorAlong() const
ConstRecHitContainer recHits(bool splitting=false) const
U second(std::pair< T, U > const &p)
DataContainer const & measurements() const
const SurfaceType & surface() const
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
tuple Chi2MeasurementEstimator
CosmicMuonUtilities * theUtilities
virtual TrajectoryContainer trajectories(const Trajectory &traj) const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
TrajectoryMeasurement const & firstMeasurement() const
TrajectoryStateOnSurface initialState(const Trajectory &) const
Chi2MeasurementEstimator * theEstimator
std::vector< Trajectory > fit(const Trajectory &) const
GlobalVector globalMomentum() const
CosmicMuonSmoother(const edm::ParameterSet &, const MuonServiceProxy *service)
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
TrajectoryStateOnSurface const & updatedState() const
void reverseDirection(TrajectoryStateOnSurface &, const MagneticField *) const
Trajectory trajectory(const Trajectory &) const
void push(const TrajectoryMeasurement &tm)
std::string thePropagatorOppositeName