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
ConstRecHitPointer const & recHit() const
const LocalTrajectoryParameters & localParameters() const
const MagneticField * magneticField() const
const Propagator * thePropagatorOpposite
signed char nLoops() const
PropagationDirection const & direction() const
bool getData(T &iHolder) const
DataContainer const & measurements() const
const SurfaceType & surface() const
void setEventSetup(const edm::EventSetup &es, const TkClonerImpl &hc)
const Propagator * thePropagatorAlong
TrajectoryMeasurement const & lastMeasurement() const
const LocalTrajectoryError & localError() const
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
std::vector< ConstRecHitPointer > ConstRecHitContainer
TrajectoryMeasurement const & firstMeasurement() const
const int theNumberMeasurementsForFit
virtual const MagneticField * magneticField() const =0
TransientInitialStateEstimator(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
TrajectoryStateOnSurface const & updatedState() const
std::pair< TrajectoryStateOnSurface, const GeomDet * > innerState(const Trajectory &traj, bool doBackFit=true) const
TkClonerImpl theHitCloner
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToken
tuple Chi2MeasurementEstimator