CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< TempTrajectory
TempTrajectoryContainer
 
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, TrajectoryFilter *filter, TrajectoryFilter *inOutFilter=0)
 
 BaseCkfTrajectoryBuilder (const BaseCkfTrajectoryBuilder &)=delete
 
virtual TempTrajectory buildTrajectories (const TrajectorySeed &seed, TrajectoryContainer &ret, const TrajectoryFilter *) const
 
const
TransientTrackingRecHitBuilder
hitBuilder () const
 
BaseCkfTrajectoryBuilderoperator= (const BaseCkfTrajectoryBuilder &)=delete
 
virtual void rebuildTrajectories (TempTrajectory const &startingTraj, const TrajectorySeed &seed, TrajectoryContainer &result) const
 
virtual void setDebugger (CkfDebugger *dbg) const
 
virtual void setEvent (const edm::Event &event) const
 
void setEvent (const edm::Event &iEvent, const edm::EventSetup &iSetup, const MeasurementTrackerEvent *data)
 
void setNavigationSchool (NavigationSchool const *nv)
 
virtual void unset () const
 
virtual ~BaseCkfTrajectoryBuilder ()
 
- 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
 
StateAndLayers findStateAndLayers (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 TrajectoryFiltercreateTrajectoryFilter (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 

Protected Attributes

const
Chi2MeasurementEstimatorBase
theEstimator
 
const MeasurementTrackerEventtheMeasurementTracker
 
const NavigationSchooltheNavigationSchool = 0
 
const PropagatorthePropagatorAlong
 
const PropagatorthePropagatorOpposite
 
const
TransientTrackingRecHitBuilder
theTTRHBuilder
 
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,
TrajectoryFilter filter,
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),
37  theFilter(filter),
38  theInOutFilter(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
const std::string thePropagatorOppositeName
const Chi2MeasurementEstimatorBase * theEstimator
std::unique_ptr< TrajectoryFilter > theFilter
BaseCkfTrajectoryBuilder::BaseCkfTrajectoryBuilder ( const BaseCkfTrajectoryBuilder )
delete
BaseCkfTrajectoryBuilder::~BaseCkfTrajectoryBuilder ( )
virtual

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 153 of file BaseCkfTrajectoryBuilder.cc.

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

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

156 {
157  // quality check
158  if ( !qualityFilter(tmptraj, inOut) ) return;
159  Trajectory traj = tmptraj.toTrajectory();
160  traj.setSharedSeed(seed);
161  // discard latest dummy measurements
162  while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid()) traj.pop();
163  LogDebug("CkfPattern")<<inOut<<"=inOut option. pushing a Trajectory with: "<<traj.foundHits()<<" found hits. "<<traj.lostHits()
164  <<" lost hits. Popped :"<<(tmptraj.measurements().size())-(traj.measurements().size())<<" hits.";
165  result.push_back(std::move(traj));
166 }
#define LogDebug(id)
bool empty() const
True if trajectory has no measurements.
Definition: Trajectory.h:244
int foundHits() const
Definition: Trajectory.h:234
int lostHits() const
Definition: Trajectory.h:241
ConstRecHitPointer const & recHit() const
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
DataContainer const & measurements() const
Definition: Trajectory.h:203
Trajectory toTrajectory() const
Convert to a standard Trajectory.
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:181
tuple result
Definition: query.py:137
void setSharedSeed(const boost::shared_ptr< const TrajectorySeed > &seed)
Definition: Trajectory.h:319
void pop()
Definition: Trajectory.cc:12
void BaseCkfTrajectoryBuilder::addToResult ( TempTrajectory const &  traj,
TempTrajectoryContainer result,
bool  inOut = false 
) const
protected

Definition at line 170 of file BaseCkfTrajectoryBuilder.cc.

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

173 {
174  // quality check
175  if ( !qualityFilter(tmptraj, inOut) ) return;
176  // discard latest dummy measurements
177  TempTrajectory traj = tmptraj;
178  while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid()) traj.pop();
179  LogDebug("CkfPattern")<<inOut<<"=inOut option. pushing a TempTrajectory with: "<<traj.foundHits()<<" found hits. "<<traj.lostHits()
180  <<" lost hits. Popped :"<<(tmptraj.measurements().size())-(traj.measurements().size())<<" hits.";
181  result.push_back(std::move(traj));
182 }
#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
tuple result
Definition: query.py:137
size_type size() const
Definition: bqueue.h:167
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

Definition at line 109 of file BaseCkfTrajectoryBuilder.h.

Referenced by CkfTrajectoryBuilder::limitedCandidates().

113  {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

Definition at line 114 of file BaseCkfTrajectoryBuilder.h.

118  {return true;}
const Propagator* BaseCkfTrajectoryBuilder::backwardPropagator ( const TrajectorySeed seed) const
inlineprotected
virtual TempTrajectory BaseCkfTrajectoryBuilder::buildTrajectories ( const TrajectorySeed seed,
TrajectoryContainer ret,
const TrajectoryFilter  
) const
inlinevirtual

Reimplemented in CkfTrajectoryBuilder, and GroupedCkfTrajectoryBuilder.

Definition at line 76 of file BaseCkfTrajectoryBuilder.h.

References assert().

78  { assert(0==1); return TempTrajectory();}
assert(m_qm.get())
TempTrajectory BaseCkfTrajectoryBuilder::createStartingTrajectory ( const TrajectorySeed seed) const
protected

Definition at line 105 of file BaseCkfTrajectoryBuilder.cc.

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

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

106 {
108  seedMeasurements(seed, result);
109 
110  LogDebug("CkfPattern")
111  <<" initial trajectory from the seed: "<<PrintoutHelper::dumpCandidate(result,true);
112 
113  return result;
114 }
#define LogDebug(id)
PropagationDirection direction() const
void seedMeasurements(const TrajectorySeed &seed, TempTrajectory &result) const
tuple result
Definition: query.py:137
static std::string dumpCandidate(const Candidate &candidate, bool showErrors=false)
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 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 119 of file BaseCkfTrajectoryBuilder.h.

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

Definition at line 201 of file BaseCkfTrajectoryBuilder.cc.

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

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

202 {
203  if (traj.empty())
204  {
205  //set the currentState to be the one from the trajectory seed starting point
206  PTrajectoryStateOnDet const & ptod = seed.startingState();
207  DetId id(ptod.detId());
209  const Surface * surface=&g->surface();
210 
211 
214  return StateAndLayers(currentState,theNavigationSchool->nextLayers(*lastLayer,*currentState.freeState(), traj.direction()) );
215  }
216  else
217  {
218  TSOS const & currentState = traj.lastMeasurement().updatedState();
219  return StateAndLayers(currentState,theNavigationSchool->nextLayers(*traj.lastLayer(), *currentState.freeState(), traj.direction()) );
220  }
221 }
const TrackingGeometry * geomTracker() const
bool empty() const
True if trajectory has no measurements.
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
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)
virtual const GeomDet * idToDet(DetId) const =0
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
BaseCkfTrajectoryBuilder::StateAndLayers BaseCkfTrajectoryBuilder::findStateAndLayers ( const TempTrajectory traj) const
protected

Definition at line 224 of file BaseCkfTrajectoryBuilder.cc.

References TempTrajectory::direction(), TempTrajectory::empty(), TrajectoryStateOnSurface::freeState(), TempTrajectory::lastLayer(), TempTrajectory::lastMeasurement(), NavigationSchool::nextLayers(), theNavigationSchool, and TrajectoryMeasurement::updatedState().

224  {
225  //assert(!traj.empty());
226  if ( traj.empty() ) {
227  edm::LogWarning("CkfPattern")<< "empty traj. Skipping.";
228  return StateAndLayers();
229  }
230 
231  TSOS const & currentState = traj.lastMeasurement().updatedState();
232  return StateAndLayers(currentState,theNavigationSchool->nextLayers(*traj.lastLayer(), *currentState.freeState(), traj.direction()) );
233 }
bool empty() const
True if trajectory has no measurements.
const TrajectoryMeasurement & lastMeasurement() const
PropagationDirection direction() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
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 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 101 of file BaseCkfTrajectoryBuilder.h.

References theTTRHBuilder.

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

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

Definition at line 185 of file BaseCkfTrajectoryBuilder.cc.

References LogDebug, and qualityFilter().

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer().

188 {
189  // quality check
190  if ( !qualityFilter(traj, inOut) ) return;
191  // discard latest dummy measurements
192  while (!traj.empty() && !traj.lastMeasurement().recHitR().isValid()) traj.pop();
193  LogDebug("CkfPattern")<<inOut<<"=inOut option. pushing a TempTrajectory with: "<<traj.foundHits()<<" found hits. "<<traj.lostHits();
194  // <<" lost hits. Popped :"<<(ttraj.measurements().size())-(traj.measurements().size())<<" hits.";
195  result.push_back(std::move(traj));
196 }
#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
tuple result
Definition: query.py:137
bool isValid() const
TrackingRecHit const & recHitR() const
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 139 of file BaseCkfTrajectoryBuilder.cc.

References theFilter, and theInOutFilter.

Referenced by addToResult(), CkfTrajectoryBuilder::limitedCandidates(), and moveToResult().

140 {
141  // Called after building a trajectory is completed, to see if it is good enough
142  // to keep.
143  if (inOut) {
144  // if (theInOutFilter == 0) edm::LogError("CkfPattern") << "CkfTrajectoryBuilder error: trying to use dedicated filter for in-out tracking phase, when none specified";
145  return theInOutFilter->qualityFilter(traj);
146  } else {
147  return theFilter->qualityFilter(traj);
148  }
149 }
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 81 of file BaseCkfTrajectoryBuilder.h.

References assert().

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

Definition at line 57 of file BaseCkfTrajectoryBuilder.cc.

References backwardPropagator(), GeometricSearchTracker::detLayer(), TempTrajectory::emplace(), forwardPropagator(), MeasurementTrackerEvent::geometricSearchTracker(), MeasurementTrackerEvent::geomTracker(), TrackingGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), Propagator::magneticField(), Propagator::propagate(), TrajectorySeed::recHits(), TrajectorySeed::startingState(), GeomDet::surface(), theMeasurementTracker, theUpdator, trajectoryStateTransform::transientState(), 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  if(innerState.isValid()) {
91  TSOS innerUpdated = theUpdator->update(innerState,*recHit);
92  result.emplace(invalidState, innerUpdated, recHit, 0, hitLayer);
93  }
94  }
95  }
96 
97  // method for debugging
98  // fix somehow
99  // fillSeedHistoDebugger(result.begin(),result.end());
100 
101 }
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
Definition: Propagator.h:119
const TrackingGeometry * geomTracker() const
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
const TrajectoryStateUpdator * theUpdator
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) 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)
virtual const GeomDet * idToDet(DetId) const =0
range recHits() const
void emplace(Args &&...args)
virtual const MagneticField * magneticField() const =0
const Propagator * backwardPropagator(const TrajectorySeed &seed) const
const GeometricSearchTracker * geometricSearchTracker() const
void BaseCkfTrajectoryBuilder::setData ( const MeasurementTrackerEvent data)
protected

Definition at line 236 of file BaseCkfTrajectoryBuilder.cc.

References data, and theMeasurementTracker.

Referenced by setEvent().

237 {
238  // possibly do some sanity check here
240 }
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 92 of file BaseCkfTrajectoryBuilder.h.

92 {;}
void BaseCkfTrajectoryBuilder::setEvent ( const edm::Event event) const
virtual

Implements TrajectoryBuilder.

Definition at line 242 of file BaseCkfTrajectoryBuilder.cc.

References dtNoiseDBValidation_cfg::cerr, and theMeasurementTracker.

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

Definition at line 252 of file BaseCkfTrajectoryBuilder.cc.

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

252  {
254  edm::ESHandle<Propagator> propagatorAlongHandle;
255  edm::ESHandle<Propagator> propagatorOppositeHandle;
258 
259  iSetup.get<TrackingComponentsRecord>().get(theUpdatorName, updatorHandle);
260  iSetup.get<TrackingComponentsRecord>().get(thePropagatorAlongName, propagatorAlongHandle);
261  iSetup.get<TrackingComponentsRecord>().get(thePropagatorOppositeName, propagatorOppositeHandle);
262  iSetup.get<TrackingComponentsRecord>().get(theEstimatorName, estimatorHandle);
263  iSetup.get<TransientRecHitRecord>().get(theRecHitBuilderName, recHitBuilderHandle);
264 
265  theUpdator = updatorHandle.product();
266  thePropagatorAlong = propagatorAlongHandle.product();
267  thePropagatorOpposite = propagatorOppositeHandle.product();
268  theEstimator = estimatorHandle.product();
269  theTTRHBuilder = recHitBuilderHandle.product();
270 
271  setData(data);
272  if(theFilter) theFilter->setEvent(iEvent, iSetup);
273  if(theInOutFilter) theInOutFilter->setEvent(iEvent, iSetup);
274  setEvent_(iEvent, iSetup);
275 }
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 T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
const Propagator * thePropagatorOpposite
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 85 of file BaseCkfTrajectoryBuilder.h.

References theNavigationSchool.

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 117 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().

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

Reimplemented from TrajectoryBuilder.

Definition at line 247 of file BaseCkfTrajectoryBuilder.cc.

References dtNoiseDBValidation_cfg::cerr, and theMeasurementTracker.

248 {
249  std::cerr << "ERROR unSet called on " << typeid(*this).name() << ( theMeasurementTracker ? " with valid " : "witout any ") << "MeasurementTrackerEvent" << std::endl;
250 }
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 backwardPropagator(), forwardPropagator(), and 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 backwardPropagator(), forwardPropagator(), and 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().