21 : thePropagatorAlongToken(
23 thePropagatorOppositeToken(
25 thePropagatorAlong(nullptr),
26 thePropagatorOpposite(nullptr),
27 theNumberMeasurementsForFit(conf.getParameter<
int>(
"numberMeasurementsForFit")) {}
36 bool doBackFit)
const {
38 LogDebug(
"TransientInitialStateEstimator")
39 <<
"a backward fit will not be done. assuming that the state on first measurement is OK";
42 return std::pair<TrajectoryStateOnSurface, const GeomDet*>(
std::move(firstStateFromForward),
46 LogDebug(
"TransientInitialStateEstimator")
47 <<
"told to not do a back fit, but the forward state of the first measurement is not valid. doing a back fit.";
52 if (nMeas - 1 < lastFitted)
53 lastFitted = nMeas - 1;
58 bool foundLast =
false;
61 for (
int i = lastFitted;
i >= 0;
i--) {
62 if (measvec[
i].
recHit()->det()) {
67 firstHits.push_back(measvec[
i].
recHit());
70 TSOS startingState = measvec[actualLast].updatedState();
76 KFTrajectoryFitter backFitter(
87 LogDebug(
"TransientInitialStateEstimator")
88 <<
"using a backward fit of :" << firstHits.size() <<
" hits, starting from:\n" 89 << startingState <<
" to get the estimate of the initial state of the track.";
92 LogDebug(
"TransientInitialStateEstimator") <<
"FitTester: first hits fit failed!";
93 return std::pair<TrajectoryStateOnSurface, const GeomDet*>();
111 LogDebug(
"TransientInitialStateEstimator")
112 <<
"the initial state is found to be:\n:" << firstState
113 <<
"\n it's field pointer is: " << firstState.magneticField()
116 return std::pair<TrajectoryStateOnSurface, const GeomDet*>(
std::move(firstState), firstMeas.
recHit()->det());
void rescaleError(double factor)
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorAlongToken
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const LocalTrajectoryError & localError() const
std::pair< TrajectoryStateOnSurface, const GeomDet * > innerState(const Trajectory &traj, bool doBackFit=true) const
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
const LocalTrajectoryParameters & localParameters() const
const SurfaceType & surface() const
TrajectoryMeasurement const & lastMeasurement() const
const Propagator * thePropagatorOpposite
DataContainer const & measurements() const
void setEventSetup(const edm::EventSetup &es, const TkClonerImpl &hc)
const Propagator * thePropagatorAlong
PropagationDirection const & direction() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
const int theNumberMeasurementsForFit
TrajectoryStateOnSurface const & updatedState() const
virtual const MagneticField * magneticField() const =0
signed char nLoops() const
TrajectoryMeasurement const & firstMeasurement() const
TransientInitialStateEstimator(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
const MagneticField * magneticField() const
TkClonerImpl theHitCloner
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToken
ConstRecHitPointer const & recHit() const