59 if(theRescaleErrorFlag)
74 double chi2,
int granularity): theMaxChi2(chi2),
75 theGranularity(granularity),
76 theFitDirection(fitDirection){
94 pair<bool,TrajectoryStateOnSurface>
119 sort(recHitsForFit,detLayer);
123 LogTrace(metname)<<
"Number of rechits for the fit: "<<recHitsForFit.size()<<endl;
125 TransientTrackingRecHit::ConstRecHitContainer::iterator recHit;
126 for(recHit = recHitsForFit.begin(); recHit != recHitsForFit.end(); ++recHit ) {
127 if ((*recHit)->isValid() ) {
131 *recHit, propagator);
133 if ( propagatedTSOS.
isValid() ) {
134 pair<bool,double> thisChi2 =
estimator()->
estimate(propagatedTSOS, *((*recHit).get()));
136 LogTrace(metname) <<
"Estimation for Kalman Fit. Chi2: " << thisChi2.second;
139 bool wantIncludeThisHit =
true;
141 (*recHit)->geographicalId().det() ==
DetId::Muon &&
143 wantIncludeThisHit =
false;
144 LogTrace(metname) <<
"This is an RPC hit and the present configuration is such that it will be excluded from the fit";
151 if (thisChi2.first) {
153 if (wantIncludeThisHit) {
156 <<
" Kalman Start" <<
"\n" <<
"\n";
157 LogTrace(metname) <<
" Meas. Position : " << (**recHit).globalPosition() <<
"\n"
171 <<
" Fit position radius : "
173 <<
"filter updated" << endl;
177 LogTrace(metname) <<
"\n\n Kalman End" <<
"\n" <<
"\n";
180 *recHit, thisChi2.second, detLayer,
183 trajectory.
push(
std::move(updatedMeasurement), thisChi2.second);
186 LogTrace(metname) <<
" Compatible RecHit with good chi2 but made with RPC when it was decided to not include it in the fit"
187 <<
" --> trajectory NOT updated, invalid RecHit added." << endl;
190 invalidRhPtr->invalidateHit();
191 TrajectoryMeasurement invalidRhMeasurement(propagatedTSOS, propagatedTSOS, invalidRhPtr, thisChi2.second, detLayer);
192 trajectory.
push(
std::move(invalidRhMeasurement), thisChi2.second);
197 LogTrace(metname) <<
" Compatible RecHit with too large chi2"
198 <<
" --> trajectory NOT updated, invalid RecHit added." << endl;
201 invalidRhPtr->invalidateHit();
202 TrajectoryMeasurement invalidRhMeasurement(propagatedTSOS, propagatedTSOS, invalidRhPtr, thisChi2.second, detLayer);
203 trajectory.
push(
std::move(invalidRhMeasurement), thisChi2.second);
209 recHitsForFit.clear();
210 return pair<bool,TrajectoryStateOnSurface>(updated,lastUpdatedTSOS);
221 if( current->geographicalId() == mother->geographicalId() )
237 recHit,chi2,detLayer);
264 LogError(
"Muon|RecoMuon|MuonTrajectoryUpdator") <<
"MuonTrajectoryUpdator::sort: Wrong propagation direction!!";
273 LogError(
"Muon|RecoMuon|MuonTrajectoryUpdator") <<
"MuonTrajectoryUpdator::sort: Wrong propagation direction!!";
282 LogError(
"Muon|RecoMuon|MuonTrajectoryUpdator") <<
"MuonTrajectoryUpdator::sort: Wrong propagation direction!!";
285 LogError(
"Muon|RecoMuon|MuonTrajectoryUpdator") <<
"ME0s are sorted";
291 LogError(
"Muon|RecoMuon|MuonTrajectoryUpdator") <<
"MuonTrajectoryUpdator::sort: Wrong propagation direction!!";
void rescaleError(double factor)
T getParameter(std::string const &) const
Ordering along decreasing radius (for DT rechits)
TrajectoryStateOnSurface const & predictedState() const
const MeasurementEstimator * estimator() const
accasso at the propagator
ConstRecHitPointer const & recHit() const
const std::string metname
void makeFirstTime()
reset the theFirstTSOSFlag
Ordering along increasing zed (for CSC rechits)
NavigationDirection fitDirection()
get the fit direction
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
GlobalPoint globalPosition() const
virtual ~MuonTrajectoryUpdator()
Destructor.
TrajectoryStateOnSurface propagateState(const TrajectoryStateOnSurface &state, const TrajectoryMeasurement *measurement, const TransientTrackingRecHit::ConstRecHitPointer ¤t, const Propagator *propagator) const
MuonTrajectoryUpdator(const edm::ParameterSet &par, NavigationDirection fitDirection)
Constructor from Propagator and Parameter set.
static TransientTrackingRecHit::ConstRecHitContainer breakInSubRecHits(TransientTrackingRecHit::ConstRecHitPointer, int granularity)
takes a muon rechit and returns its sub-rechits given a certain granularity
void sort(TransientTrackingRecHit::ConstRecHitContainer &, const DetLayer *)
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
const SurfaceType & surface() const
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
TrajectoryMeasurement updateMeasurement(const TrajectoryStateOnSurface &propagatedTSOS, const TrajectoryStateOnSurface &lastUpdatedTSOS, const TransientTrackingRecHit::ConstRecHitPointer &recHit, const double &chi2, const DetLayer *detLayer, const TrajectoryMeasurement *initialMeasurement)
Return the trajectory measurement. It handles both the fw and the bw propagation. ...
double theMaxChi2
the max chi2 allowed
const DetLayer * layer() const
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
std::vector< ConstRecHitPointer > ConstRecHitContainer
Ordering along increasing radius (for DT rechits)
const TrajectoryStateUpdator * measurementUpdator() const
TrajectoryStateUpdator * theUpdator
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
virtual std::pair< bool, TrajectoryStateOnSurface > update(const TrajectoryMeasurement *measurement, Trajectory &trajectory, const Propagator *propagator)
update the Trajectory with the TrajectoryMeasurement
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
Ordering along decreasing zed (for CSC rechits)
void push(const TrajectoryMeasurement &tm)
GlobalVector globalDirection() const
MeasurementEstimator * theEstimator