File indexing completed on 2024-04-06 12:28:03
0001 #ifndef CkfDebugTrajectoryBuilder_H
0002 #define CkfDebugTrajectoryBuilder_H
0003
0004 #include "RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h"
0005 #include "CkfDebugger.h"
0006 #include "TrackingTools/PatternTools/interface/TempTrajectory.h"
0007 #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h"
0008
0009 class CkfDebugTrajectoryBuilder : public CkfTrajectoryBuilder {
0010 public:
0011 CkfDebugTrajectoryBuilder(const edm::ParameterSet& conf, edm::ConsumesCollector iC)
0012 : CkfTrajectoryBuilder(conf, iC, std::unique_ptr<TrajectoryFilter>{}) {
0013
0014 }
0015
0016 void setDebugger(CkfDebugger* dbg) const override { theDbg = dbg; }
0017 virtual CkfDebugger* debugger() const { return theDbg; }
0018
0019 private:
0020 mutable CkfDebugger* theDbg;
0021 bool analyzeMeasurementsDebugger(TempTrajectory& traj,
0022 const std::vector<TM>& meas,
0023 const MeasurementTrackerEvent* theMeasurementTracker,
0024 const Propagator* theForwardPropagator,
0025 const Chi2MeasurementEstimatorBase* theEstimator,
0026 const TransientTrackingRecHitBuilder* theTTRHBuilder) const override {
0027 return theDbg->analyseCompatibleMeasurements(
0028 traj.toTrajectory(), meas, theMeasurementTracker, theForwardPropagator, theEstimator, theTTRHBuilder);
0029 };
0030 bool analyzeMeasurementsDebugger(Trajectory& traj,
0031 const std::vector<TM>& meas,
0032 const MeasurementTrackerEvent* theMeasurementTracker,
0033 const Propagator* theForwardPropagator,
0034 const Chi2MeasurementEstimatorBase* theEstimator,
0035 const TransientTrackingRecHitBuilder* theTTRHBuilder) const override {
0036 return theDbg->analyseCompatibleMeasurements(
0037 traj, meas, theMeasurementTracker, theForwardPropagator, theEstimator, theTTRHBuilder);
0038 };
0039 void fillSeedHistoDebugger(std::vector<TrajectoryMeasurement>::iterator begin,
0040 std::vector<TrajectoryMeasurement>::iterator end) const override {
0041
0042 if (end - begin >= 2)
0043 theDbg->fillSeedHist(begin->recHit(), (begin + 1)->recHit(), (begin + 1)->updatedState());
0044 };
0045 };
0046 #endif