25 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") <<
"Constructor called." << endl;
36 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") <<
"Destructor called." << endl;
46 vector<Trajectory> refitted;
56 reverse(trajRH.begin(),trajRH.end());
57 refitted =
theFitter->fit(trajectory.
seed(), trajRH, firstTsos);
59 if(!refitted.empty())
return RefitResult(
true,refitted.front());
66 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") <<
"---------------------------------" << endl;
67 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") <<
"Starting refitting loop:" << endl;
69 unsigned int nSuccess=0;
70 unsigned int nOrigHits=trajectory.
recHits().size();
78 lastFitted = singleRefitResult.second;
79 unsigned int nLastHits=lastFitted.
recHits().size();
81 if(!singleRefitResult.first) {
83 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") <<
" refit n. " << nSuccess+1 <<
": failed" << endl;
87 double lostFract= 1 - double(nLastHits)/nOrigHits;
90 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") <<
" refit n. " << nSuccess+1 <<
": too many RH lost" << endl;
91 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") <<
" Survived RecHits: " << nLastHits <<
"/" << nOrigHits << endl;
96 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") <<
" refit n. " << nSuccess <<
": OK" << endl;
97 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") <<
" Survived RecHits: " << nLastHits <<
"/" << nOrigHits << endl;
101 LogDebug(
"Muon|RecoMuon|StandAloneMuonRefitter") << nSuccess <<
" successful refits!" << endl;
const MuonServiceProxy * theService
bool isForceAllIterations
void rescaleError(double factor)
T getParameter(std::string const &) const
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
StandAloneMuonRefitter(const edm::ParameterSet &par, const MuonServiceProxy *service)
Constructor.
unsigned int theNumberOfIterations
ConstRecHitContainer recHits(bool splitting=false) const
edm::ESHandle< TrajectoryFitter > theFitter
std::pair< bool, Trajectory > RefitResult
TrajectoryMeasurement const & lastMeasurement() const
RefitResult refit(const Trajectory &)
double theMaxFractionOfLostHits
virtual ~StandAloneMuonRefitter()
Destructor.
std::vector< ConstRecHitPointer > ConstRecHitContainer
RefitResult singleRefit(const Trajectory &)
Refit.
std::string theFitterName
TrajectoryStateOnSurface const & updatedState() const