Newer
Older
TB_Chris / TbAlgorithms / src / .svn / text-base / TbTracking.h.svn-base
  1. #ifndef TB_TRACKING_H
  2. #define TB_TRACKING_H 1
  3.  
  4. // Tb/TbKernel
  5. #include "TbKernel/ITbTrackFit.h"
  6. #include "TbKernel/ITbClusterFinder.h"
  7. #include "TbKernel/TbAlgorithm.h"
  8.  
  9. // Tb/TbEvent
  10. #include "Event/TbCluster.h"
  11. #include "Event/TbTrack.h"
  12.  
  13. // Local
  14. #include "TbTrackVolume.h"
  15.  
  16. /** @class TbTracking TbTracking.h
  17. *
  18. * Algorithm for track reconstruction in Timepix3 telescope
  19. *
  20. * @author Dan Saunders
  21. */
  22.  
  23. class TbTracking : public TbAlgorithm {
  24. public:
  25. /// Constructor
  26. TbTracking(const std::string &name, ISvcLocator *pSvcLocator);
  27. /// Destructor
  28. virtual ~TbTracking();
  29.  
  30. virtual StatusCode initialize(); ///< Algorithm initialization
  31. virtual StatusCode execute(); ///< Algorithm execution
  32.  
  33. private:
  34. /// Track container (to be filled).
  35. LHCb::TbTracks *m_tracks;
  36.  
  37. /// Name of the track fit tool
  38. std::string m_trackFitTool;
  39. /// Track fit tool
  40. ITbTrackFit *m_trackFit;
  41. /// Tool to find particular clusters.
  42. ITbClusterFinder *m_clusterFinder;
  43. /// Tool for evaluating seed tracks.
  44. TbTrackVolume *m_trackVolume;
  45.  
  46. /// TES location prefix of cluster containers.
  47. std::string m_clusterLocation;
  48. /// TES location prefix of track containers.
  49. std::string m_trackLocation;
  50.  
  51. /// Flag to fill (or not) monitoring histograms.
  52. bool m_monitoring;
  53. /// Time width (in ns) of search window around seed cluster.
  54. double m_twindow;
  55. /// Minimum number of clusters to form a track.
  56. unsigned int m_MinNClusters;
  57. /// Spatial shapes of TbTrackVolumes {cylinder, diabolo}.
  58. std::string m_search_3vol;
  59. /// Spatial shape parameter.
  60. double m_vol_radius;
  61. /// Spatial shape parameter.
  62. double m_vol_theta;
  63. /// Chi2 cut.
  64. double m_ChiSqRedCut;
  65. /// Upper cut on the number of combinations to try in a TbTrackVolume.
  66. /// Useful for speed, and rarely used; set O(100).
  67. unsigned int m_nComboCut;
  68. /// Search algorithm used to fill TbTrackVolumes - {"seq", "adap_seq"}.
  69. /// "adap_seq" recommended.
  70. std::string m_ClusterFinderSearchAlgorithm;
  71.  
  72. /// For certain volumes, it's advantageous to use seeds from the center of
  73. /// the telescope, so the order of the search can be specified here.
  74. std::vector<unsigned int> m_PlaneSearchOrder;
  75. /// Max. size of clusters on a track
  76. unsigned int m_clusterSizeCut;
  77.  
  78. std::vector<std::vector<bool> > m_volumed;
  79. // Viewer options.
  80. bool m_viewerOutput;
  81. unsigned int m_viewerEvent;
  82. unsigned int m_event;
  83. bool m_combatRun;
  84.  
  85. void outputViewerData();
  86. void performTracking();
  87. void fillTrackVolume(LHCb::TbCluster *seed, const unsigned int &planeLow,
  88. const unsigned int &planeUp);
  89. void evaluateTrackVolume(TbTrackVolume *vol);
  90. void timeOrderTracks();
  91. void fillTrackVolPlots(TbTrackVolume *vol);
  92. };
  93. #endif