43 category_ =
"Muon|RecoMuon|CosmicMuon|CosmicMuonSmoother";
62 vector<Trajectory> fitted =
fit(t);
74 if ( hits.empty() ||!firstPredTsos.
isValid() )
return vector<Trajectory>();
83 vector<Trajectory> fitted =
fit(seed, hits, firstTsos);
85 vector<Trajectory> smoothed =
smooth(fitted);
97 if ( t.
empty() )
return vector<Trajectory>();
104 return vector<Trajectory>();
112 <<hits.back()->globalPosition();
116 LogTrace(
category_)<<
"after sorting hit front" <<hits.front()->globalPosition()<<
" hit back"
117 <<hits.back()->globalPosition();
119 return fit(t.
seed(), hits, firstTsos);
133 if ( hits.empty() ) {
135 return vector<Trajectory>();
145 return vector<Trajectory>();
149 if ( hits.front()->isValid() ) {
152 LogTrace(
category_)<<
"first hit is at det "<< hits.front()->det()->surface().position();
157 <<
"an updated state is not valid. killing the trajectory.";
158 return vector<Trajectory>();
171 for ( ConstRecHitContainer::const_iterator ihit = hits.begin() + 1;
172 ihit != hits.end(); ++ihit ) {
174 if ( !(**ihit).isValid() ) {
194 predTsos =
theService->propagator(
"StraightLinePropagator")->propagate(currTsos, (**ihit).det()->
surface());
206 }
else if ( (**ihit).isValid() ) {
210 if ( !preciseHit->isValid() ) {
217 <<
"an updated state is not valid. killing the trajectory.";
218 return vector<Trajectory>();
230 std::vector<TrajectoryMeasurement> mytms = myTraj.
measurements();
232 for (std::vector<TrajectoryMeasurement>::const_iterator itm = mytms.begin();
233 itm != mytms.end(); ++itm ) {
235 <<
"mom "<<itm->updatedState().globalMomentum();
239 return vector<Trajectory>(1, myTraj);
249 vector<Trajectory>
result;
251 for ( vector<Trajectory>::const_iterator it = tc.begin(); it != tc.end(); ++it ) {
252 vector<Trajectory> smoothed =
smooth(*it);
253 result.insert(result.end(), smoothed.begin(), smoothed.end());
268 return vector<Trajectory>();
275 if ( avtm.size() < 2 ) {
277 return vector<Trajectory>();
285 return vector<Trajectory>();
291 if ( avtm.back().recHit()->isValid() ) {
295 <<
"an updated state is not valid. killing the trajectory.";
296 return vector<Trajectory>();
300 avtm.back().updatedState(),
301 avtm.back().recHit(),
302 avtm.back().estimate()
317 for ( vector<TrajectoryMeasurement>::reverse_iterator itm = avtm.rbegin() + 1;
318 itm != avtm.rend() - 1; ++itm ) {
342 return vector<Trajectory>();
344 }
else if ( (*itm).recHit()->isValid() ) {
349 <<
"an updated state is not valid. killing the trajectory.";
350 return vector<Trajectory>();
355 return vector<Trajectory>();
362 return vector<Trajectory>();
378 return vector<Trajectory>();
396 avtm.front().recHit()));
398 if ( avtm.front().recHit()->isValid() ) {
405 avtm.front().recHit(),
413 if (myTraj.foundHits() >= 3)
414 return vector<Trajectory>(1, myTraj);
417 return vector<Trajectory>();
431 if ( !beamhaloFlag ) {
463 if (hits.size() < 2)
return;
468 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
std::vector< Trajectory > smooth(const std::vector< Trajectory > &) const
TrajectoryMeasurement const & lastMeasurement() const
TrajectoryStateOnSurface updatedState() const
std::string thePropagatorAlongName
TrajectoryStateOnSurface stepPropagate(const TrajectoryStateOnSurface &, const ConstRecHitPointer &, const Propagator &) const
tuple Chi2MeasurementEstimator
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
CosmicMuonUtilities * theUtilities
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
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
const Surface & surface() const
CosmicMuonSmoother(const edm::ParameterSet &, const MuonServiceProxy *service)
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
virtual std::vector< Trajectory > trajectories(const Trajectory &) const
void reverseDirection(TrajectoryStateOnSurface &, const MagneticField *) const
void push(const TrajectoryMeasurement &tm)
std::string thePropagatorOppositeName