CMS 3D CMS Logo

BaseCkfTrajectoryBuilder.h
Go to the documentation of this file.
1 #ifndef RecoTracker_CkfPattern_BaseCkfTrajectoryBuilder_h
2 #define RecoTracker_CkfPattern_BaseCkfTrajectoryBuilder_h
3 
12 
13 #include <cassert>
15 
16 class CkfDebugger;
18 class DetGroup;
21 class LayerMeasurements;
22 class MeasurementTracker;
25 class NavigationSchool;
26 class Propagator;
29 class TrajectoryContainer;
31 class TrajectoryFitter;
34 class Trajectory;
35 class TempTrajectory;
36 class TrajectoryFilter;
37 class TrackingRegion;
39 class TrajectoryCleaner;
41 namespace edm {
42  class ConsumesCollector;
43 }
44 
46 
47 #include <string>
48 
57 protected:
58  // short names
62  typedef std::pair<TSOS, std::vector<const DetLayer*> > StateAndLayers;
63 
64 public:
65  typedef std::vector<Trajectory> TrajectoryContainer;
66  typedef std::vector<TempTrajectory> TempTrajectoryContainer;
67  typedef TrajectoryContainer::iterator TrajectoryIterator;
68 
69  // Claims ownership of TrajectoryFilter pointers
72  std::unique_ptr<TrajectoryFilter> filter,
73  std::unique_ptr<TrajectoryFilter> inOutFilter = nullptr);
76  ~BaseCkfTrajectoryBuilder() override;
77 
79 
80  virtual void buildTrajectories(const TrajectorySeed& seed,
82  unsigned int& nCandPerSeed,
83  const TrajectoryFilter*) const {
84  assert(0 == 1);
85  }
86 
87  virtual void rebuildTrajectories(const TrajectorySeed& seed, TrajectoryContainer& result) const { assert(0 == 1); }
88 
90 
91  void setEvent(const edm::Event& event) const override;
92  void unset() const override;
93 
94  void setEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup, const MeasurementTrackerEvent* data);
95 
96  virtual void setDebugger(CkfDebugger* dbg) const { ; }
97 
99  // int maxLostHit() {return theMaxLostHit;}
100 
102  // int maxConsecLostHit() {return theMaxConsecLostHit;}
103 
105 
106 protected:
107  static std::unique_ptr<TrajectoryFilter> createTrajectoryFilter(const edm::ParameterSet& pset,
109 
110  virtual void setEvent_(const edm::Event& iEvent, const edm::EventSetup& iSetup) = 0;
111 
112  //methods for dubugging
114  const std::vector<TrajectoryMeasurement>& meas,
116  const Propagator* theForwardPropagator,
119  return true;
120  }
122  const std::vector<TrajectoryMeasurement>& meas,
124  const Propagator* theForwardPropagator,
127  return true;
128  }
129  virtual void fillSeedHistoDebugger(std::vector<TrajectoryMeasurement>::iterator begin,
130  std::vector<TrajectoryMeasurement>::iterator end) const {
131  ;
132  }
133 
134 protected:
136 
138  // If inOut is true, this is being called part-way through tracking, after the in-out tracking phase is complete.
139  // If inOut is false, it is called at the end of tracking.
140  bool toBeContinued(TempTrajectory& traj, bool inOut = false) const;
141 
143  bool qualityFilter(const TempTrajectory& traj, bool inOut = false) const;
144 
145  void addToResult(std::shared_ptr<const TrajectorySeed> const& seed,
146  TempTrajectory& traj,
148  bool inOut = false) const;
149  void addToResult(TempTrajectory const& traj, TempTrajectoryContainer& result, bool inOut = false) const;
150  void moveToResult(TempTrajectory&& traj, TempTrajectoryContainer& result, bool inOut = false) const;
151 
153 
154 private:
155  void seedMeasurements(const TrajectorySeed& seed, TempTrajectory& result, bool as5D) const;
156 
157 protected:
158  void setData(const MeasurementTrackerEvent* data);
159 
162  }
165  }
166 
167 protected:
169 
171  const Propagator* thePropagatorAlong = nullptr;
177 
178 private:
180 
181  std::unique_ptr<TrajectoryFilter> theFilter;
182  std::unique_ptr<TrajectoryFilter> theInOutFilter;
184  // for EventSetup
190 };
191 
192 #endif
BaseCkfTrajectoryBuilder & operator=(const BaseCkfTrajectoryBuilder &)=delete
virtual void fillSeedHistoDebugger(std::vector< TrajectoryMeasurement >::iterator begin, std::vector< TrajectoryMeasurement >::iterator end) const
StateAndLayers findStateAndLayers(const TrajectorySeed &seed, const TempTrajectory &traj) const
TrajectoryStateOnSurface TSOS
virtual bool analyzeMeasurementsDebugger(TempTrajectory &traj, const std::vector< TrajectoryMeasurement > &meas, const MeasurementTrackerEvent *theMeasurementTracker, const Propagator *theForwardPropagator, const Chi2MeasurementEstimatorBase *theEstimator, const TransientTrackingRecHitBuilder *theTTRHBuilder) const
void setData(const MeasurementTrackerEvent *data)
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorAlongToken
TempTrajectory createStartingTrajectory(const TrajectorySeed &seed) const
ret
prodAgent to be discontinued
virtual void setDebugger(CkfDebugger *dbg) const
bool toBeContinued(TempTrajectory &traj, bool inOut=false) const
const Propagator * backwardPropagator(const TrajectorySeed &seed) const
const TrajectoryStateUpdator * theUpdator
assert(be >=bs)
TrajectoryContainer::iterator TrajectoryIterator
void seedMeasurements(const TrajectorySeed &seed, TempTrajectory &result, bool as5D) const
virtual void setEvent_(const edm::Event &iEvent, const edm::EventSetup &iSetup)=0
int iEvent
Definition: GenABIO.cc:224
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
const TransientTrackingRecHitBuilder * theTTRHBuilder
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > theEstimatorToken
static std::unique_ptr< TrajectoryFilter > createTrajectoryFilter(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
std::unique_ptr< TrajectoryFilter > theInOutFilter
virtual bool analyzeMeasurementsDebugger(Trajectory &traj, const std::vector< TrajectoryMeasurement > &meas, const MeasurementTrackerEvent *theMeasurementTracker, const Propagator *theForwardPropagator, const Chi2MeasurementEstimatorBase *theEstimator, const TransientTrackingRecHitBuilder *theTTRHBuilder) const
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
const MeasurementTrackerEvent * theMeasurementTracker
const TransientTrackingRecHitBuilder * hitBuilder() const
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropagatorOppositeToken
void moveToResult(TempTrajectory &&traj, TempTrajectoryContainer &result, bool inOut=false) const
std::pair< TSOS, std::vector< const DetLayer * > > StateAndLayers
std::vector< TempTrajectory > TempTrajectoryContainer
void setNavigationSchool(NavigationSchool const *nv)
const Propagator * thePropagatorOpposite
BaseCkfTrajectoryBuilder(const edm::ParameterSet &conf, edm::ConsumesCollector iC, std::unique_ptr< TrajectoryFilter > filter, std::unique_ptr< TrajectoryFilter > inOutFilter=nullptr)
virtual void buildTrajectories(const TrajectorySeed &seed, TrajectoryContainer &ret, unsigned int &nCandPerSeed, const TrajectoryFilter *) const
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
TrackingComponentsRecord Chi2MeasurementEstimatorRecord
void addToResult(std::shared_ptr< const TrajectorySeed > const &seed, TempTrajectory &traj, TrajectoryContainer &result, bool inOut=false) const
const NavigationSchool * theNavigationSchool
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
virtual void rebuildTrajectories(const TrajectorySeed &seed, TrajectoryContainer &result) const
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theRecHitBuilderToken
void setEvent(const edm::Event &event) const override
const edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecord > theUpdatorToken
std::vector< Trajectory > TrajectoryContainer
const Chi2MeasurementEstimatorBase * theEstimator
Definition: event.py:1
std::unique_ptr< TrajectoryFilter > theFilter