CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
BaseCkfTrajectoryBuilder Class Referenceabstract

#include <BaseCkfTrajectoryBuilder.h>

Inheritance diagram for BaseCkfTrajectoryBuilder:
TrajectoryBuilder CkfTrajectoryBuilder GroupedCkfTrajectoryBuilder CkfDebugTrajectoryBuilder MuonCkfTrajectoryBuilder

Public Types

typedef std::vector< TempTrajectoryTempTrajectoryContainer
 
typedef std::vector< TrajectoryTrajectoryContainer
 
typedef TrajectoryContainer::iterator TrajectoryIterator
 
- Public Types inherited from TrajectoryBuilder
typedef std::vector< TrajectoryTrajectoryContainer
 
typedef TrajectoryContainer::iterator TrajectoryIterator
 

Public Member Functions

 BaseCkfTrajectoryBuilder (const edm::ParameterSet &conf, std::unique_ptr< TrajectoryFilter > filter, std::unique_ptr< TrajectoryFilter > inOutFilter=0)
 
 BaseCkfTrajectoryBuilder (const BaseCkfTrajectoryBuilder &)=delete
 
virtual TempTrajectory buildTrajectories (const TrajectorySeed &seed, TrajectoryContainer &ret, unsigned int &nCandPerSeed, const TrajectoryFilter *) const
 
const TransientTrackingRecHitBuilderhitBuilder () const
 
BaseCkfTrajectoryBuilderoperator= (const BaseCkfTrajectoryBuilder &)=delete
 
virtual void rebuildTrajectories (TempTrajectory const &startingTraj, const TrajectorySeed &seed, TrajectoryContainer &result) const
 
virtual void setDebugger (CkfDebugger *dbg) const
 
void setEvent (const edm::Event &event) const override
 
void setEvent (const edm::Event &iEvent, const edm::EventSetup &iSetup, const MeasurementTrackerEvent *data)
 
void setNavigationSchool (NavigationSchool const *nv)
 
void unset () const override
 
 ~BaseCkfTrajectoryBuilder () override
 
- Public Member Functions inherited from TrajectoryBuilder
virtual void rebuildSeedingRegion (const TrajectorySeed &, TrajectoryContainer &result) const
 
virtual TrajectoryContainer trajectories (const TrajectorySeed &) const =0
 
virtual void trajectories (const TrajectorySeed &seed, TrajectoryContainer &out) const
 
virtual ~TrajectoryBuilder ()
 

Protected Types

typedef TrackingComponentsRecord Chi2MeasurementEstimatorRecord
 
typedef FreeTrajectoryState FTS
 
typedef std::pair< TSOS, std::vector< const DetLayer * > > StateAndLayers
 
typedef TrajectoryMeasurement TM
 
typedef TrajectoryStateOnSurface TSOS
 

Protected Member Functions

void addToResult (boost::shared_ptr< const TrajectorySeed > const &seed, TempTrajectory &traj, TrajectoryContainer &result, bool inOut=false) const
 
void addToResult (TempTrajectory const &traj, TempTrajectoryContainer &result, bool inOut=false) const
 
virtual bool analyzeMeasurementsDebugger (Trajectory &traj, const std::vector< TrajectoryMeasurement > &meas, const MeasurementTrackerEvent *theMeasurementTracker, const Propagator *theForwardPropagator, const Chi2MeasurementEstimatorBase *theEstimator, const TransientTrackingRecHitBuilder *theTTRHBuilder) const
 
virtual bool analyzeMeasurementsDebugger (TempTrajectory &traj, const std::vector< TrajectoryMeasurement > &meas, const MeasurementTrackerEvent *theMeasurementTracker, const Propagator *theForwardPropagator, const Chi2MeasurementEstimatorBase *theEstimator, const TransientTrackingRecHitBuilder *theTTRHBuilder) const
 
const PropagatorbackwardPropagator (const TrajectorySeed &seed) const
 
TempTrajectory createStartingTrajectory (const TrajectorySeed &seed) const
 
virtual void fillSeedHistoDebugger (std::vector< TrajectoryMeasurement >::iterator begin, std::vector< TrajectoryMeasurement >::iterator end) const
 
StateAndLayers findStateAndLayers (const TrajectorySeed &seed, const TempTrajectory &traj) const
 
const PropagatorforwardPropagator (const TrajectorySeed &seed) const
 
void moveToResult (TempTrajectory &&traj, TempTrajectoryContainer &result, bool inOut=false) const
 
bool qualityFilter (const TempTrajectory &traj, bool inOut=false) const
 
void setData (const MeasurementTrackerEvent *data)
 
virtual void setEvent_ (const edm::Event &iEvent, const edm::EventSetup &iSetup)=0
 
bool toBeContinued (TempTrajectory &traj, bool inOut=false) const
 

Static Protected Member Functions

static std::unique_ptr< TrajectoryFiltercreateTrajectoryFilter (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 

Protected Attributes

const Chi2MeasurementEstimatorBasetheEstimator
 
const MeasurementTrackerEventtheMeasurementTracker
 
const NavigationSchooltheNavigationSchool = 0
 
const PropagatorthePropagatorAlong
 
const PropagatorthePropagatorOpposite
 
const TransientTrackingRecHitBuildertheTTRHBuilder
 
const TrajectoryStateUpdatortheUpdator
 

Private Member Functions

void seedMeasurements (const TrajectorySeed &seed, TempTrajectory &result) const
 

Private Attributes

const std::string theEstimatorName
 
std::unique_ptr< TrajectoryFiltertheFilter
 
std::unique_ptr< TrajectoryFiltertheInOutFilter
 
const std::string thePropagatorAlongName
 
const std::string thePropagatorOppositeName
 
const std::string theRecHitBuilderName
 
const std::string theUpdatorName
 

Detailed Description

The component of track reconstruction that, strating from a seed, reconstructs all possible trajectories. The resulting trajectories may be mutually exclusive and require cleaning by a TrajectoryCleaner. The Trajectories are normally not smoothed.

Definition at line 53 of file BaseCkfTrajectoryBuilder.h.

Member Typedef Documentation

Definition at line 155 of file BaseCkfTrajectoryBuilder.h.

Definition at line 56 of file BaseCkfTrajectoryBuilder.h.

typedef std::pair<TSOS,std::vector<const DetLayer*> > BaseCkfTrajectoryBuilder::StateAndLayers
protected

Definition at line 59 of file BaseCkfTrajectoryBuilder.h.

Definition at line 64 of file BaseCkfTrajectoryBuilder.h.

Definition at line 58 of file BaseCkfTrajectoryBuilder.h.

Definition at line 63 of file BaseCkfTrajectoryBuilder.h.

typedef TrajectoryContainer::iterator BaseCkfTrajectoryBuilder::TrajectoryIterator

Definition at line 65 of file BaseCkfTrajectoryBuilder.h.

Definition at line 57 of file BaseCkfTrajectoryBuilder.h.

Constructor & Destructor Documentation

BaseCkfTrajectoryBuilder::BaseCkfTrajectoryBuilder ( const edm::ParameterSet conf,
std::unique_ptr< TrajectoryFilter filter,
std::unique_ptr< TrajectoryFilter inOutFilter = 0 
)

Definition at line 28 of file BaseCkfTrajectoryBuilder.cc.

References edm::ParameterSet::exists().

30  :
31  theUpdator(nullptr),
32  thePropagatorAlong(nullptr),
33  thePropagatorOpposite(nullptr),
34  theEstimator(nullptr),
35  theTTRHBuilder(nullptr),
36  theMeasurementTracker(nullptr),
38  theInOutFilter(std::move(inOutFilter)),
39  theUpdatorName(conf.getParameter<std::string>("updator")),
40  thePropagatorAlongName(conf.getParameter<std::string>("propagatorAlong")),
41  thePropagatorOppositeName(conf.getParameter<std::string>("propagatorOpposite")),
42  theEstimatorName(conf.getParameter<std::string>("estimator")),
43  theRecHitBuilderName(conf.getParameter<std::string>("TTRHBuilder"))
44 {
45  if (conf.exists("clustersToSkip")) edm::LogError("BaseCkfTrajectoryBuilder") << "ERROR: " << typeid(*this).name() << " has a clustersToSkip parameter set";
46 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
const TrajectoryStateUpdator * theUpdator
const TransientTrackingRecHitBuilder * theTTRHBuilder
std::unique_ptr< TrajectoryFilter > theInOutFilter
const std::string thePropagatorAlongName
const MeasurementTrackerEvent * theMeasurementTracker
const Propagator * thePropagatorOpposite
def move(src, dest)
Definition: eostools.py:511
const std::string thePropagatorOppositeName
const Chi2MeasurementEstimatorBase * theEstimator
std::unique_ptr< TrajectoryFilter > theFilter
BaseCkfTrajectoryBuilder::BaseCkfTrajectoryBuilder ( const BaseCkfTrajectoryBuilder )
delete
BaseCkfTrajectoryBuilder::~BaseCkfTrajectoryBuilder ( )
override

Definition at line 49 of file BaseCkfTrajectoryBuilder.cc.

49  {
50 }

Member Function Documentation

void BaseCkfTrajectoryBuilder::addToResult ( boost::shared_ptr< const TrajectorySeed > const &  seed,
TempTrajectory traj,
TrajectoryContainer result,
bool  inOut = false 
) const
protected

Definition at line 160 of file BaseCkfTrajectoryBuilder.cc.

References Trajectory::empty(), Trajectory::foundHits(), Trajectory::lastMeasurement(), LogDebug, Trajectory::lostHits(), Trajectory::measurements(), TempTrajectory::measurements(), eostools::move(), Trajectory::pop(), qualityFilter(), TrajectoryMeasurement::recHit(), Trajectory::setSharedSeed(), cmsutils::bqueue< T >::size(), and TempTrajectory::toTrajectory().

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), and CkfTrajectoryBuilder::limitedCandidates().

163 {
164  // quality check
165  if ( !qualityFilter(tmptraj, inOut) ) return;
166  Trajectory traj = tmptraj.toTrajectory();
167  traj.setSharedSeed(seed);
168  // discard latest dummy measurements
169  while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid()) traj.pop();
170  LogDebug("CkfPattern")<<inOut<<"=inOut option. pushing a Trajectory with: "<<traj.foundHits()<<" found hits. "<<traj.lostHits()
171  <<" lost hits. Popped :"<<(tmptraj.measurements().size())-(traj.measurements().size())<<" hits.";
172  result.push_back(std::move(traj));
173 }
#define LogDebug(id)
bool empty() const
True if trajectory has no measurements.
Definition: Trajectory.h:254
int foundHits() const
Definition: Trajectory.h:225
int lostHits() const
Definition: Trajectory.h:236
ConstRecHitPointer const & recHit() const
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
DataContainer const & measurements() const
Definition: Trajectory.h:196
Trajectory toTrajectory() const
Convert to a standard Trajectory.
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:174
void setSharedSeed(const boost::shared_ptr< const TrajectorySeed > &seed)
Definition: Trajectory.h:334
void pop()
Definition: Trajectory.cc:29
def move(src, dest)
Definition: eostools.py:511
void BaseCkfTrajectoryBuilder::addToResult ( TempTrajectory const &  traj,
TempTrajectoryContainer result,
bool  inOut = false 
) const
protected

Definition at line 177 of file BaseCkfTrajectoryBuilder.cc.

References TempTrajectory::empty(), TempTrajectory::foundHits(), TempTrajectory::lastMeasurement(), LogDebug, TempTrajectory::lostHits(), TempTrajectory::measurements(), eostools::move(), TempTrajectory::pop(), qualityFilter(), TrajectoryMeasurement::recHit(), and cmsutils::bqueue< T >::size().

180 {
181  // quality check
182  if ( !qualityFilter(tmptraj, inOut) ) return;
183  // discard latest dummy measurements
184  TempTrajectory traj = tmptraj;
185  while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid()) traj.pop();
186  LogDebug("CkfPattern")<<inOut<<"=inOut option. pushing a TempTrajectory with: "<<traj.foundHits()<<" found hits. "<<traj.lostHits()
187  <<" lost hits. Popped :"<<(tmptraj.measurements().size())-(traj.measurements().size())<<" hits.";
188  result.push_back(std::move(traj));
189 }
#define LogDebug(id)
ConstRecHitPointer const & recHit() const
bool empty() const
True if trajectory has no measurements.
const DataContainer & measurements() const
int foundHits() const
const TrajectoryMeasurement & lastMeasurement() const
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
size_type size() const
Definition: bqueue.h:167
def move(src, dest)
Definition: eostools.py:511
int lostHits() const
virtual bool BaseCkfTrajectoryBuilder::analyzeMeasurementsDebugger ( Trajectory traj,
const std::vector< TrajectoryMeasurement > &  meas,
const MeasurementTrackerEvent theMeasurementTracker,
const Propagator theForwardPropagator,
const Chi2MeasurementEstimatorBase theEstimator,
const TransientTrackingRecHitBuilder theTTRHBuilder 
) const
inlineprotectedvirtual

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 110 of file BaseCkfTrajectoryBuilder.h.

Referenced by CkfTrajectoryBuilder::limitedCandidates().

114  {return true;}
virtual bool BaseCkfTrajectoryBuilder::analyzeMeasurementsDebugger ( TempTrajectory traj,
const std::vector< TrajectoryMeasurement > &  meas,
const MeasurementTrackerEvent theMeasurementTracker,
const Propagator theForwardPropagator,
const Chi2MeasurementEstimatorBase theEstimator,
const TransientTrackingRecHitBuilder theTTRHBuilder 
) const
inlineprotectedvirtual

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 115 of file BaseCkfTrajectoryBuilder.h.

119  {return true;}
const Propagator* BaseCkfTrajectoryBuilder::backwardPropagator ( const TrajectorySeed seed) const
inlineprotected
virtual TempTrajectory BaseCkfTrajectoryBuilder::buildTrajectories ( const TrajectorySeed seed,
TrajectoryContainer ret,
unsigned int &  nCandPerSeed,
const TrajectoryFilter  
) const
inlinevirtual
TempTrajectory BaseCkfTrajectoryBuilder::createStartingTrajectory ( const TrajectorySeed seed) const
protected

Definition at line 112 of file BaseCkfTrajectoryBuilder.cc.

References TrajectorySeed::direction(), PrintoutHelper::dumpCandidate(), LogDebug, TrajectorySeed::nHits(), mps_fire::result, and seedMeasurements().

Referenced by GroupedCkfTrajectoryBuilder::buildTrajectories(), CkfTrajectoryBuilder::buildTrajectories(), GroupedCkfTrajectoryBuilder::rebuildSeedingRegion(), and seedMeasurements().

113 {
114  TempTrajectory result(seed.direction(),seed.nHits());
115  seedMeasurements(seed, result);
116 
117  LogDebug("CkfPattern")
118  <<" initial trajectory from the seed: "<<PrintoutHelper::dumpCandidate(result,true);
119 
120  return result;
121 }
#define LogDebug(id)
PropagationDirection direction() const
void seedMeasurements(const TrajectorySeed &seed, TempTrajectory &result) const
static std::string dumpCandidate(const Candidate &candidate, bool showErrors=false)
unsigned int nHits() const
std::unique_ptr< TrajectoryFilter > BaseCkfTrajectoryBuilder::createTrajectoryFilter ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)
staticprotected

Definition at line 52 of file BaseCkfTrajectoryBuilder.cc.

References reco::get(), edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

52  {
53  return std::unique_ptr<TrajectoryFilter>{TrajectoryFilterFactory::get()->create(pset.getParameter<std::string>("ComponentType"), pset, iC)};
54 }
T getParameter(std::string const &) const
T get(const Candidate &c)
Definition: component.h:55
virtual void BaseCkfTrajectoryBuilder::fillSeedHistoDebugger ( std::vector< TrajectoryMeasurement >::iterator  begin,
std::vector< TrajectoryMeasurement >::iterator  end 
) const
inlineprotectedvirtual

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 120 of file BaseCkfTrajectoryBuilder.h.

References mps_fire::result, and SurveyInfoScenario_cff::seed.

121  {;}
BaseCkfTrajectoryBuilder::StateAndLayers BaseCkfTrajectoryBuilder::findStateAndLayers ( const TrajectorySeed seed,
const TempTrajectory traj 
) const
protected

Definition at line 208 of file BaseCkfTrajectoryBuilder.cc.

References PTrajectoryStateOnDet::detId(), GeometricSearchTracker::detLayer(), TempTrajectory::direction(), TempTrajectory::empty(), forwardPropagator(), TrajectoryStateOnSurface::freeState(), g, MeasurementTrackerEvent::geometricSearchTracker(), MeasurementTrackerEvent::geomTracker(), triggerObjects_cff::id, TrackingGeometry::idToDet(), TempTrajectory::lastLayer(), TempTrajectory::lastMeasurement(), seedCreatorFromRegionConsecutiveHitsEDProducer_cff::magneticField, NavigationSchool::nextLayers(), TrajectorySeed::startingState(), theMeasurementTracker, theNavigationSchool, trajectoryStateTransform::transientState(), and TrajectoryMeasurement::updatedState().

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), and CkfTrajectoryBuilder::findCompatibleMeasurements().

209 {
210  if (traj.empty())
211  {
212  //set the currentState to be the one from the trajectory seed starting point
213  PTrajectoryStateOnDet const & ptod = seed.startingState();
214  DetId id(ptod.detId());
216  const Surface * surface=&g->surface();
217 
218 
221  return StateAndLayers(currentState,theNavigationSchool->nextLayers(*lastLayer,*currentState.freeState(), traj.direction()) );
222  }
223  else
224  {
225  TSOS const & currentState = traj.lastMeasurement().updatedState();
226  return StateAndLayers(currentState,theNavigationSchool->nextLayers(*traj.lastLayer(), *currentState.freeState(), traj.direction()) );
227  }
228 }
const TrackingGeometry * geomTracker() const
bool empty() const
True if trajectory has no measurements.
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
virtual const GeomDet * idToDet(DetId) const =0
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
const TrajectoryMeasurement & lastMeasurement() const
PropagationDirection direction() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
unsigned int detId() const
const MeasurementTrackerEvent * theMeasurementTracker
Definition: DetId.h:18
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&...args) const
NavigationDirection.
std::pair< TSOS, std::vector< const DetLayer * > > StateAndLayers
const NavigationSchool * theNavigationSchool
TrajectoryStateOnSurface const & updatedState() const
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
const GeometricSearchTracker * geometricSearchTracker() const
const Propagator* BaseCkfTrajectoryBuilder::forwardPropagator ( const TrajectorySeed seed) const
inlineprotected
const TransientTrackingRecHitBuilder* BaseCkfTrajectoryBuilder::hitBuilder ( ) const
inline

Maximum number of lost hits per trajectory candidate. Maximum number of consecutive lost hits per trajectory candidate.

Definition at line 102 of file BaseCkfTrajectoryBuilder.h.

References muonDTDigis_cfi::pset.

Referenced by GroupedCkfTrajectoryBuilder::rebuildSeedingRegion(), ConversionTrackFinder::setEventSetup(), InOutConversionTrackFinder::tracks(), and OutInConversionTrackFinder::tracks().

102 { return theTTRHBuilder;}
const TransientTrackingRecHitBuilder * theTTRHBuilder
void BaseCkfTrajectoryBuilder::moveToResult ( TempTrajectory &&  traj,
TempTrajectoryContainer result,
bool  inOut = false 
) const
protected

Definition at line 192 of file BaseCkfTrajectoryBuilder.cc.

References LogDebug, eostools::move(), and qualityFilter().

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer().

195 {
196  // quality check
197  if ( !qualityFilter(traj, inOut) ) return;
198  // discard latest dummy measurements
199  while (!traj.empty() && !traj.lastMeasurement().recHitR().isValid()) traj.pop();
200  LogDebug("CkfPattern")<<inOut<<"=inOut option. pushing a TempTrajectory with: "<<traj.foundHits()<<" found hits. "<<traj.lostHits();
201  // <<" lost hits. Popped :"<<(ttraj.measurements().size())-(traj.measurements().size())<<" hits.";
202  result.push_back(std::move(traj));
203 }
#define LogDebug(id)
bool empty() const
True if trajectory has no measurements.
int foundHits() const
const TrajectoryMeasurement & lastMeasurement() const
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
ConstRecHitPointer::element_type const & recHitR() const
def move(src, dest)
Definition: eostools.py:511
int lostHits() const
BaseCkfTrajectoryBuilder& BaseCkfTrajectoryBuilder::operator= ( const BaseCkfTrajectoryBuilder )
delete
bool BaseCkfTrajectoryBuilder::qualityFilter ( const TempTrajectory traj,
bool  inOut = false 
) const
protected

Called at end of track building, to see if track should be kept

Definition at line 146 of file BaseCkfTrajectoryBuilder.cc.

References theFilter, and theInOutFilter.

Referenced by addToResult(), and moveToResult().

147 {
148  // Called after building a trajectory is completed, to see if it is good enough
149  // to keep.
150  if (inOut) {
151  // if (theInOutFilter == 0) edm::LogError("CkfPattern") << "CkfTrajectoryBuilder error: trying to use dedicated filter for in-out tracking phase, when none specified";
152  return theInOutFilter->qualityFilter(traj);
153  } else {
154  return theFilter->qualityFilter(traj);
155  }
156 }
std::unique_ptr< TrajectoryFilter > theInOutFilter
std::unique_ptr< TrajectoryFilter > theFilter
virtual void BaseCkfTrajectoryBuilder::rebuildTrajectories ( TempTrajectory const &  startingTraj,
const TrajectorySeed seed,
TrajectoryContainer result 
) const
inlinevirtual

Reimplemented in GroupedCkfTrajectoryBuilder, and CkfTrajectoryBuilder.

Definition at line 82 of file BaseCkfTrajectoryBuilder.h.

Referenced by GroupedCkfTrajectoryBuilder::~GroupedCkfTrajectoryBuilder().

83  { assert(0==1);}
void BaseCkfTrajectoryBuilder::seedMeasurements ( const TrajectorySeed seed,
TempTrajectory result 
) const
private

Definition at line 57 of file BaseCkfTrajectoryBuilder.cc.

References backwardPropagator(), createStartingTrajectory(), GeometricSearchTracker::detLayer(), TempTrajectory::emplace(), forwardPropagator(), MeasurementTrackerEvent::geometricSearchTracker(), MeasurementTrackerEvent::geomTracker(), TrackingGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), Propagator::magneticField(), Propagator::propagate(), rpcPointValidation_cfi::recHit, TrajectorySeed::recHits(), TrajectorySeed::startingState(), GeomDet::surface(), theMeasurementTracker, theUpdator, trajectoryStateTransform::transientState(), UNLIKELY, and TrajectoryStateUpdator::update().

Referenced by createStartingTrajectory().

58 {
59 
60 
61  TrajectorySeed::range hitRange = seed.recHits();
62 
63  PTrajectoryStateOnDet pState( seed.startingState());
64  const GeomDet* gdet = theMeasurementTracker->geomTracker()->idToDet(pState.detId());
65  TSOS outerState = trajectoryStateTransform::transientState(pState, &(gdet->surface()),
67 
68 
69  for (TrajectorySeed::const_iterator ihit = hitRange.first; ihit != hitRange.second; ihit++) {
70 
71  TrackingRecHit::RecHitPointer recHit = ihit->cloneSH();
72  const GeomDet* hitGeomDet = recHit->det();
73 
74  const DetLayer* hitLayer =
75  theMeasurementTracker->geometricSearchTracker()->detLayer(ihit->geographicalId());
76 
77  TSOS invalidState( hitGeomDet->surface());
78  if (ihit == hitRange.second - 1) {
79  // the seed trajectory state should correspond to this hit
80  if (&gdet->surface() != &hitGeomDet->surface()) {
81  edm::LogError("CkfPattern") << "CkfTrajectoryBuilder error: the seed state is not on the surface of the detector of the last seed hit";
82  return; // FIXME: should throw exception
83  }
84 
85  //TSOS updatedState = outerstate;
86  result.emplace(invalidState, outerState, recHit, 0, hitLayer);
87  }
88  else {
89  TSOS innerState = backwardPropagator(seed)->propagate(outerState,hitGeomDet->surface());
90 
91  // try to recover if propagation failed
92  if UNLIKELY(!innerState.isValid())
93  innerState =
94  trajectoryStateTransform::transientState(pState, &(hitGeomDet->surface()),
96 
97  if(innerState.isValid()) {
98  TSOS innerUpdated = theUpdator->update(innerState,*recHit);
99  result.emplace(invalidState, innerUpdated, recHit, 0, hitLayer);
100  }
101  }
102  }
103 
104  // method for debugging
105  // fix somehow
106  // fillSeedHistoDebugger(result.begin(),result.end());
107 
108 }
const TrackingGeometry * geomTracker() const
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
const TrajectoryStateUpdator * theUpdator
virtual const GeomDet * idToDet(DetId) const =0
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
virtual const MagneticField * magneticField() const =0
recHitContainer::const_iterator const_iterator
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
std::pair< const_iterator, const_iterator > range
std::shared_ptr< TrackingRecHit const > RecHitPointer
const MeasurementTrackerEvent * theMeasurementTracker
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
range recHits() const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
void emplace(Args &&...args)
const Propagator * backwardPropagator(const TrajectorySeed &seed) const
#define UNLIKELY(x)
Definition: Likely.h:21
const GeometricSearchTracker * geometricSearchTracker() const
void BaseCkfTrajectoryBuilder::setData ( const MeasurementTrackerEvent data)
protected

Definition at line 230 of file BaseCkfTrajectoryBuilder.cc.

References data, and theMeasurementTracker.

Referenced by setEvent().

231 {
232  // possibly do some sanity check here
234 }
const MeasurementTrackerEvent * theMeasurementTracker
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual void BaseCkfTrajectoryBuilder::setDebugger ( CkfDebugger dbg) const
inlinevirtual

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 93 of file BaseCkfTrajectoryBuilder.h.

93 {;}
void BaseCkfTrajectoryBuilder::setEvent ( const edm::Event event) const
overridevirtual

Implements TrajectoryBuilder.

Definition at line 236 of file BaseCkfTrajectoryBuilder.cc.

References MessageLogger_cfi::cerr, and theMeasurementTracker.

237 {
238  std::cerr << "ERROR SetEvent called on " << typeid(*this).name() << ( theMeasurementTracker ? " with valid " : "witout any ") << "MeasurementTrackerEvent" << std::endl;
239 }
const MeasurementTrackerEvent * theMeasurementTracker
void BaseCkfTrajectoryBuilder::setEvent ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const MeasurementTrackerEvent data 
)

Definition at line 246 of file BaseCkfTrajectoryBuilder.cc.

References edm::EventSetup::get(), edm::ESHandle< T >::product(), setData(), setEvent_(), theEstimator, theEstimatorName, theFilter, theInOutFilter, thePropagatorAlong, thePropagatorAlongName, thePropagatorOpposite, thePropagatorOppositeName, theRecHitBuilderName, theTTRHBuilder, theUpdator, and theUpdatorName.

246  {
248  edm::ESHandle<Propagator> propagatorAlongHandle;
249  edm::ESHandle<Propagator> propagatorOppositeHandle;
252 
253  iSetup.get<TrackingComponentsRecord>().get(theUpdatorName, updatorHandle);
254  iSetup.get<TrackingComponentsRecord>().get(thePropagatorAlongName, propagatorAlongHandle);
255  iSetup.get<TrackingComponentsRecord>().get(thePropagatorOppositeName, propagatorOppositeHandle);
256  iSetup.get<TrackingComponentsRecord>().get(theEstimatorName, estimatorHandle);
257  iSetup.get<TransientRecHitRecord>().get(theRecHitBuilderName, recHitBuilderHandle);
258 
259  theUpdator = updatorHandle.product();
260  thePropagatorAlong = propagatorAlongHandle.product();
261  thePropagatorOpposite = propagatorOppositeHandle.product();
262  theEstimator = estimatorHandle.product();
263  theTTRHBuilder = recHitBuilderHandle.product();
264 
265  setData(data);
266  if(theFilter) theFilter->setEvent(iEvent, iSetup);
267  if(theInOutFilter) theInOutFilter->setEvent(iEvent, iSetup);
268  setEvent_(iEvent, iSetup);
269 }
void setData(const MeasurementTrackerEvent *data)
const TrajectoryStateUpdator * theUpdator
virtual void setEvent_(const edm::Event &iEvent, const edm::EventSetup &iSetup)=0
const TransientTrackingRecHitBuilder * theTTRHBuilder
std::unique_ptr< TrajectoryFilter > theInOutFilter
const std::string thePropagatorAlongName
const Propagator * thePropagatorOpposite
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
const std::string thePropagatorOppositeName
const Chi2MeasurementEstimatorBase * theEstimator
std::unique_ptr< TrajectoryFilter > theFilter
virtual void BaseCkfTrajectoryBuilder::setEvent_ ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
protectedpure virtual
void BaseCkfTrajectoryBuilder::setNavigationSchool ( NavigationSchool const *  nv)
inline

Definition at line 86 of file BaseCkfTrajectoryBuilder.h.

References data, and iEvent.

const NavigationSchool * theNavigationSchool
bool BaseCkfTrajectoryBuilder::toBeContinued ( TempTrajectory traj,
bool  inOut = false 
) const
protected

Called after each new hit is added to the trajectory, to see if building this track should be continued

Definition at line 124 of file BaseCkfTrajectoryBuilder.cc.

References TempTrajectory::foundHits(), TempTrajectory::lastLayer(), TempTrajectory::lastMeasurement(), LogTrace, TempTrajectory::lostHits(), TempTrajectory::measurements(), TrajectoryMeasurement::predictedState(), cmsutils::bqueue< T >::size(), DetLayer::subDetector(), theFilter, theInOutFilter, and UNLIKELY.

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), and CkfTrajectoryBuilder::limitedCandidates().

125 {
126  if UNLIKELY(traj.measurements().size() > 400) {
127  edm::LogError("BaseCkfTrajectoryBuilder_InfiniteLoop");
128  LogTrace("BaseCkfTrajectoryBuilder_InfiniteLoop") <<
129  "Cropping Track After 400 Measurements:\n" <<
130  " Last predicted state: " << traj.lastMeasurement().predictedState() << "\n" <<
131  " Last layer subdetector: " << (traj.lastLayer() ? traj.lastLayer()->subDetector() : -1) << "\n" <<
132  " Found hits: " << traj.foundHits() << ", lost hits: " << traj.lostHits() << "\n\n";
133  return false;
134  }
135  // Called after each new hit is added to the trajectory, to see if it is
136  // worth continuing to build this track candidate.
137  if (inOut) {
138  // if (theInOutFilter == 0) edm::LogError("CkfPattern") << "CkfTrajectoryBuilder error: trying to use dedicated filter for in-out tracking phase, when none specified";
139  return theInOutFilter->toBeContinued(traj);
140  } else {
141  return theFilter->toBeContinued(traj);
142  }
143 }
TrajectoryStateOnSurface const & predictedState() const
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
const DataContainer & measurements() const
int foundHits() const
const TrajectoryMeasurement & lastMeasurement() const
std::unique_ptr< TrajectoryFilter > theInOutFilter
#define LogTrace(id)
size_type size() const
Definition: bqueue.h:167
#define UNLIKELY(x)
Definition: Likely.h:21
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
std::unique_ptr< TrajectoryFilter > theFilter
int lostHits() const
void BaseCkfTrajectoryBuilder::unset ( ) const
overridevirtual

Reimplemented from TrajectoryBuilder.

Definition at line 241 of file BaseCkfTrajectoryBuilder.cc.

References MessageLogger_cfi::cerr, and theMeasurementTracker.

242 {
243  std::cerr << "ERROR unSet called on " << typeid(*this).name() << ( theMeasurementTracker ? " with valid " : "witout any ") << "MeasurementTrackerEvent" << std::endl;
244 }
const MeasurementTrackerEvent * theMeasurementTracker

Member Data Documentation

const Chi2MeasurementEstimatorBase* BaseCkfTrajectoryBuilder::theEstimator
protected
const std::string BaseCkfTrajectoryBuilder::theEstimatorName
private

Definition at line 182 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

std::unique_ptr<TrajectoryFilter> BaseCkfTrajectoryBuilder::theFilter
private

Definition at line 175 of file BaseCkfTrajectoryBuilder.h.

Referenced by qualityFilter(), setEvent(), and toBeContinued().

std::unique_ptr<TrajectoryFilter> BaseCkfTrajectoryBuilder::theInOutFilter
private

Filter used at end of complete tracking

Definition at line 176 of file BaseCkfTrajectoryBuilder.h.

Referenced by qualityFilter(), setEvent(), and toBeContinued().

const MeasurementTrackerEvent* BaseCkfTrajectoryBuilder::theMeasurementTracker
protected
const NavigationSchool* BaseCkfTrajectoryBuilder::theNavigationSchool = 0
protected
const Propagator* BaseCkfTrajectoryBuilder::thePropagatorAlong
protected

Definition at line 158 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const std::string BaseCkfTrajectoryBuilder::thePropagatorAlongName
private

Definition at line 180 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const Propagator* BaseCkfTrajectoryBuilder::thePropagatorOpposite
protected

Definition at line 159 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const std::string BaseCkfTrajectoryBuilder::thePropagatorOppositeName
private

Definition at line 181 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const std::string BaseCkfTrajectoryBuilder::theRecHitBuilderName
private

Definition at line 183 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const TransientTrackingRecHitBuilder* BaseCkfTrajectoryBuilder::theTTRHBuilder
protected
const TrajectoryStateUpdator* BaseCkfTrajectoryBuilder::theUpdator
protected
const std::string BaseCkfTrajectoryBuilder::theUpdatorName
private

Filter used at end of in-out tracking

Definition at line 179 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().