CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
BaseCkfTrajectoryBuilder Class Referenceabstract

#include <BaseCkfTrajectoryBuilder.h>

Inheritance diagram for BaseCkfTrajectoryBuilder:
TrajectoryBuilder CkfTrajectoryBuilder GroupedCkfTrajectoryBuilder CkfDebugTrajectoryBuilder MuonCkfTrajectoryBuilder

Public Types

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

Public Member Functions

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

Protected Types

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

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

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

Private Member Functions

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

Private Attributes

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

Detailed Description

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

Definition at line 53 of file BaseCkfTrajectoryBuilder.h.

Member Typedef Documentation

Definition at line 155 of file BaseCkfTrajectoryBuilder.h.

Definition at line 56 of file BaseCkfTrajectoryBuilder.h.

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

Definition at line 59 of file BaseCkfTrajectoryBuilder.h.

Definition at line 64 of file BaseCkfTrajectoryBuilder.h.

Definition at line 58 of file BaseCkfTrajectoryBuilder.h.

Definition at line 63 of file BaseCkfTrajectoryBuilder.h.

typedef TrajectoryContainer::iterator BaseCkfTrajectoryBuilder::TrajectoryIterator

Definition at line 65 of file BaseCkfTrajectoryBuilder.h.

Definition at line 57 of file BaseCkfTrajectoryBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file BaseCkfTrajectoryBuilder.cc.

References edm::ParameterSet::exists().

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

Definition at line 49 of file BaseCkfTrajectoryBuilder.cc.

49  {
50 }

Member Function Documentation

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

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

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

Definition at line 177 of file BaseCkfTrajectoryBuilder.cc.

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

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

Definition at line 109 of file BaseCkfTrajectoryBuilder.h.

Referenced by CkfTrajectoryBuilder::limitedCandidates().

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

Definition at line 114 of file BaseCkfTrajectoryBuilder.h.

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

Reimplemented in CkfTrajectoryBuilder, and GroupedCkfTrajectoryBuilder.

Definition at line 76 of file BaseCkfTrajectoryBuilder.h.

References assert().

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

Definition at line 112 of file BaseCkfTrajectoryBuilder.cc.

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

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

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

Definition at line 52 of file BaseCkfTrajectoryBuilder.cc.

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

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

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 119 of file BaseCkfTrajectoryBuilder.h.

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

Definition at line 208 of file BaseCkfTrajectoryBuilder.cc.

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

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

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

Definition at line 231 of file BaseCkfTrajectoryBuilder.cc.

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

231  {
232  //assert(!traj.empty());
233  if ( traj.empty() ) {
234  edm::LogWarning("CkfPattern")<< "empty traj. Skipping.";
235  return StateAndLayers();
236  }
237 
238  TSOS const & currentState = traj.lastMeasurement().updatedState();
239  return StateAndLayers(currentState,theNavigationSchool->nextLayers(*traj.lastLayer(), *currentState.freeState(), traj.direction()) );
240 }
bool empty() const
True if trajectory has no measurements.
const TrajectoryMeasurement & lastMeasurement() const
PropagationDirection direction() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&...args) const
NavigationDirection.
std::pair< TSOS, std::vector< const DetLayer * > > StateAndLayers
const NavigationSchool * theNavigationSchool
TrajectoryStateOnSurface const & updatedState() const
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
const Propagator* BaseCkfTrajectoryBuilder::forwardPropagator ( const TrajectorySeed seed) const
inlineprotected
const TransientTrackingRecHitBuilder* BaseCkfTrajectoryBuilder::hitBuilder ( ) const
inline

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

Definition at line 101 of file BaseCkfTrajectoryBuilder.h.

References theTTRHBuilder.

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

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

Definition at line 192 of file BaseCkfTrajectoryBuilder.cc.

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

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer().

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

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

Definition at line 146 of file BaseCkfTrajectoryBuilder.cc.

References theFilter, and theInOutFilter.

Referenced by addToResult(), and moveToResult().

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

Reimplemented in GroupedCkfTrajectoryBuilder, and CkfTrajectoryBuilder.

Definition at line 81 of file BaseCkfTrajectoryBuilder.h.

References assert().

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

Definition at line 57 of file BaseCkfTrajectoryBuilder.cc.

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

Referenced by createStartingTrajectory().

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

Definition at line 243 of file BaseCkfTrajectoryBuilder.cc.

References data, and theMeasurementTracker.

Referenced by setEvent().

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

Reimplemented in CkfDebugTrajectoryBuilder.

Definition at line 92 of file BaseCkfTrajectoryBuilder.h.

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

Implements TrajectoryBuilder.

Definition at line 249 of file BaseCkfTrajectoryBuilder.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, and theMeasurementTracker.

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

Definition at line 259 of file BaseCkfTrajectoryBuilder.cc.

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

259  {
261  edm::ESHandle<Propagator> propagatorAlongHandle;
262  edm::ESHandle<Propagator> propagatorOppositeHandle;
265 
266  iSetup.get<TrackingComponentsRecord>().get(theUpdatorName, updatorHandle);
267  iSetup.get<TrackingComponentsRecord>().get(thePropagatorAlongName, propagatorAlongHandle);
268  iSetup.get<TrackingComponentsRecord>().get(thePropagatorOppositeName, propagatorOppositeHandle);
269  iSetup.get<TrackingComponentsRecord>().get(theEstimatorName, estimatorHandle);
270  iSetup.get<TransientRecHitRecord>().get(theRecHitBuilderName, recHitBuilderHandle);
271 
272  theUpdator = updatorHandle.product();
273  thePropagatorAlong = propagatorAlongHandle.product();
274  thePropagatorOpposite = propagatorOppositeHandle.product();
275  theEstimator = estimatorHandle.product();
276  theTTRHBuilder = recHitBuilderHandle.product();
277 
278  setData(data);
279  if(theFilter) theFilter->setEvent(iEvent, iSetup);
280  if(theInOutFilter) theInOutFilter->setEvent(iEvent, iSetup);
281  setEvent_(iEvent, iSetup);
282 }
void setData(const MeasurementTrackerEvent *data)
const TrajectoryStateUpdator * theUpdator
virtual void setEvent_(const edm::Event &iEvent, const edm::EventSetup &iSetup)=0
const TransientTrackingRecHitBuilder * theTTRHBuilder
std::unique_ptr< TrajectoryFilter > theInOutFilter
const std::string thePropagatorAlongName
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
const Propagator * thePropagatorOpposite
const std::string thePropagatorOppositeName
const Chi2MeasurementEstimatorBase * theEstimator
std::unique_ptr< TrajectoryFilter > theFilter
virtual void BaseCkfTrajectoryBuilder::setEvent_ ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
protectedpure virtual
void BaseCkfTrajectoryBuilder::setNavigationSchool ( NavigationSchool const *  nv)
inline

Definition at line 85 of file BaseCkfTrajectoryBuilder.h.

References theNavigationSchool.

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

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

Definition at line 124 of file BaseCkfTrajectoryBuilder.cc.

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

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

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

Reimplemented from TrajectoryBuilder.

Definition at line 254 of file BaseCkfTrajectoryBuilder.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, and theMeasurementTracker.

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

Member Data Documentation

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

Definition at line 182 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

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

Definition at line 175 of file BaseCkfTrajectoryBuilder.h.

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

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

Filter used at end of complete tracking

Definition at line 176 of file BaseCkfTrajectoryBuilder.h.

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

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

Definition at line 158 of file BaseCkfTrajectoryBuilder.h.

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

const std::string BaseCkfTrajectoryBuilder::thePropagatorAlongName
private

Definition at line 180 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const Propagator* BaseCkfTrajectoryBuilder::thePropagatorOpposite
protected

Definition at line 159 of file BaseCkfTrajectoryBuilder.h.

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

const std::string BaseCkfTrajectoryBuilder::thePropagatorOppositeName
private

Definition at line 181 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

const std::string BaseCkfTrajectoryBuilder::theRecHitBuilderName
private

Definition at line 183 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().

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

Filter used at end of in-out tracking

Definition at line 179 of file BaseCkfTrajectoryBuilder.h.

Referenced by setEvent().