CMS 3D CMS Logo

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< 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, 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 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 ()
 

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

Protected Attributes

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

Private Member Functions

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

Private Attributes

const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecordtheEstimatorToken
 
std::unique_ptr< TrajectoryFiltertheFilter
 
std::unique_ptr< TrajectoryFiltertheInOutFilter
 
const edm::ESGetToken< Propagator, TrackingComponentsRecordthePropagatorAlongToken
 
const edm::ESGetToken< Propagator, TrackingComponentsRecordthePropagatorOppositeToken
 
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecordtheRecHitBuilderToken
 
bool theSeedAs5DHit
 
const edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecordtheUpdatorToken
 

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

◆ Chi2MeasurementEstimatorRecord

Definition at line 175 of file BaseCkfTrajectoryBuilder.h.

◆ FTS

Definition at line 60 of file BaseCkfTrajectoryBuilder.h.

◆ StateAndLayers

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

Definition at line 63 of file BaseCkfTrajectoryBuilder.h.

◆ TempTrajectoryContainer

Definition at line 67 of file BaseCkfTrajectoryBuilder.h.

◆ TM

Definition at line 62 of file BaseCkfTrajectoryBuilder.h.

◆ TrajectoryContainer

Definition at line 66 of file BaseCkfTrajectoryBuilder.h.

◆ TrajectoryIterator

typedef TrajectoryContainer::iterator BaseCkfTrajectoryBuilder::TrajectoryIterator

Definition at line 68 of file BaseCkfTrajectoryBuilder.h.

◆ TSOS

Definition at line 61 of file BaseCkfTrajectoryBuilder.h.

Constructor & Destructor Documentation

◆ BaseCkfTrajectoryBuilder() [1/2]

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorAlongToken
bool exists(std::string const &parameterName) const
checks if a parameter exists
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > theEstimatorToken
std::unique_ptr< TrajectoryFilter > theInOutFilter
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToken
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theRecHitBuilderToken
const edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecord > theUpdatorToken
def move(src, dest)
Definition: eostools.py:511
std::unique_ptr< TrajectoryFilter > theFilter

◆ BaseCkfTrajectoryBuilder() [2/2]

BaseCkfTrajectoryBuilder::BaseCkfTrajectoryBuilder ( const BaseCkfTrajectoryBuilder )
delete

◆ ~BaseCkfTrajectoryBuilder()

BaseCkfTrajectoryBuilder::~BaseCkfTrajectoryBuilder ( )
override

Definition at line 44 of file BaseCkfTrajectoryBuilder.cc.

44 {}

Member Function Documentation

◆ addToResult() [1/2]

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(), mps_fire::result, fileCollector::seed, 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 }
int lostHits() const
Definition: Trajectory.h:217
int foundHits() const
Definition: Trajectory.h:206
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:150
DataContainer const & measurements() const
Definition: Trajectory.h:178
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
Trajectory toTrajectory() const
Convert to a standard Trajectory.
void pop()
Definition: Trajectory.cc:30
bool empty() const
True if trajectory has no measurements.
Definition: Trajectory.h:233
void setSharedSeed(const std::shared_ptr< const TrajectorySeed > &seed)
Definition: Trajectory.h:316
def move(src, dest)
Definition: eostools.py:511
ConstRecHitPointer const & recHit() const
#define LogDebug(id)

◆ addToResult() [2/2]

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(), mps_fire::result, 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 }
const DataContainer & measurements() const
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
const TrajectoryMeasurement & lastMeasurement() const
int foundHits() const
int lostHits() const
size_type size() const
Definition: bqueue.h:201
def move(src, dest)
Definition: eostools.py:511
ConstRecHitPointer const & recHit() const
bool empty() const
True if trajectory has no measurements.
#define LogDebug(id)

◆ analyzeMeasurementsDebugger() [1/2]

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  }

◆ analyzeMeasurementsDebugger() [2/2]

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  }

◆ backwardPropagator()

const Propagator* BaseCkfTrajectoryBuilder::backwardPropagator ( const TrajectorySeed seed) const
inlineprotected

◆ buildTrajectories()

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)

◆ createStartingTrajectory()

TempTrajectory BaseCkfTrajectoryBuilder::createStartingTrajectory ( const TrajectorySeed seed) const
protected

Definition at line 112 of file BaseCkfTrajectoryBuilder.cc.

References PrintoutHelper::dumpCandidate(), LogDebug, mps_fire::result, fileCollector::seed, 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 }
void seedMeasurements(const TrajectorySeed &seed, TempTrajectory &result, bool as5D) const
static std::string dumpCandidate(const Candidate &candidate, bool showErrors=false)
#define LogDebug(id)

◆ createTrajectoryFilter()

std::unique_ptr< TrajectoryFilter > BaseCkfTrajectoryBuilder::createTrajectoryFilter ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)
staticprotected

Definition at line 55 of file BaseCkfTrajectoryBuilder.cc.

References get, muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

56  {
57  return TrajectoryFilterFactory::get()->create(pset.getParameter<std::string>("ComponentType"), pset, iC);
58 }
#define get

◆ fillPSetDescription()

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)

◆ fillSeedHistoDebugger()

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  }

◆ findStateAndLayers()

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(), l1ctLayer2EG_cff::id, TrackerGeometry::idToDet(), TempTrajectory::lastLayer(), TempTrajectory::lastMeasurement(), HLT_2023v12_cff::magneticField, NavigationSchool::nextLayers(), fileCollector::seed, 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 }
PropagationDirection direction() const
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
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
unsigned int detId() const
const TrajectoryMeasurement & lastMeasurement() const
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&... args) const
const TrackerGeomDet * idToDet(DetId) const override
const MeasurementTrackerEvent * theMeasurementTracker
Definition: DetId.h:17
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
std::pair< TSOS, std::vector< const DetLayer * > > StateAndLayers
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
TrajectoryStateOnSurface const & updatedState() const
const GeometricSearchTracker * geometricSearchTracker() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
const NavigationSchool * theNavigationSchool
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
const TrackerGeometry * geomTracker() const
bool empty() const
True if trajectory has no measurements.

◆ forwardPropagator()

const Propagator* BaseCkfTrajectoryBuilder::forwardPropagator ( const TrajectorySeed seed) const
inlineprotected

◆ hitBuilder()

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

◆ moveToResult()

void BaseCkfTrajectoryBuilder::moveToResult ( TempTrajectory &&  traj,
TempTrajectoryContainer result,
bool  inOut = false 
) const
protected

Definition at line 188 of file BaseCkfTrajectoryBuilder.cc.

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

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 }
ConstRecHitPointer::element_type const & recHitR() const
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
const TrajectoryMeasurement & lastMeasurement() const
int foundHits() const
int lostHits() const
def move(src, dest)
Definition: eostools.py:511
bool empty() const
True if trajectory has no measurements.
#define LogDebug(id)

◆ operator=()

BaseCkfTrajectoryBuilder& BaseCkfTrajectoryBuilder::operator= ( const BaseCkfTrajectoryBuilder )
delete

◆ qualityFilter()

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

◆ rebuildTrajectories()

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)

◆ seedMeasurements()

void BaseCkfTrajectoryBuilder::seedMeasurements ( const TrajectorySeed seed,
TempTrajectory result,
bool  as5D 
) const
private

Definition at line 61 of file BaseCkfTrajectoryBuilder.cc.

References backwardPropagator(), GeometricSearchTracker::detLayer(), forwardPropagator(), MeasurementTrackerEvent::geometricSearchTracker(), MeasurementTrackerEvent::geomTracker(), TrackerGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), Propagator::magneticField(), Propagator::propagate(), rpcPointValidation_cfi::recHit, mps_fire::result, fileCollector::seed, 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 =
66 
67  if (as5D) {
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 DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
const Propagator * backwardPropagator(const TrajectorySeed &seed) const
const TrajectoryStateUpdator * theUpdator
Log< level::Error, false > LogError
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
const TrackerGeomDet * idToDet(DetId) const override
std::shared_ptr< TrackingRecHit const > RecHitPointer
const MeasurementTrackerEvent * theMeasurementTracker
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
const GeometricSearchTracker * geometricSearchTracker() const
virtual const MagneticField * magneticField() const =0
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
#define UNLIKELY(x)
Definition: Likely.h:21
const TrackerGeometry * geomTracker() const

◆ setData()

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

◆ setDebugger()

virtual void BaseCkfTrajectoryBuilder::setDebugger ( CkfDebugger dbg) const
inlinevirtual

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 103 of file BaseCkfTrajectoryBuilder.h.

103 { ; }

◆ setEvent() [1/2]

void BaseCkfTrajectoryBuilder::setEvent ( const edm::Event event) const
overridevirtual

Implements TrajectoryBuilder.

Definition at line 227 of file BaseCkfTrajectoryBuilder.cc.

References DMR_cfg::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

◆ setEvent() [2/2]

void BaseCkfTrajectoryBuilder::setEvent ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const MeasurementTrackerEvent data 
)

Definition at line 237 of file BaseCkfTrajectoryBuilder.cc.

References data, edm::EventSetup::getData(), iEvent, 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 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
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
int iEvent
Definition: GenABIO.cc:224
const TransientTrackingRecHitBuilder * theTTRHBuilder
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > theEstimatorToken
std::unique_ptr< TrajectoryFilter > theInOutFilter
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToken
const Propagator * thePropagatorOpposite
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theRecHitBuilderToken
const edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecord > theUpdatorToken
const Chi2MeasurementEstimatorBase * theEstimator
std::unique_ptr< TrajectoryFilter > theFilter

◆ setEvent_()

virtual void BaseCkfTrajectoryBuilder::setEvent_ ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
protectedpure virtual

◆ setNavigationSchool()

void BaseCkfTrajectoryBuilder::setNavigationSchool ( NavigationSchool const *  nv)
inline

Definition at line 96 of file BaseCkfTrajectoryBuilder.h.

References theNavigationSchool.

96 { theNavigationSchool = nv; }
const NavigationSchool * theNavigationSchool

◆ toBeContinued()

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
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
Log< level::Error, false > LogError
const DataContainer & measurements() const
#define LogTrace(id)
const TrajectoryMeasurement & lastMeasurement() const
std::unique_ptr< TrajectoryFilter > theInOutFilter
int foundHits() const
int lostHits() const
size_type size() const
Definition: bqueue.h:201
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
#define UNLIKELY(x)
Definition: Likely.h:21
std::unique_ptr< TrajectoryFilter > theFilter

◆ unset()

void BaseCkfTrajectoryBuilder::unset ( ) const
overridevirtual

Reimplemented from TrajectoryBuilder.

Definition at line 232 of file BaseCkfTrajectoryBuilder.cc.

References DMR_cfg::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

◆ theEstimator

const Chi2MeasurementEstimatorBase* BaseCkfTrajectoryBuilder::theEstimator = nullptr
protected

◆ theEstimatorToken

const edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> BaseCkfTrajectoryBuilder::theEstimatorToken
private

Definition at line 195 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

◆ theFilter

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

Definition at line 188 of file BaseCkfTrajectoryBuilder.h.

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

◆ theInOutFilter

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

◆ theMeasurementTracker

const MeasurementTrackerEvent* BaseCkfTrajectoryBuilder::theMeasurementTracker = nullptr
protected

◆ theNavigationSchool

const NavigationSchool* BaseCkfTrajectoryBuilder::theNavigationSchool = nullptr
protected

◆ thePropagatorAlong

const Propagator* BaseCkfTrajectoryBuilder::thePropagatorAlong = nullptr
protected

Definition at line 178 of file BaseCkfTrajectoryBuilder.h.

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

◆ thePropagatorAlongToken

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

Definition at line 193 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

◆ thePropagatorOpposite

const Propagator* BaseCkfTrajectoryBuilder::thePropagatorOpposite = nullptr
protected

Definition at line 179 of file BaseCkfTrajectoryBuilder.h.

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

◆ thePropagatorOppositeToken

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

Definition at line 194 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

◆ theRecHitBuilderToken

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

Definition at line 196 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

◆ theSeedAs5DHit

bool BaseCkfTrajectoryBuilder::theSeedAs5DHit
private

Definition at line 186 of file BaseCkfTrajectoryBuilder.h.

Referenced by createStartingTrajectory().

◆ theTTRHBuilder

const TransientTrackingRecHitBuilder* BaseCkfTrajectoryBuilder::theTTRHBuilder = nullptr
protected

◆ theUpdator

const TrajectoryStateUpdator* BaseCkfTrajectoryBuilder::theUpdator = nullptr
protected

◆ theUpdatorToken

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