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 
9 
10 #include<cassert>
12 
13 class CkfDebugger;
15 class DetGroup;
18 class LayerMeasurements;
19 class MeasurementTracker;
22 class NavigationSchool;
23 class Propagator;
26 class TrajectoryContainer;
28 class TrajectoryFitter;
30 class Trajectory;
31 class TempTrajectory;
32 class TrajectoryFilter;
33 class TrackingRegion;
35 class TrajectoryCleaner;
37 namespace edm {
38  class ConsumesCollector;
39 }
40 
43 
44 #include <string>
45 
54 protected:
55  // short names
59  typedef std::pair<TSOS,std::vector<const DetLayer*> > StateAndLayers;
60 
61 public:
62 
63  typedef std::vector<Trajectory> TrajectoryContainer;
64  typedef std::vector<TempTrajectory> TempTrajectoryContainer;
65  typedef TrajectoryContainer::iterator TrajectoryIterator;
66 
67  // Claims ownership of TrajectoryFilter pointers
69  std::unique_ptr<TrajectoryFilter> filter,
70  std::unique_ptr<TrajectoryFilter> inOutFilter=nullptr);
72  BaseCkfTrajectoryBuilder& operator=(const BaseCkfTrajectoryBuilder&) = delete;
73  ~BaseCkfTrajectoryBuilder() override;
74 
75  // new interface returning the start Trajectory...
77  TrajectoryContainer &ret,
78  unsigned int& nCandPerSeed,
79  const TrajectoryFilter*) const { assert(0==1); return TempTrajectory();}
80 
81 
82  virtual void rebuildTrajectories(TempTrajectory const& startingTraj, const TrajectorySeed& seed,
83  TrajectoryContainer& result) const { assert(0==1);}
84 
85 
86  void setNavigationSchool(NavigationSchool const * nv) { theNavigationSchool=nv;}
87 
88  void setEvent(const edm::Event& event) const override ;
89  void unset() const override;
90 
91  void setEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup, const MeasurementTrackerEvent *data);
92 
93  virtual void setDebugger( CkfDebugger * dbg) const {;}
94 
96  // int maxLostHit() {return theMaxLostHit;}
97 
99  // int maxConsecLostHit() {return theMaxConsecLostHit;}
100 
101 
102  const TransientTrackingRecHitBuilder* hitBuilder() const { return theTTRHBuilder;}
103 
104  protected:
105  static std::unique_ptr<TrajectoryFilter> createTrajectoryFilter(const edm::ParameterSet& pset, edm::ConsumesCollector& iC);
106 
107  virtual void setEvent_(const edm::Event& iEvent, const edm::EventSetup& iSetup) = 0;
108 
109  //methods for dubugging
110  virtual bool analyzeMeasurementsDebugger(Trajectory& traj, const std::vector<TrajectoryMeasurement>& meas,
111  const MeasurementTrackerEvent* theMeasurementTracker,
112  const Propagator* theForwardPropagator,
113  const Chi2MeasurementEstimatorBase* theEstimator,
114  const TransientTrackingRecHitBuilder * theTTRHBuilder) const {return true;}
115  virtual bool analyzeMeasurementsDebugger(TempTrajectory& traj, const std::vector<TrajectoryMeasurement>& meas,
116  const MeasurementTrackerEvent* theMeasurementTracker,
117  const Propagator* theForwardPropagator,
118  const Chi2MeasurementEstimatorBase* theEstimator,
119  const TransientTrackingRecHitBuilder * theTTRHBuilder) const {return true;}
120  virtual void fillSeedHistoDebugger(std::vector<TrajectoryMeasurement>::iterator begin,
121  std::vector<TrajectoryMeasurement>::iterator end) const {;}
122 
123  protected:
124 
125  TempTrajectory createStartingTrajectory( const TrajectorySeed& seed) const;
126 
128  // If inOut is true, this is being called part-way through tracking, after the in-out tracking phase is complete.
129  // If inOut is false, it is called at the end of tracking.
130  bool toBeContinued( TempTrajectory& traj, bool inOut = false) const;
131 
133  bool qualityFilter( const TempTrajectory& traj, bool inOut = false) const;
134 
135  void addToResult(boost::shared_ptr<const TrajectorySeed> const & seed, TempTrajectory& traj, TrajectoryContainer& result, bool inOut = false) const;
136  void addToResult( TempTrajectory const& traj, TempTrajectoryContainer& result, bool inOut = false) const;
137  void moveToResult( TempTrajectory&& traj, TempTrajectoryContainer& result, bool inOut = false) const;
138 
139  StateAndLayers findStateAndLayers(const TrajectorySeed& seed, const TempTrajectory& traj) const;
140 
141  private:
142  void seedMeasurements(const TrajectorySeed& seed, TempTrajectory & result) const;
143 
144  protected:
145  void setData(const MeasurementTrackerEvent *data) ;
146 
147  const Propagator *forwardPropagator(const TrajectorySeed& seed) const {
148  return seed.direction() == alongMomentum ? thePropagatorAlong : thePropagatorOpposite;
149  }
150  const Propagator *backwardPropagator(const TrajectorySeed& seed) const {
151  return seed.direction() == alongMomentum ? thePropagatorOpposite : thePropagatorAlong;
152  }
153 
154  protected:
156 
163  const NavigationSchool * theNavigationSchool = nullptr;
164 
165 
166  private:
167  // int theMaxLostHit; /**< Maximum number of lost hits per trajectory candidate.*/
168  // int theMaxConsecLostHit; /**< Maximum number of consecutive lost hits
169  // per trajectory candidate. */
170  // int theMinimumNumberOfHits; /**< Minimum number of hits for a trajectory to be returned.*/
171  // float theChargeSignificance; /**< Value to declare (q/p)/sig(q/p) significant. Negative: ignore. */
172 
173  // TrajectoryFilter* theMinPtCondition;
174  // TrajectoryFilter* theMaxHitsCondition;
175  std::unique_ptr<TrajectoryFilter> theFilter;
176  std::unique_ptr<TrajectoryFilter> theInOutFilter;
178  // for EventSetup
184 };
185 
186 
187 #endif
PropagationDirection direction() const
TrajectoryStateOnSurface TSOS
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
virtual bool analyzeMeasurementsDebugger(Trajectory &traj, const std::vector< TrajectoryMeasurement > &meas, const MeasurementTrackerEvent *theMeasurementTracker, const Propagator *theForwardPropagator, const Chi2MeasurementEstimatorBase *theEstimator, const TransientTrackingRecHitBuilder *theTTRHBuilder) const
const TrajectoryStateUpdator * theUpdator
virtual TempTrajectory buildTrajectories(const TrajectorySeed &seed, TrajectoryContainer &ret, unsigned int &nCandPerSeed, const TrajectoryFilter *) const
TrajectoryContainer::iterator TrajectoryIterator
const TransientTrackingRecHitBuilder * hitBuilder() const
int iEvent
Definition: GenABIO.cc:224
virtual void rebuildTrajectories(TempTrajectory const &startingTraj, const TrajectorySeed &seed, TrajectoryContainer &result) const
const TransientTrackingRecHitBuilder * theTTRHBuilder
virtual bool analyzeMeasurementsDebugger(TempTrajectory &traj, const std::vector< TrajectoryMeasurement > &meas, const MeasurementTrackerEvent *theMeasurementTracker, const Propagator *theForwardPropagator, const Chi2MeasurementEstimatorBase *theEstimator, const TransientTrackingRecHitBuilder *theTTRHBuilder) const
std::unique_ptr< TrajectoryFilter > theInOutFilter
#define end
Definition: vmac.h:39
const std::string thePropagatorAlongName
const MeasurementTrackerEvent * theMeasurementTracker
std::vector< TempTrajectory > TempTrajectoryContainer
void setNavigationSchool(NavigationSchool const *nv)
const Propagator * thePropagatorOpposite
#define begin
Definition: vmac.h:32
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
TrackingComponentsRecord Chi2MeasurementEstimatorRecord
std::pair< TSOS, std::vector< const DetLayer * > > StateAndLayers
const Propagator * backwardPropagator(const TrajectorySeed &seed) const
virtual void setDebugger(CkfDebugger *dbg) const
virtual void fillSeedHistoDebugger(std::vector< TrajectoryMeasurement >::iterator begin, std::vector< TrajectoryMeasurement >::iterator end) const
std::vector< Trajectory > TrajectoryContainer
const std::string thePropagatorOppositeName
const Chi2MeasurementEstimatorBase * theEstimator
Definition: event.py:1
std::unique_ptr< TrajectoryFilter > theFilter