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 (std::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 = 0
 
const MeasurementTrackerEventtheMeasurementTracker = 0
 
const NavigationSchooltheNavigationSchool = 0
 
const PropagatorthePropagatorAlong = 0
 
const PropagatorthePropagatorOpposite = 0
 
const TransientTrackingRecHitBuildertheTTRHBuilder = 0
 
const TrajectoryStateUpdatortheUpdator = 0
 

Private Member Functions

void seedMeasurements (const TrajectorySeed &seed, TempTrajectory &result, bool as5D) 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
 
bool theSeedAs5DHit
 
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 168 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 63 of file BaseCkfTrajectoryBuilder.h.

Definition at line 58 of file BaseCkfTrajectoryBuilder.h.

Definition at line 62 of file BaseCkfTrajectoryBuilder.h.

typedef TrajectoryContainer::iterator BaseCkfTrajectoryBuilder::TrajectoryIterator

Definition at line 64 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 27 of file BaseCkfTrajectoryBuilder.cc.

References edm::ParameterSet::exists().

30  : theSeedAs5DHit(conf.getParameter<bool>("seedAs5DHit")),
32  theInOutFilter(std::move(inOutFilter)),
33  theUpdatorName(conf.getParameter<std::string>("updator")),
34  thePropagatorAlongName(conf.getParameter<std::string>("propagatorAlong")),
35  thePropagatorOppositeName(conf.getParameter<std::string>("propagatorOpposite")),
36  theEstimatorName(conf.getParameter<std::string>("estimator")),
37  theRecHitBuilderName(conf.getParameter<std::string>("TTRHBuilder")) {
38  if (conf.exists("clustersToSkip"))
39  edm::LogError("BaseCkfTrajectoryBuilder")
40  << "ERROR: " << typeid(*this).name() << " has a clustersToSkip parameter set";
41 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::unique_ptr< TrajectoryFilter > theInOutFilter
const std::string thePropagatorAlongName
def move(src, dest)
Definition: eostools.py:511
const std::string thePropagatorOppositeName
std::unique_ptr< TrajectoryFilter > theFilter
BaseCkfTrajectoryBuilder::BaseCkfTrajectoryBuilder ( const BaseCkfTrajectoryBuilder )
delete
BaseCkfTrajectoryBuilder::~BaseCkfTrajectoryBuilder ( )
override

Definition at line 43 of file BaseCkfTrajectoryBuilder.cc.

43 {}

Member Function Documentation

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

Definition at line 146 of file BaseCkfTrajectoryBuilder.cc.

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

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

149  {
150  // quality check
151  if (!qualityFilter(tmptraj, inOut))
152  return;
153  Trajectory traj = tmptraj.toTrajectory();
154  traj.setSharedSeed(seed);
155  // discard latest dummy measurements
156  while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid())
157  traj.pop();
158  LogDebug("CkfPattern") << inOut << "=inOut option. pushing a Trajectory with: " << traj.foundHits() << " found hits. "
159  << traj.lostHits()
160  << " lost hits. Popped :" << (tmptraj.measurements().size()) - (traj.measurements().size())
161  << " hits.";
162  result.push_back(std::move(traj));
163 }
#define LogDebug(id)
bool empty() const
True if trajectory has no measurements.
Definition: Trajectory.h:233
int foundHits() const
Definition: Trajectory.h:206
int lostHits() const
Definition: Trajectory.h:217
ConstRecHitPointer const & recHit() const
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
DataContainer const & measurements() const
Definition: Trajectory.h:178
Trajectory toTrajectory() const
Convert to a standard Trajectory.
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:150
void pop()
Definition: Trajectory.cc:30
void setSharedSeed(const std::shared_ptr< const TrajectorySeed > &seed)
Definition: Trajectory.h:316
def move(src, dest)
Definition: eostools.py:511
void BaseCkfTrajectoryBuilder::addToResult ( TempTrajectory const &  traj,
TempTrajectoryContainer result,
bool  inOut = false 
) const
protected

Definition at line 165 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().

167  {
168  // quality check
169  if (!qualityFilter(tmptraj, inOut))
170  return;
171  // discard latest dummy measurements
172  TempTrajectory traj = tmptraj;
173  while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid())
174  traj.pop();
175  LogDebug("CkfPattern") << inOut << "=inOut option. pushing a TempTrajectory with: " << traj.foundHits()
176  << " found hits. " << traj.lostHits()
177  << " lost hits. Popped :" << (tmptraj.measurements().size()) - (traj.measurements().size())
178  << " hits.";
179  result.push_back(std::move(traj));
180 }
#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:201
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 113 of file BaseCkfTrajectoryBuilder.h.

Referenced by CkfTrajectoryBuilder::limitedCandidates().

118  {
119  return true;
120  }
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 121 of file BaseCkfTrajectoryBuilder.h.

126  {
127  return true;
128  }
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

Reimplemented in CkfTrajectoryBuilder, and GroupedCkfTrajectoryBuilder.

Definition at line 75 of file BaseCkfTrajectoryBuilder.h.

Referenced by GroupedCkfTrajectoryBuilder::~GroupedCkfTrajectoryBuilder().

78  {
79  assert(0 == 1);
80  return TempTrajectory();
81  }
TempTrajectory BaseCkfTrajectoryBuilder::createStartingTrajectory ( const TrajectorySeed seed) const
protected

Definition at line 105 of file BaseCkfTrajectoryBuilder.cc.

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

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

105  {
106  TempTrajectory result(seed.direction(), seed.nHits());
108 
109  LogDebug("CkfPattern") << " initial trajectory from the seed: " << PrintoutHelper::dumpCandidate(result, true);
110 
111  return result;
112 }
#define LogDebug(id)
PropagationDirection direction() const
void seedMeasurements(const TrajectorySeed &seed, TempTrajectory &result, bool as5D) 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
virtual void BaseCkfTrajectoryBuilder::fillSeedHistoDebugger ( std::vector< TrajectoryMeasurement >::iterator  begin,
std::vector< TrajectoryMeasurement >::iterator  end 
) const
inlineprotectedvirtual

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 129 of file BaseCkfTrajectoryBuilder.h.

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

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

Definition at line 195 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(), HLT_2018_cff::magneticField, NavigationSchool::nextLayers(), TrajectorySeed::startingState(), theMeasurementTracker, theNavigationSchool, trajectoryStateTransform::transientState(), and TrajectoryMeasurement::updatedState().

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

196  {
197  if (traj.empty()) {
198  //set the currentState to be the one from the trajectory seed starting point
199  PTrajectoryStateOnDet const& ptod = seed.startingState();
200  DetId id(ptod.detId());
202  const Surface* surface = &g->surface();
203 
204  TSOS currentState(
207  return StateAndLayers(currentState,
208  theNavigationSchool->nextLayers(*lastLayer, *currentState.freeState(), traj.direction()));
209  } else {
210  TSOS const& currentState = traj.lastMeasurement().updatedState();
211  return StateAndLayers(
212  currentState, theNavigationSchool->nextLayers(*traj.lastLayer(), *currentState.freeState(), traj.direction()));
213  }
214 }
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:17
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
std::pair< TSOS, std::vector< const DetLayer * > > StateAndLayers
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&...args) const
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 104 of file BaseCkfTrajectoryBuilder.h.

References muonDTDigis_cfi::pset.

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

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

Definition at line 182 of file BaseCkfTrajectoryBuilder.cc.

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

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer().

182  {
183  // quality check
184  if (!qualityFilter(traj, inOut))
185  return;
186  // discard latest dummy measurements
187  while (!traj.empty() && !traj.lastMeasurement().recHitR().isValid())
188  traj.pop();
189  LogDebug("CkfPattern") << inOut << "=inOut option. pushing a TempTrajectory with: " << traj.foundHits()
190  << " found hits. " << traj.lostHits();
191  // <<" lost hits. Popped :"<<(ttraj.measurements().size())-(traj.measurements().size())<<" hits.";
192  result.push_back(std::move(traj));
193 }
#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 135 of file BaseCkfTrajectoryBuilder.cc.

References theFilter, and theInOutFilter.

Referenced by addToResult(), and moveToResult().

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

Referenced by GroupedCkfTrajectoryBuilder::~GroupedCkfTrajectoryBuilder().

85  {
86  assert(0 == 1);
87  }
void BaseCkfTrajectoryBuilder::seedMeasurements ( const TrajectorySeed seed,
TempTrajectory result,
bool  as5D 
) const
private

Definition at line 51 of file BaseCkfTrajectoryBuilder.cc.

References backwardPropagator(), 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().

51  {
52  TrajectorySeed::range hitRange = seed.recHits();
53 
54  PTrajectoryStateOnDet pState(seed.startingState());
55  const GeomDet* gdet = theMeasurementTracker->geomTracker()->idToDet(pState.detId());
56  TSOS outerState =
57  trajectoryStateTransform::transientState(pState, &(gdet->surface()), forwardPropagator(seed)->magneticField());
58 
59  if (as5D) {
61  TSOS invalidState(gdet->surface());
62  auto hitLayer = theMeasurementTracker->geometricSearchTracker()->detLayer(pState.detId());
63  result.emplace(invalidState, outerState, recHit, 0, hitLayer);
64  return;
65  }
66 
67  for (TrajectorySeed::const_iterator ihit = hitRange.first; ihit != hitRange.second; ihit++) {
68  TrackingRecHit::RecHitPointer recHit = ihit->cloneSH();
69  const GeomDet* hitGeomDet = recHit->det();
70 
71  const DetLayer* hitLayer = theMeasurementTracker->geometricSearchTracker()->detLayer(ihit->geographicalId());
72 
73  TSOS invalidState(hitGeomDet->surface());
74  if (ihit == hitRange.second - 1) {
75  // the seed trajectory state should correspond to this hit
76  if (&gdet->surface() != &hitGeomDet->surface()) {
77  edm::LogError("CkfPattern")
78  << "CkfTrajectoryBuilder error: the seed state is not on the surface of the detector of the last seed hit";
79  return; // FIXME: should throw exception
80  }
81 
82  //TSOS updatedState = outerstate;
83  result.emplace(invalidState, outerState, recHit, 0, hitLayer);
84  } else {
85  TSOS innerState = backwardPropagator(seed)->propagate(outerState, hitGeomDet->surface());
86 
87  // try to recover if propagation failed
88  if
89  UNLIKELY(!innerState.isValid())
91  pState, &(hitGeomDet->surface()), forwardPropagator(seed)->magneticField());
92 
93  if (innerState.isValid()) {
94  TSOS innerUpdated = theUpdator->update(innerState, *recHit);
95  result.emplace(invalidState, innerUpdated, recHit, 0, hitLayer);
96  }
97  }
98  }
99 
100  // method for debugging
101  // fix somehow
102  // fillSeedHistoDebugger(result.begin(),result.end());
103 }
std::pair< const_iterator, const_iterator > range
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:37
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::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:50
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 216 of file BaseCkfTrajectoryBuilder.cc.

References data, and theMeasurementTracker.

Referenced by setEvent().

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

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 96 of file BaseCkfTrajectoryBuilder.h.

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

Implements TrajectoryBuilder.

Definition at line 221 of file BaseCkfTrajectoryBuilder.cc.

References beam_dqm_sourceclient-live_cfg::cerr, and theMeasurementTracker.

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

Definition at line 231 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.

233  {
235  edm::ESHandle<Propagator> propagatorAlongHandle;
236  edm::ESHandle<Propagator> propagatorOppositeHandle;
239 
240  iSetup.get<TrackingComponentsRecord>().get(theUpdatorName, updatorHandle);
241  iSetup.get<TrackingComponentsRecord>().get(thePropagatorAlongName, propagatorAlongHandle);
242  iSetup.get<TrackingComponentsRecord>().get(thePropagatorOppositeName, propagatorOppositeHandle);
243  iSetup.get<TrackingComponentsRecord>().get(theEstimatorName, estimatorHandle);
244  iSetup.get<TransientRecHitRecord>().get(theRecHitBuilderName, recHitBuilderHandle);
245 
246  theUpdator = updatorHandle.product();
247  thePropagatorAlong = propagatorAlongHandle.product();
248  thePropagatorOpposite = propagatorOppositeHandle.product();
249  theEstimator = estimatorHandle.product();
250  theTTRHBuilder = recHitBuilderHandle.product();
251 
252  setData(data);
253  if (theFilter)
254  theFilter->setEvent(iEvent, iSetup);
255  if (theInOutFilter)
256  theInOutFilter->setEvent(iEvent, iSetup);
257  setEvent_(iEvent, iSetup);
258 }
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:73
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 89 of file BaseCkfTrajectoryBuilder.h.

References data, and iEvent.

89 { theNavigationSchool = nv; }
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 114 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().

114  {
115  if
116  UNLIKELY(traj.measurements().size() > 400) {
117  edm::LogError("BaseCkfTrajectoryBuilder_InfiniteLoop");
118  LogTrace("BaseCkfTrajectoryBuilder_InfiniteLoop")
119  << "Cropping Track After 400 Measurements:\n"
120  << " Last predicted state: " << traj.lastMeasurement().predictedState() << "\n"
121  << " Last layer subdetector: " << (traj.lastLayer() ? traj.lastLayer()->subDetector() : -1) << "\n"
122  << " Found hits: " << traj.foundHits() << ", lost hits: " << traj.lostHits() << "\n\n";
123  return false;
124  }
125  // Called after each new hit is added to the trajectory, to see if it is
126  // worth continuing to build this track candidate.
127  if (inOut) {
128  // if (theInOutFilter == 0) edm::LogError("CkfPattern") << "CkfTrajectoryBuilder error: trying to use dedicated filter for in-out tracking phase, when none specified";
129  return theInOutFilter->toBeContinued(traj);
130  } else {
131  return theFilter->toBeContinued(traj);
132  }
133 }
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:201
#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 226 of file BaseCkfTrajectoryBuilder.cc.

References beam_dqm_sourceclient-live_cfg::cerr, and theMeasurementTracker.

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

Member Data Documentation

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

Definition at line 188 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

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

Definition at line 181 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 182 of file BaseCkfTrajectoryBuilder.h.

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

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

Definition at line 171 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const std::string BaseCkfTrajectoryBuilder::thePropagatorAlongName
private

Definition at line 186 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const Propagator* BaseCkfTrajectoryBuilder::thePropagatorOpposite = 0
protected

Definition at line 172 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const std::string BaseCkfTrajectoryBuilder::thePropagatorOppositeName
private

Definition at line 187 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const std::string BaseCkfTrajectoryBuilder::theRecHitBuilderName
private

Definition at line 189 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

bool BaseCkfTrajectoryBuilder::theSeedAs5DHit
private

Definition at line 179 of file BaseCkfTrajectoryBuilder.h.

Referenced by createStartingTrajectory().

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

Filter used at end of in-out tracking

Definition at line 185 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().