Newer
Older
TB_Chris / TbKernel / TbKernel / .svn / text-base / ITbGeometrySvc.h.svn-base
  1. #ifndef TBKERNEL_ITBGEOMETRYSVC_H
  2. #define TBKERNEL_ITBGEOMETRYSVC_H 1
  3.  
  4. #include "GaudiKernel/IService.h"
  5. #include "GaudiKernel/Point3DTypes.h"
  6. #include "GaudiKernel/Vector3DTypes.h"
  7.  
  8. /** @class ITbGeometrySvc ITbGeometrySvc.h
  9. *
  10. * Interface for the testbeam geometry service which holds
  11. * the geometric transformations between local and global coordinates
  12. * of the individual planes.
  13. *
  14. */
  15.  
  16. class TbModule;
  17. namespace LHCb {
  18. class TbTrack;
  19. }
  20.  
  21. class GAUDI_API ITbGeometrySvc : virtual public IService {
  22.  
  23. public:
  24. /// InterfaceID
  25. DeclareInterfaceID(ITbGeometrySvc, 1, 0);
  26.  
  27. /// Transform a point in the local frame of a plane to global coordinates
  28. virtual Gaudi::XYZPoint localToGlobal(const Gaudi::XYZPoint& p,
  29. const unsigned int i) = 0;
  30. /// Transform a point in the global frame to the local frame of a plane
  31. virtual Gaudi::XYZPoint globalToLocal(const Gaudi::XYZPoint& p,
  32. const unsigned int i) = 0;
  33.  
  34. /// Calculate the local x, y coordinates of a given pixel
  35. virtual bool pixelToPoint(const unsigned int scol, const unsigned int row,
  36. const unsigned int plane, double& x,
  37. double& y) = 0;
  38. /// Calculate the pixel and inter-pixel position of a given local point
  39. virtual bool pointToPixel(const double x, const double y,
  40. const unsigned int plane, unsigned int& scol,
  41. unsigned int& row) = 0;
  42.  
  43. /// Calculate the intercept of a track with a telescope plane
  44. virtual Gaudi::XYZPoint intercept(const LHCb::TbTrack* t,
  45. const unsigned int i) = 0;
  46.  
  47. virtual Gaudi::XYZPoint intercept(const Gaudi::XYZPoint& p,
  48. const Gaudi::XYZVector& t,
  49. const unsigned int i) = 0;
  50.  
  51. /// Return a pointer to the module object for a given plane index
  52. virtual TbModule* module(const unsigned int i) = 0;
  53. /// Return a pointer to the module object of a given plane identifier
  54. virtual TbModule* module(const std::string& det) = 0;
  55. /// Return the list of modules
  56. virtual const std::vector<TbModule*>& modules() = 0;
  57.  
  58. virtual unsigned int nDevices() const = 0;
  59.  
  60. virtual unsigned int deviceIndex(const std::string& det) = 0;
  61.  
  62. virtual unsigned int plane(const std::string& det) = 0;
  63.  
  64. virtual bool readConditions(const std::string& file,
  65. std::vector<TbModule*>& modules) = 0;
  66.  
  67. virtual void printAlignment(const std::vector<TbModule*>& modules) = 0;
  68.  
  69. virtual void setModule(unsigned int i, TbModule* module) = 0;
  70. };
  71.  
  72. #endif