CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static 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, edm::ConsumesCollector iC, std::unique_ptr< TrajectoryFilter > filter, std::unique_ptr< TrajectoryFilter > inOutFilter=nullptr)
 
 BaseCkfTrajectoryBuilder (const BaseCkfTrajectoryBuilder &)=delete
 
virtual TempTrajectory buildTrajectories (const TrajectorySeed &seed, TrajectoryContainer &ret, unsigned int &nCandPerSeed, 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
 
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 ()
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &iDesc)
 

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
< TrajectoryFilter
createTrajectoryFilter (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 

Protected Attributes

const
Chi2MeasurementEstimatorBase
theEstimator = nullptr
 
const MeasurementTrackerEventtheMeasurementTracker = nullptr
 
const NavigationSchooltheNavigationSchool = nullptr
 
const PropagatorthePropagatorAlong = nullptr
 
const PropagatorthePropagatorOpposite = nullptr
 
const
TransientTrackingRecHitBuilder
theTTRHBuilder = nullptr
 
const TrajectoryStateUpdatortheUpdator = nullptr
 

Private Member Functions

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

Private Attributes

const edm::ESGetToken
< Chi2MeasurementEstimatorBase,
TrackingComponentsRecord
theEstimatorToken
 
std::unique_ptr< TrajectoryFiltertheFilter
 
std::unique_ptr< TrajectoryFiltertheInOutFilter
 
const edm::ESGetToken
< Propagator,
TrackingComponentsRecord
thePropagatorAlongToken
 
const edm::ESGetToken
< Propagator,
TrackingComponentsRecord
thePropagatorOppositeToken
 
const edm::ESGetToken
< TransientTrackingRecHitBuilder,
TransientRecHitRecord
theRecHitBuilderToken
 
bool theSeedAs5DHit
 
const edm::ESGetToken
< TrajectoryStateUpdator,
TrackingComponentsRecord
theUpdatorToken
 

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 57 of file BaseCkfTrajectoryBuilder.h.

Member Typedef Documentation

Definition at line 175 of file BaseCkfTrajectoryBuilder.h.

Definition at line 60 of file BaseCkfTrajectoryBuilder.h.

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

Definition at line 63 of file BaseCkfTrajectoryBuilder.h.

Definition at line 67 of file BaseCkfTrajectoryBuilder.h.

Definition at line 62 of file BaseCkfTrajectoryBuilder.h.

Definition at line 66 of file BaseCkfTrajectoryBuilder.h.

typedef TrajectoryContainer::iterator BaseCkfTrajectoryBuilder::TrajectoryIterator

Definition at line 68 of file BaseCkfTrajectoryBuilder.h.

Definition at line 61 of file BaseCkfTrajectoryBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file BaseCkfTrajectoryBuilder.cc.

References edm::ParameterSet::exists().

30  : theSeedAs5DHit(conf.getParameter<bool>("seedAs5DHit")),
32  theInOutFilter(std::move(inOutFilter)),
36  iC.esConsumes(edm::ESInputTag("", conf.getParameter<std::string>("propagatorOpposite")))),
39  if (conf.exists("clustersToSkip"))
40  edm::LogError("BaseCkfTrajectoryBuilder")
41  << "ERROR: " << typeid(*this).name() << " has a clustersToSkip parameter set";
42 }
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorAlongToken
bool exists(std::string const &parameterName) const
checks if a parameter exists
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > theEstimatorToken
def move
Definition: eostools.py:511
std::unique_ptr< TrajectoryFilter > theInOutFilter
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theRecHitBuilderToken
const edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecord > theUpdatorToken
std::unique_ptr< TrajectoryFilter > theFilter
BaseCkfTrajectoryBuilder::BaseCkfTrajectoryBuilder ( const BaseCkfTrajectoryBuilder )
delete
BaseCkfTrajectoryBuilder::~BaseCkfTrajectoryBuilder ( )
override

Definition at line 44 of file BaseCkfTrajectoryBuilder.cc.

44 {}

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

155  {
156  // quality check
157  if (!qualityFilter(tmptraj, inOut))
158  return;
159  Trajectory traj = tmptraj.toTrajectory();
160  traj.setSharedSeed(seed);
161  // discard latest dummy measurements
162  while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid())
163  traj.pop();
164  LogDebug("CkfPattern") << inOut << "=inOut option. pushing a Trajectory with: " << traj.foundHits() << " found hits. "
165  << traj.lostHits()
166  << " lost hits. Popped :" << (tmptraj.measurements().size()) - (traj.measurements().size())
167  << " hits.";
168  result.push_back(std::move(traj));
169 }
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
tuple result
Definition: mps_fire.py:311
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
def move
Definition: eostools.py:511
void pop()
Definition: Trajectory.cc:30
void setSharedSeed(const std::shared_ptr< const TrajectorySeed > &seed)
Definition: Trajectory.h:316
#define LogDebug(id)
void BaseCkfTrajectoryBuilder::addToResult ( TempTrajectory const &  traj,
TempTrajectoryContainer result,
bool  inOut = false 
) const
protected

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

173  {
174  // quality check
175  if (!qualityFilter(tmptraj, inOut))
176  return;
177  // discard latest dummy measurements
178  TempTrajectory traj = tmptraj;
179  while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid())
180  traj.pop();
181  LogDebug("CkfPattern") << inOut << "=inOut option. pushing a TempTrajectory with: " << traj.foundHits()
182  << " found hits. " << traj.lostHits()
183  << " lost hits. Popped :" << (tmptraj.measurements().size()) - (traj.measurements().size())
184  << " hits.";
185  result.push_back(std::move(traj));
186 }
ConstRecHitPointer const & recHit() const
bool empty() const
True if trajectory has no measurements.
const DataContainer & measurements() const
int foundHits() const
tuple result
Definition: mps_fire.py:311
const TrajectoryMeasurement & lastMeasurement() const
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
def move
Definition: eostools.py:511
size_type size() const
Definition: bqueue.h:201
int lostHits() const
#define LogDebug(id)
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 120 of file BaseCkfTrajectoryBuilder.h.

Referenced by CkfTrajectoryBuilder::limitedCandidates().

125  {
126  return true;
127  }
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 128 of file BaseCkfTrajectoryBuilder.h.

133  {
134  return true;
135  }
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 82 of file BaseCkfTrajectoryBuilder.h.

References cms::cuda::assert().

85  {
86  assert(0 == 1);
87  return TempTrajectory();
88  }
assert(be >=bs)
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, seedMeasurements(), and theSeedAs5DHit.

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

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

Definition at line 55 of file BaseCkfTrajectoryBuilder.cc.

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

56  {
57  return TrajectoryFilterFactory::get()->create(pset.getParameter<std::string>("ComponentType"), pset, iC);
58 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define get
void BaseCkfTrajectoryBuilder::fillPSetDescription ( edm::ParameterSetDescription iDesc)
static

Definition at line 46 of file BaseCkfTrajectoryBuilder.cc.

References edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GroupedCkfTrajectoryBuilder::fillPSetDescription(), and CkfTrajectoryBuilder::fillPSetDescription().

46  {
47  iDesc.add<bool>("seedAs5DHit", false);
48  iDesc.add<std::string>("updator", "KFUpdator");
49  iDesc.add<std::string>("propagatorAlong", "PropagatorWithMaterial");
50  iDesc.add<std::string>("propagatorOpposite", "PropagatorWithMaterialOpposite");
51  iDesc.add<std::string>("estimator", "Chi2");
52  iDesc.add<std::string>("TTRHBuilder", "WithTrackAngle");
53 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual void BaseCkfTrajectoryBuilder::fillSeedHistoDebugger ( std::vector< TrajectoryMeasurement >::iterator  begin,
std::vector< TrajectoryMeasurement >::iterator  end 
) const
inlineprotectedvirtual

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 136 of file BaseCkfTrajectoryBuilder.h.

137  {
138  ;
139  }
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(), gpuClustering::id, TrackerGeometry::idToDet(), TempTrajectory::lastLayer(), TempTrajectory::lastMeasurement(), HLT_FULL_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  //set the currentState to be the one from the trajectory seed starting point
205  PTrajectoryStateOnDet const& ptod = seed.startingState();
206  DetId id(ptod.detId());
208  const Surface* surface = &g->surface();
209 
210  TSOS currentState(
213  return StateAndLayers(currentState,
214  theNavigationSchool->nextLayers(*lastLayer, *currentState.freeState(), traj.direction()));
215  } else {
216  TSOS const& currentState = traj.lastMeasurement().updatedState();
217  return StateAndLayers(
218  currentState, theNavigationSchool->nextLayers(*traj.lastLayer(), *currentState.freeState(), traj.direction()));
219  }
220 }
bool empty() const
True if trajectory has no measurements.
uint16_t *__restrict__ id
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
tuple magneticField
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 TrackerGeomDet * idToDet(DetId) const override
const MeasurementTrackerEvent * theMeasurementTracker
Definition: DetId.h:17
const TrackerGeometry * geomTracker() const
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 111 of file BaseCkfTrajectoryBuilder.h.

References theTTRHBuilder.

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

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

Definition at line 188 of file BaseCkfTrajectoryBuilder.cc.

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

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer().

188  {
189  // quality check
190  if (!qualityFilter(traj, inOut))
191  return;
192  // discard latest dummy measurements
193  while (!traj.empty() && !traj.lastMeasurement().recHitR().isValid())
194  traj.pop();
195  LogDebug("CkfPattern") << inOut << "=inOut option. pushing a TempTrajectory with: " << traj.foundHits()
196  << " found hits. " << traj.lostHits();
197  // <<" lost hits. Popped :"<<(ttraj.measurements().size())-(traj.measurements().size())<<" hits.";
198  result.push_back(std::move(traj));
199 }
bool empty() const
True if trajectory has no measurements.
int foundHits() const
tuple result
Definition: mps_fire.py:311
const TrajectoryMeasurement & lastMeasurement() const
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
def move
Definition: eostools.py:511
ConstRecHitPointer::element_type const & recHitR() const
int lostHits() const
#define LogDebug(id)
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 141 of file BaseCkfTrajectoryBuilder.cc.

References theFilter, and theInOutFilter.

Referenced by addToResult(), and moveToResult().

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

References cms::cuda::assert().

92  {
93  assert(0 == 1);
94  }
assert(be >=bs)
void BaseCkfTrajectoryBuilder::seedMeasurements ( const TrajectorySeed seed,
TempTrajectory result,
bool  as5D 
) const
private

Definition at line 61 of file BaseCkfTrajectoryBuilder.cc.

References backwardPropagator(), edm::Range< T >::begin(), GeometricSearchTracker::detLayer(), TempTrajectory::emplace(), edm::Range< T >::end(), forwardPropagator(), MeasurementTrackerEvent::geometricSearchTracker(), MeasurementTrackerEvent::geomTracker(), TrackerGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), Propagator::magneticField(), Propagator::propagate(), TrajectorySeed::recHits(), TrajectorySeed::startingState(), GeomDet::surface(), theMeasurementTracker, theUpdator, trajectoryStateTransform::transientState(), UNLIKELY, and TrajectoryStateUpdator::update().

Referenced by createStartingTrajectory().

61  {
62  PTrajectoryStateOnDet pState(seed.startingState());
63  const GeomDet* gdet = theMeasurementTracker->geomTracker()->idToDet(pState.detId());
64  TSOS outerState =
65  trajectoryStateTransform::transientState(pState, &(gdet->surface()), forwardPropagator(seed)->magneticField());
66 
67  if (as5D) {
68  TrackingRecHit::RecHitPointer recHit(new TRecHit5DParamConstraint(*gdet, outerState));
69  TSOS invalidState(gdet->surface());
70  auto hitLayer = theMeasurementTracker->geometricSearchTracker()->detLayer(pState.detId());
71  result.emplace(invalidState, outerState, recHit, 0, hitLayer);
72  return;
73  }
74 
75  for (auto ihit = seed.recHits().begin(); ihit != seed.recHits().end(); ihit++) {
76  TrackingRecHit::RecHitPointer recHit = ihit->cloneSH();
77  const GeomDet* hitGeomDet = recHit->det();
78 
79  const DetLayer* hitLayer = theMeasurementTracker->geometricSearchTracker()->detLayer(ihit->geographicalId());
80 
81  TSOS invalidState(hitGeomDet->surface());
82  if (ihit == seed.recHits().end() - 1) {
83  // the seed trajectory state should correspond to this hit
84  if (&gdet->surface() != &hitGeomDet->surface()) {
85  edm::LogError("CkfPattern")
86  << "CkfTrajectoryBuilder error: the seed state is not on the surface of the detector of the last seed hit";
87  return; // FIXME: should throw exception
88  }
89 
90  //TSOS updatedState = outerstate;
91  result.emplace(invalidState, outerState, recHit, 0, hitLayer);
92  } else {
93  TSOS innerState = backwardPropagator(seed)->propagate(outerState, hitGeomDet->surface());
94 
95  // try to recover if propagation failed
96  if UNLIKELY (!innerState.isValid())
98  pState, &(hitGeomDet->surface()), forwardPropagator(seed)->magneticField());
99 
100  if (innerState.isValid()) {
101  TSOS innerUpdated = theUpdator->update(innerState, *recHit);
102  result.emplace(invalidState, innerUpdated, recHit, 0, hitLayer);
103  }
104  }
105  }
106 
107  // method for debugging
108  // fix somehow
109  // fillSeedHistoDebugger(result.begin(),result.end());
110 }
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
const TrajectoryStateUpdator * theUpdator
Log< level::Error, false > LogError
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
T end() const
Definition: Range.h:16
const TrackerGeomDet * idToDet(DetId) const override
std::shared_ptr< TrackingRecHit const > RecHitPointer
RecHitRange recHits() const
const MeasurementTrackerEvent * theMeasurementTracker
const TrackerGeometry * geomTracker() const
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
void emplace(Args &&...args)
virtual const MagneticField * magneticField() const =0
T begin() const
Definition: Range.h:15
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 222 of file BaseCkfTrajectoryBuilder.cc.

References data, and theMeasurementTracker.

Referenced by setEvent().

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

Definition at line 103 of file BaseCkfTrajectoryBuilder.h.

Referenced by cms::CkfDebugTrackCandidateMaker::initDebugger().

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

Implements TrajectoryBuilder.

Definition at line 227 of file BaseCkfTrajectoryBuilder.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, and theMeasurementTracker.

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

Definition at line 237 of file BaseCkfTrajectoryBuilder.cc.

References edm::EventSetup::getData(), setData(), setEvent_(), theEstimator, theEstimatorToken, theFilter, theInOutFilter, thePropagatorAlong, thePropagatorAlongToken, thePropagatorOpposite, thePropagatorOppositeToken, theRecHitBuilderToken, theTTRHBuilder, theUpdator, and theUpdatorToken.

239  {
245 
246  setData(data);
247  if (theFilter)
248  theFilter->setEvent(iEvent, iSetup);
249  if (theInOutFilter)
250  theInOutFilter->setEvent(iEvent, iSetup);
251  setEvent_(iEvent, iSetup);
252 }
void setData(const MeasurementTrackerEvent *data)
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorAlongToken
const TrajectoryStateUpdator * theUpdator
virtual void setEvent_(const edm::Event &iEvent, const edm::EventSetup &iSetup)=0
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const TransientTrackingRecHitBuilder * theTTRHBuilder
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > theEstimatorToken
std::unique_ptr< TrajectoryFilter > theInOutFilter
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToken
const Propagator * thePropagatorOpposite
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theRecHitBuilderToken
const edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecord > theUpdatorToken
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 96 of file BaseCkfTrajectoryBuilder.h.

References theNavigationSchool.

96 { 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 121 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().

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

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, and theMeasurementTracker.

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

Member Data Documentation

const Chi2MeasurementEstimatorBase* BaseCkfTrajectoryBuilder::theEstimator = nullptr
protected
const edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> BaseCkfTrajectoryBuilder::theEstimatorToken
private

Definition at line 195 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

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

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

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

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

Definition at line 178 of file BaseCkfTrajectoryBuilder.h.

Referenced by backwardPropagator(), forwardPropagator(), and setEvent().

const edm::ESGetToken<Propagator, TrackingComponentsRecord> BaseCkfTrajectoryBuilder::thePropagatorAlongToken
private

Definition at line 193 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const Propagator* BaseCkfTrajectoryBuilder::thePropagatorOpposite = nullptr
protected

Definition at line 179 of file BaseCkfTrajectoryBuilder.h.

Referenced by backwardPropagator(), forwardPropagator(), and setEvent().

const edm::ESGetToken<Propagator, TrackingComponentsRecord> BaseCkfTrajectoryBuilder::thePropagatorOppositeToken
private

Definition at line 194 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> BaseCkfTrajectoryBuilder::theRecHitBuilderToken
private

Definition at line 196 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

bool BaseCkfTrajectoryBuilder::theSeedAs5DHit
private

Definition at line 186 of file BaseCkfTrajectoryBuilder.h.

Referenced by createStartingTrajectory().

const TransientTrackingRecHitBuilder* BaseCkfTrajectoryBuilder::theTTRHBuilder = nullptr
protected
const TrajectoryStateUpdator* BaseCkfTrajectoryBuilder::theUpdator = nullptr
protected
const edm::ESGetToken<TrajectoryStateUpdator, TrackingComponentsRecord> BaseCkfTrajectoryBuilder::theUpdatorToken
private

Filter used at end of in-out tracking

Definition at line 192 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().