56 if(theRescaleErrorFlag)
71 double chi2,
int granularity): theMaxChi2(chi2),
72 theGranularity(granularity),
73 theFitDirection(fitDirection){
91 pair<bool,TrajectoryStateOnSurface>
116 sort(recHitsForFit,detLayer);
120 LogTrace(metname)<<
"Number of rechits for the fit: "<<recHitsForFit.size()<<endl;
122 TransientTrackingRecHit::ConstRecHitContainer::iterator recHit;
123 for(recHit = recHitsForFit.begin(); recHit != recHitsForFit.end(); ++recHit ) {
124 if ((*recHit)->isValid() ) {
128 *recHit, propagator);
130 if ( propagatedTSOS.
isValid() ) {
131 pair<bool,double> thisChi2 =
estimator()->
estimate(propagatedTSOS, *((*recHit).get()));
133 LogTrace(metname) <<
"Estimation for Kalman Fit. Chi2: " << thisChi2.second;
136 bool wantIncludeThisHit =
true;
138 (*recHit)->geographicalId().det() ==
DetId::Muon &&
140 wantIncludeThisHit =
false;
141 LogTrace(metname) <<
"This is an RPC hit and the present configuration is such that it will be excluded from the fit";
148 if (thisChi2.first) {
150 if (wantIncludeThisHit) {
153 <<
" Kalman Start" <<
"\n" <<
"\n";
154 LogTrace(metname) <<
" Meas. Position : " << (**recHit).globalPosition() <<
"\n"
168 <<
" Fit position radius : "
170 <<
"filter updated" << endl;
174 LogTrace(metname) <<
"\n\n Kalman End" <<
"\n" <<
"\n";
177 *recHit, thisChi2.second, detLayer,
180 trajectory.
push(updatedMeasurement, thisChi2.second);
183 LogTrace(metname) <<
" Compatible RecHit with good chi2 but made with RPC when it was decided to not include it in the fit"
184 <<
" --> trajectory NOT updated, invalid RecHit added." << endl;
187 invalidRhPtr->invalidateHit();
188 TrajectoryMeasurement invalidRhMeasurement(propagatedTSOS, propagatedTSOS, invalidRhPtr.get(), thisChi2.second, detLayer);
189 trajectory.
push(invalidRhMeasurement, thisChi2.second);
194 LogTrace(metname) <<
" Compatible RecHit with too large chi2"
195 <<
" --> trajectory NOT updated, invalid RecHit added." << endl;
198 invalidRhPtr->invalidateHit();
199 TrajectoryMeasurement invalidRhMeasurement(propagatedTSOS, propagatedTSOS, invalidRhPtr.get(), thisChi2.second, detLayer);
200 trajectory.
push(invalidRhMeasurement, thisChi2.second);
206 recHitsForFit.clear();
207 return pair<bool,TrajectoryStateOnSurface>(updated,lastUpdatedTSOS);
218 if( current->geographicalId() == mother->geographicalId() )
222 propagator->
propagate(state, current->det()->surface());
231 const double &chi2,
const DetLayer *detLayer,
234 recHit,chi2,detLayer);
261 LogError(
"Muon|RecoMuon|MuonTrajectoryUpdator") <<
"MuonTrajectoryUpdator::sort: Wrong propagation direction!!";
270 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
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
const std::string metname
void makeFirstTime()
reset the theFirstTSOSFlag
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const =0
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
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
tuple Chi2MeasurementEstimator
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
std::vector< ConstRecHitPointer > ConstRecHitContainer
Ordering along increasing radius (for DT rechits)
const TrajectoryStateUpdator * measurementUpdator() const
TrajectoryStateUpdator * theUpdator
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