Newer
Older
TB_Chris / TbAlgorithms / src / .svn / text-base / TbSimpleTracking.h.svn-base
  1. #ifndef TB_SIMPLETRACKING_H
  2. #define TB_SIMPLETRACKING_H 1
  3.  
  4. // Tb/TbEvent
  5. #include "Event/TbCluster.h"
  6. #include "Event/TbTrack.h"
  7.  
  8. // Tb/TbKernel
  9. #include "TbKernel/ITbTrackFit.h"
  10. #include "TbKernel/TbAlgorithm.h"
  11.  
  12. /** @class TbSimpleTracking TbSimpleTracking.h
  13. *
  14. */
  15.  
  16. class TbSimpleTracking : public TbAlgorithm {
  17. public:
  18. /// Constructor
  19. TbSimpleTracking(const std::string &name, ISvcLocator *pSvcLocator);
  20. /// Destructor
  21. virtual ~TbSimpleTracking() {}
  22.  
  23. virtual StatusCode initialize(); ///< Algorithm initialization
  24. virtual StatusCode execute(); ///< Algorithm execution
  25.  
  26. private:
  27. /// TES location prefix of clusters
  28. std::string m_clusterLocation;
  29. /// TES location of tracks
  30. std::string m_trackLocation;
  31.  
  32. /// Tolerance window in time for adding clusters to a track and for occupancy
  33. /// cut
  34. double m_timeWindow;
  35. /// Minimum number of clusters required to form a track
  36. unsigned int m_nMinPlanes;
  37. /// Number of non-masked planes
  38. unsigned int m_nMaxPlanes;
  39. /// Tolerance window in x and y for adding clusters to a track
  40. double m_maxDist;
  41. /// Angular cut (in radians) for adding clusters to a track
  42. double m_maxAngle;
  43.  
  44. /// List of clusters
  45. std::vector<LHCb::TbClusters *> m_clusters;
  46.  
  47. /// Name of the track fit tool
  48. std::string m_trackFitTool;
  49. /// Track fit tool
  50. ITbTrackFit *m_trackFit;
  51.  
  52. bool m_recheckTrack;
  53. bool m_removeOutliers;
  54. double m_chargeCutLow;
  55. unsigned int m_maxClusterSize;
  56. unsigned int m_maxClusterWidth;
  57. unsigned int m_maxOccupancy;
  58. std::vector<double> m_htimesHighOccupancy;
  59. bool m_doOccupancyCut;
  60. bool m_monitoring;
  61.  
  62. void findHighOccupancies();
  63. bool lowClusterOccupancy(const double t) const;
  64. void appendTrackingEfficiencies();
  65. void recheckTrack(LHCb::TbTrack *track);
  66. /// Extrapolate and add clusters to a given seed track.
  67. bool extendTrack(LHCb::TbTrack *track, const bool fwd);
  68. /// Look for a matching cluster on a given plane.
  69. const LHCb::TbCluster *bestCluster(const unsigned int plane,
  70. const double xPred, const double yPred,
  71. const double tPred, const double tol);
  72. /// Functor for lower bound search.
  73. class lowerBound {
  74. public:
  75. bool operator()(const LHCb::TbCluster *lhs, const double t) const {
  76. return lhs->htime() < t;
  77. }
  78. };
  79. };
  80. #endif