24 thePropagatorAlongName = conf.
getParameter<std::string>(
"propagatorAlongTISE");
25 thePropagatorOppositeName = conf.
getParameter<std::string>(
"propagatorOppositeTISE");
26 theNumberMeasurementsForFit = conf.
getParameter<int32_t>(
"numberMeasurementsForFit");
39 std::pair<TrajectoryStateOnSurface, const GeomDet*>
43 LogDebug(
"TransientInitialStateEstimator")
44 <<
"a backward fit will not be done. assuming that the state on first measurement is OK";
47 return std::pair<TrajectoryStateOnSurface, const GeomDet*>( firstStateFromForward,
51 LogDebug(
"TransientInitialStateEstimator")
52 <<
"told to not do a back fit, but the forward state of the first measurement is not valid. doing a back fit.";
56 int lastFitted = theNumberMeasurementsForFit >=0 ? theNumberMeasurementsForFit : nMeas;
57 if (nMeas-1 < lastFitted) lastFitted = nMeas-1;
59 std::vector<TrajectoryMeasurement> measvec = traj.
measurements();
62 bool foundLast =
false;
65 for (
int i=lastFitted;
i >= 0;
i--) {
66 if(measvec[
i].recHit()->det()){
71 firstHits.push_back( measvec[
i].recHit());
74 TSOS startingState = measvec[actualLast].updatedState();
82 &aChi2MeasurementEstimator,
92 vector<Trajectory> fitres = backFitter.fit( fakeSeed, firstHits, startingState);
94 LogDebug(
"TransientInitialStateEstimator")
95 <<
"using a backward fit of :"<<firstHits.size()<<
" hits, starting from:\n"<<startingState
96 <<
" to get the estimate of the initial state of the track.";
98 if (fitres.size() != 1) {
99 LogDebug(
"TransientInitialStateEstimator")
100 <<
"FitTester: first hits fit failed!";
101 return std::pair<TrajectoryStateOnSurface, const GeomDet*>();
108 thePropagatorAlong->magneticField());
116 LogDebug(
"TransientInitialStateEstimator")
117 <<
"the initial state is found to be:\n:"<<firstState
118 <<
"\n it's field pointer is: "<<firstState.magneticField()
122 return std::pair<TrajectoryStateOnSurface, const GeomDet*>( firstState,
123 firstMeas.
recHit()->det());
void rescaleError(double factor)
TransientInitialStateEstimator(const edm::EventSetup &es, const edm::ParameterSet &conf)
T getParameter(std::string const &) const
void setEventSetup(const edm::EventSetup &es)
Call this at each event until this object will come from the EventSetup as it should.
const LocalTrajectoryParameters & localParameters() const
TrajectoryStateOnSurface forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
ConstRecHitPointer recHit() const
const MagneticField * magneticField() const
PropagationDirection const & direction() const
DataContainer const & measurements() const
TrajectoryStateOnSurface updatedState() const
const LocalTrajectoryError & localError() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
TrajectoryMeasurement const & firstMeasurement() const
const Surface & surface() const
std::pair< TrajectoryStateOnSurface, const GeomDet * > innerState(const Trajectory &traj, bool doBackFit=true) const