Newer
Older
TB_Chris / TbSimulation / src / .svn / text-base / TbTrackFitter.h.svn-base
  1. #ifndef TB_TRACKFITTER_H
  2. #define TB_TRACKFITTER_H 1
  3.  
  4. #include "TH1.h"
  5. #include "TH2.h"
  6.  
  7. #include "GaudiAlg/GaudiTupleAlg.h"
  8. #include "GaudiKernel/RndmGenerators.h"
  9.  
  10. #include "TbKernel/ITbGeometrySvc.h"
  11. #include "TbKernel/ITbTrackFit.h"
  12.  
  13.  
  14. /** @class TbTrackFitter TbTrackFitter.h
  15. * Author: Panagiotis Tsopelas
  16. */
  17.  
  18. class TbTrackFitter : public GaudiTupleAlg {
  19. public:
  20. TbTrackFitter(const std::string& name, ISvcLocator* pSvcLocator);
  21. virtual ~TbTrackFitter() {}
  22.  
  23. virtual StatusCode initialize(); ///< Algorithm initialization
  24. virtual StatusCode execute(); ///< Algorithm execution
  25.  
  26. private:
  27. Rndm::Numbers m_gauss;
  28.  
  29. bool m_onOff_hists;
  30. unsigned int m_nPlanes;
  31.  
  32. ITbTrackFit* m_trackFit;
  33. double m_scat2;
  34. double m_hiterror2;
  35. double m_theta0;
  36. int m_direction;
  37. double sigmax;
  38. double sigmay;
  39. double scatRx0[8];
  40. double scatRy0[8];
  41. mutable ITbGeometrySvc* m_geomSvc; /// Access geometry service on-demand
  42. ITbGeometrySvc* geomSvc() const {
  43. if (!m_geomSvc) m_geomSvc = svc<ITbGeometrySvc>("TbGeometrySvc", true);
  44. return m_geomSvc;
  45. }
  46.  
  47. // Histograms
  48. TH1D* m_clustersX;
  49. TH1D* m_clustersY;
  50. // straight line fit
  51. TH1D* m_Sfit_chi2;
  52. TH1D* m_Sfit_prob;
  53.  
  54. TH1D* m_slopesX;
  55. TH1D* m_slopesY;
  56.  
  57. std::vector<TH1D*> m_resSfit_X;
  58. std::vector<TH1D*> m_resSfit_Y;
  59. std::vector<TH1D*> m_trueSfit_X;
  60. std::vector<TH1D*> m_trueSfit_Y;
  61. std::vector<TH1D*> m_respullSfit_X;
  62. std::vector<TH1D*> m_respullSfit_Y;
  63. std::vector<TH1D*> m_trackpullSfit_X;
  64. std::vector<TH1D*> m_trackpullSfit_Y;
  65.  
  66.  
  67. // Kalman filter
  68. TH1D* m_Kfit_chi2;
  69. TH1D* m_Kfit_prob;
  70. // unbiased residuals
  71. std::vector<TH1D*> m_XunresKfit;
  72. std::vector<TH1D*> m_YunresKfit;
  73. std::vector<TH1D*> m_resKfit_X;
  74. std::vector<TH1D*> m_resKfit_Y;
  75.  
  76. std::vector<TH1D*> m_reserrKfit_X;
  77. std::vector<TH1D*> m_reserrKfit_Y;
  78.  
  79. std::vector<TH1D*> m_respullKfit_X;
  80. std::vector<TH1D*> m_respullKfit_Y;
  81.  
  82. std::vector<TH1D*> m_trueKfit_X;
  83. std::vector<TH1D*> m_trueKfit_Y;
  84.  
  85. std::vector<TH1D*> m_trueerrKfit_X;
  86. std::vector<TH1D*> m_trueerrKfit_Y;
  87.  
  88. std::vector<TH1D*> m_trackpullKfit_X;
  89. std::vector<TH1D*> m_trackpullKfit_Y;
  90.  
  91.  
  92. // Histograms functions
  93. void setup_hists();
  94. void fill_hists(std::vector<LHCb::TbTrack*>&);
  95. void fill_khists(std::vector<LHCb::TbKalmanTrack*>&);
  96.  
  97. // Modifiers and Accessors
  98.  
  99. void setNPlanes(unsigned int nplanes) { m_nPlanes = nplanes; }
  100. int nPlanes() { return m_nPlanes; }
  101.  
  102. bool onOff_hists() { return m_onOff_hists; }
  103. };
  104. #endif