17 thePropagator(aPropagator.
clone()),
18 theUpdator(aUpdator.
clone()),
19 theEstimator(aEstimator.
clone()),
20 theMerger(aMerger.
clone()),
21 theGeometry(detLayerGeometry)
23 if(!theGeometry) theGeometry = &dummyGeometry;
28 GsfTrajectoryFitter::~GsfTrajectoryFitter() {
45 const RecHitContainer& hits, fitType type)
const {
48 <<
"GsfTrajectoryFitter::fit(TrajectorySeed, vector<RecHit>) not implemented";
54 const RecHitContainer& hits,
71 TSOS predTsos(firstPredTsos);
72 if(!predTsos.isValid()) {
74 <<
"GsfTrajectoryFitter: predicted tsos of first measurement not valid!";
79 if(hits.front()->isValid()) {
84 currTsos = updator()->
update(predTsos, *preciseHit);
86 if (!predTsos.isValid() || !currTsos.
isValid()){
90 myTraj.push(TM(predTsos, currTsos, preciseHit, 0., theGeometry->idToLayer(preciseHit->geographicalId() )),
91 estimator()->estimate(predTsos, *preciseHit).second);
94 if (!predTsos.isValid()){
98 myTraj.push(TM(predTsos, *hits.begin(),0., theGeometry->idToLayer((*hits.begin())->geographicalId()) ));
101 for(RecHitContainer::const_iterator ihit = hits.begin() + 1;
102 ihit != hits.end(); ihit++) {
106 if ((**ihit).isValid() ==
false && (**ihit).det() == 0) {
107 LogDebug(
"GsfTrajectoryFitter") <<
" Error: invalid hit with no GeomDet attached .... skipping";
133 if(!predTsos.isValid()) {
134 if ( myTraj.foundHits()>=3 ) {
136 <<
"GsfTrajectoryFitter: predicted tsos not valid! \n"
137 <<
"Returning trajectory with " << myTraj.foundHits() <<
" found hits.";
142 <<
"GsfTrajectoryFitter: predicted tsos not valid after " << myTraj.foundHits()
143 <<
" hits, discarding candidate!";
147 if ( merger() ) predTsos = merger()->merge(predTsos);
149 if((**ihit).isValid()) {
154 currTsos = updator()->
update(predTsos, *preciseHit);
156 if (!predTsos.isValid() || !currTsos.
isValid()){
160 myTraj.push(TM(predTsos, currTsos, preciseHit,
161 estimator()->estimate(predTsos, *preciseHit).
second,
162 theGeometry->idToLayer(preciseHit->geographicalId() )));
165 if (!predTsos.isValid()){
169 myTraj.push(TM(predTsos, *ihit,0., theGeometry->idToLayer( (*ihit)->geographicalId()) ));
bool empty() const
True if trajectory has no measurements.
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
tuple GsfTrajectoryFitter
ConstRecHitContainer recHits(bool splitting=false) const
U second(std::pair< T, U > const &p)
const SurfaceType & surface() const
void update(const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
TrajectoryMeasurement const & firstMeasurement() const