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
70  TrajectoryFilter *inOutFilter=nullptr);
72  BaseCkfTrajectoryBuilder& operator=(const BaseCkfTrajectoryBuilder&) = delete;
73  virtual ~BaseCkfTrajectoryBuilder();
74 
75  // new interface returning the start Trajectory...
77  TrajectoryContainer &ret,
78  const TrajectoryFilter*) const { assert(0==1); return TempTrajectory();}
79 
80 
81  virtual void rebuildTrajectories(TempTrajectory const& startingTraj, const TrajectorySeed& seed,
82  TrajectoryContainer& result) const { assert(0==1);}
83 
84 
85  void setNavigationSchool(NavigationSchool const * nv) { theNavigationSchool=nv;}
86 
87  virtual void setEvent(const edm::Event& event) const ;
88  virtual void unset() const;
89 
90  void setEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup, const MeasurementTrackerEvent *data);
91 
92  virtual void setDebugger( CkfDebugger * dbg) const {;}
93 
95  // int maxLostHit() {return theMaxLostHit;}
96 
98  // int maxConsecLostHit() {return theMaxConsecLostHit;}
99 
100 
101  const TransientTrackingRecHitBuilder* hitBuilder() const { return theTTRHBuilder;}
102 
103  protected:
104  static TrajectoryFilter *createTrajectoryFilter(const edm::ParameterSet& pset, edm::ConsumesCollector& iC);
105 
106  virtual void setEvent_(const edm::Event& iEvent, const edm::EventSetup& iSetup) = 0;
107 
108  //methods for dubugging
109  virtual bool analyzeMeasurementsDebugger(Trajectory& traj, const std::vector<TrajectoryMeasurement>& meas,
110  const MeasurementTrackerEvent* theMeasurementTracker,
111  const Propagator* theForwardPropagator,
112  const Chi2MeasurementEstimatorBase* theEstimator,
113  const TransientTrackingRecHitBuilder * theTTRHBuilder) const {return true;}
114  virtual bool analyzeMeasurementsDebugger(TempTrajectory& traj, const std::vector<TrajectoryMeasurement>& meas,
115  const MeasurementTrackerEvent* theMeasurementTracker,
116  const Propagator* theForwardPropagator,
117  const Chi2MeasurementEstimatorBase* theEstimator,
118  const TransientTrackingRecHitBuilder * theTTRHBuilder) const {return true;}
119  virtual void fillSeedHistoDebugger(std::vector<TrajectoryMeasurement>::iterator begin,
120  std::vector<TrajectoryMeasurement>::iterator end) const {;}
121 
122  protected:
123 
124  TempTrajectory createStartingTrajectory( const TrajectorySeed& seed) const;
125 
127  // If inOut is true, this is being called part-way through tracking, after the in-out tracking phase is complete.
128  // If inOut is false, it is called at the end of tracking.
129  bool toBeContinued( TempTrajectory& traj, bool inOut = false) const;
130 
132  bool qualityFilter( const TempTrajectory& traj, bool inOut = false) const;
133 
134  void addToResult(boost::shared_ptr<const TrajectorySeed> const & seed, TempTrajectory& traj, TrajectoryContainer& result, bool inOut = false) const;
135  void addToResult( TempTrajectory const& traj, TempTrajectoryContainer& result, bool inOut = false) const;
136  void moveToResult( TempTrajectory&& traj, TempTrajectoryContainer& result, bool inOut = false) const;
137 
138  StateAndLayers findStateAndLayers(const TrajectorySeed& seed, const TempTrajectory& traj) const;
139  StateAndLayers findStateAndLayers(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
TrajectoryContainer::iterator TrajectoryIterator
const TransientTrackingRecHitBuilder * hitBuilder() const
int iEvent
Definition: GenABIO.cc:230
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:37
virtual TempTrajectory buildTrajectories(const TrajectorySeed &seed, TrajectoryContainer &ret, const TrajectoryFilter *) const
const std::string thePropagatorAlongName
const MeasurementTrackerEvent * theMeasurementTracker
std::vector< TempTrajectory > TempTrajectoryContainer
void setNavigationSchool(NavigationSchool const *nv)
const Propagator * thePropagatorOpposite
#define begin
Definition: vmac.h:30
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