#include <GsfTrajectoryFitter.h>
A GSF fitter, similar to KFTrajectoryFitter.
Definition at line 20 of file GsfTrajectoryFitter.h.
typedef TrajectoryMeasurement GsfTrajectoryFitter::TM [private] |
Definition at line 24 of file GsfTrajectoryFitter.h.
typedef TrajectoryStateOnSurface GsfTrajectoryFitter::TSOS [private] |
Definition at line 23 of file GsfTrajectoryFitter.h.
GsfTrajectoryFitter::GsfTrajectoryFitter | ( | const Propagator & | aPropagator, |
const TrajectoryStateUpdator & | aUpdator, | ||
const MeasurementEstimator & | aEstimator, | ||
const MultiTrajectoryStateMerger & | aMerger, | ||
const DetLayerGeometry * | detLayerGeometry = 0 |
||
) |
Constructor with explicit components for propagation, update, chi2 calculation, merging and flag for merging before / after the update (i.e. fully configured)
Definition at line 12 of file GsfTrajectoryFitter.cc.
References dummyGeometry, and theGeometry.
Referenced by clone().
: thePropagator(aPropagator.clone()), theUpdator(aUpdator.clone()), theEstimator(aEstimator.clone()), theMerger(aMerger.clone()), theGeometry(detLayerGeometry) { if(!theGeometry) theGeometry = &dummyGeometry; // static SimpleConfigurable<bool> timeConf(false,"GsfTrajectoryFitter:activateTiming"); // theTiming = timeConf.value(); }
GsfTrajectoryFitter::~GsfTrajectoryFitter | ( | ) | [virtual] |
Definition at line 28 of file GsfTrajectoryFitter.cc.
References theEstimator, theMerger, thePropagator, and theUpdator.
{ delete thePropagator; delete theUpdator; delete theEstimator; delete theMerger; }
virtual GsfTrajectoryFitter* GsfTrajectoryFitter::clone | ( | void | ) | const [inline, virtual] |
Implements TrajectoryFitter.
Definition at line 51 of file GsfTrajectoryFitter.h.
References GsfTrajectoryFitter(), theEstimator, theGeometry, theMerger, thePropagator, and theUpdator.
{ return new GsfTrajectoryFitter(*thePropagator,*theUpdator,*theEstimator,*theMerger,theGeometry); }
const MeasurementEstimator* GsfTrajectoryFitter::estimator | ( | void | ) | const [inline] |
Definition at line 48 of file GsfTrajectoryFitter.h.
References theEstimator.
Referenced by fit().
{return theEstimator;}
std::vector< Trajectory > GsfTrajectoryFitter::fit | ( | const TrajectorySeed & | aSeed, |
const RecHitContainer & | hits | ||
) | const [virtual] |
Implements TrajectoryFitter.
Definition at line 45 of file GsfTrajectoryFitter.cc.
{ edm::LogError("GsfTrajectoryFitter") << "GsfTrajectoryFitter::fit(TrajectorySeed, vector<RecHit>) not implemented"; return std::vector<Trajectory>(); }
std::vector< Trajectory > GsfTrajectoryFitter::fit | ( | const TrajectorySeed & | aSeed, |
const RecHitContainer & | hits, | ||
const TSOS & | firstPredTsos | ||
) | const [virtual] |
!! no invalid hits on cylinders anymore??
Implements TrajectoryFitter.
Definition at line 54 of file GsfTrajectoryFitter.cc.
References MeasurementEstimator::estimate(), estimator(), Trajectory::foundHits(), DetLayerGeometry::idToLayer(), TrajectoryStateOnSurface::isValid(), LogDebug, MultiTrajectoryStateMerger::merge(), merger(), Propagator::propagate(), propagator(), Trajectory::push(), edm::second(), TrajectoryStateOnSurface::surface(), theGeometry, TrajectoryStateUpdator::update(), and updator().
{ // static TimingReport::Item* propTimer = // &(*TimingReport::current())[string("GsfTrajectoryFitter:propagation")]; // propTimer->switchCPU(false); // if ( !theTiming ) propTimer->switchOn(false); // static TimingReport::Item* updateTimer = // &(*TimingReport::current())[string("GsfTrajectoryFitter:update")]; // updateTimer->switchCPU(false); // if ( !theTiming ) updateTimer->switchOn(false); if(hits.empty()) return std::vector<Trajectory>(); Trajectory myTraj(aSeed, propagator()->propagationDirection()); TSOS predTsos(firstPredTsos); if(!predTsos.isValid()) { edm::LogInfo("GsfTrajectoryFitter") << "GsfTrajectoryFitter: predicted tsos of first measurement not valid!"; return std::vector<Trajectory>(); } TSOS currTsos; if(hits.front()->isValid()) { //update TransientTrackingRecHit::RecHitPointer preciseHit = hits.front()->clone(predTsos); { // TimeMe t(*updateTimer,false); currTsos = updator()->update(predTsos, *preciseHit); } if (!predTsos.isValid() || !currTsos.isValid()){ edm::LogError("InvalidState")<<"first hit"; return std::vector<Trajectory>(); } myTraj.push(TM(predTsos, currTsos, preciseHit, 0., theGeometry->idToLayer(preciseHit->geographicalId() )), estimator()->estimate(predTsos, *preciseHit).second); } else { currTsos = predTsos; if (!predTsos.isValid()){ edm::LogError("InvalidState")<<"first invalid hit"; return std::vector<Trajectory>(); } myTraj.push(TM(predTsos, *hits.begin(),0., theGeometry->idToLayer((*hits.begin())->geographicalId()) )); } for(RecHitContainer::const_iterator ihit = hits.begin() + 1; ihit != hits.end(); ihit++) { // // temporary protection copied from KFTrajectoryFitter. // if ((**ihit).isValid() == false && (**ihit).det() == 0) { LogDebug("GsfTrajectoryFitter") << " Error: invalid hit with no GeomDet attached .... skipping"; continue; } // // // // check type of surface in case of invalid hit // // (in this version only propagations to planes are // // supported for multi trajectory states) // // // if ( !(**ihit).isValid() ) { // const BoundPlane* plane = // dynamic_cast<const BoundPlane*>(&(**ihit).det().surface()); // // // // no plane: insert invalid measurement // // // if ( plane==0 ) { // myTraj.push(TM(TrajectoryStateOnSurface(),&(**ihit))); // continue; // } // } { // TimeMe t(*propTimer,false); predTsos = propagator()->propagate(currTsos, (**ihit).det()->surface()); } if(!predTsos.isValid()) { if ( myTraj.foundHits()>=3 ) { edm::LogInfo("GsfTrajectoryFitter") << "GsfTrajectoryFitter: predicted tsos not valid! \n" << "Returning trajectory with " << myTraj.foundHits() << " found hits."; return std::vector<Trajectory>(1,myTraj); } else { edm::LogInfo("GsfTrajectoryFitter") << "GsfTrajectoryFitter: predicted tsos not valid after " << myTraj.foundHits() << " hits, discarding candidate!"; return std::vector<Trajectory>(); } } if ( merger() ) predTsos = merger()->merge(predTsos); if((**ihit).isValid()) { //update TransientTrackingRecHit::RecHitPointer preciseHit = (**ihit).clone(predTsos); { // TimeMe t(*updateTimer,false); currTsos = updator()->update(predTsos, *preciseHit); } if (!predTsos.isValid() || !currTsos.isValid()){ edm::LogError("InvalidState")<<"inside hit"; return std::vector<Trajectory>(); } myTraj.push(TM(predTsos, currTsos, preciseHit, estimator()->estimate(predTsos, *preciseHit).second, theGeometry->idToLayer(preciseHit->geographicalId() ))); } else { currTsos = predTsos; if (!predTsos.isValid()){ edm::LogError("InvalidState")<<"inside invalid hit"; return std::vector<Trajectory>(); } myTraj.push(TM(predTsos, *ihit,0., theGeometry->idToLayer( (*ihit)->geographicalId()) )); } } return std::vector<Trajectory>(1, myTraj); }
std::vector< Trajectory > GsfTrajectoryFitter::fit | ( | const Trajectory & | aTraj | ) | const [virtual] |
Implements TrajectoryFitter.
Definition at line 35 of file GsfTrajectoryFitter.cc.
References Trajectory::empty(), Trajectory::firstMeasurement(), Trajectory::recHits(), Trajectory::seed(), and TrajectoryMeasurement::updatedState().
{ if(aTraj.empty()) return std::vector<Trajectory>(); TM firstTM = aTraj.firstMeasurement(); TSOS firstTsos = TrajectoryStateWithArbitraryError()(firstTM.updatedState()); return fit(aTraj.seed(), aTraj.recHits(), firstTsos); }
const MultiTrajectoryStateMerger* GsfTrajectoryFitter::merger | ( | ) | const [inline] |
Definition at line 49 of file GsfTrajectoryFitter.h.
References theMerger.
Referenced by fit().
{return theMerger;}
const Propagator* GsfTrajectoryFitter::propagator | ( | void | ) | const [inline] |
Definition at line 46 of file GsfTrajectoryFitter.h.
References thePropagator.
Referenced by fit().
{return thePropagator;}
const TrajectoryStateUpdator* GsfTrajectoryFitter::updator | ( | ) | const [inline] |
Definition at line 47 of file GsfTrajectoryFitter.h.
References theUpdator.
Referenced by fit().
{return theUpdator;}
const DetLayerGeometry GsfTrajectoryFitter::dummyGeometry [private] |
Definition at line 61 of file GsfTrajectoryFitter.h.
Referenced by GsfTrajectoryFitter().
const MeasurementEstimator* GsfTrajectoryFitter::theEstimator [private] |
Definition at line 59 of file GsfTrajectoryFitter.h.
Referenced by clone(), estimator(), and ~GsfTrajectoryFitter().
const DetLayerGeometry* GsfTrajectoryFitter::theGeometry [private] |
Definition at line 62 of file GsfTrajectoryFitter.h.
Referenced by clone(), fit(), and GsfTrajectoryFitter().
const MultiTrajectoryStateMerger* GsfTrajectoryFitter::theMerger [private] |
Definition at line 60 of file GsfTrajectoryFitter.h.
Referenced by clone(), merger(), and ~GsfTrajectoryFitter().
const Propagator* GsfTrajectoryFitter::thePropagator [private] |
Definition at line 57 of file GsfTrajectoryFitter.h.
Referenced by clone(), propagator(), and ~GsfTrajectoryFitter().
bool GsfTrajectoryFitter::theTiming [private] |
Definition at line 64 of file GsfTrajectoryFitter.h.
const TrajectoryStateUpdator* GsfTrajectoryFitter::theUpdator [private] |
Definition at line 58 of file GsfTrajectoryFitter.h.
Referenced by clone(), updator(), and ~GsfTrajectoryFitter().