Newer
Older
TB_Chris / TbKernel / src / .svn / text-base / TbDataSvc.h.svn-base
  1. #ifndef TBPIXELSVC_H
  2. #define TBPIXELSVC_H
  3.  
  4. // Gaudi
  5. #include "GaudiKernel/Service.h"
  6. #include "GaudiKernel/Bootstrap.h"
  7. #include "GaudiKernel/MsgStream.h"
  8.  
  9. // Local
  10. #include "TbKernel/ITbDataSvc.h"
  11. #include <stdint.h>
  12.  
  13. template <class TYPE>
  14. class SvcFactory;
  15.  
  16. /** @class TbDataSvc TbDataSvc.h
  17. *
  18. * Implementation of the Testbeam data / configuration lookup services
  19. * for use with EOS
  20. */
  21.  
  22. class TbDataSvc : public extends1<Service, ITbDataSvc> {
  23.  
  24. public:
  25. /// Constructor
  26. TbDataSvc(const std::string& name, ISvcLocator* svc);
  27. /// Destructor
  28. virtual ~TbDataSvc();
  29.  
  30. virtual StatusCode initialize();
  31. virtual StatusCode finalize();
  32.  
  33. virtual const std::vector<std::string>& getInputFiles() {
  34. return m_inputFiles;
  35. }
  36. virtual const std::vector<std::string>& getPixelConfig() {
  37. return m_pixelFiles;
  38. }
  39. virtual const std::string& getTimingConfig() { return m_timingFile; }
  40. virtual const std::string& getAlignmentFile() { return m_alignmentFile; }
  41. virtual const std::vector<std::string>& getEtaConfig() {
  42. return m_etaFiles;
  43. }
  44.  
  45. private:
  46. /// Allow SvcFactory to instantiate the service.
  47. friend class SvcFactory<TbDataSvc>;
  48.  
  49. std::vector<std::string> m_inputs;
  50. std::vector<std::string> m_inputFiles;
  51. std::vector<std::string> m_pixelFiles;
  52. std::string m_alignmentFile;
  53. std::string m_timingFile;
  54. std::vector<std::string> m_etaFiles;
  55.  
  56. /// Pointer to message stream
  57. mutable MsgStream* m_msg = nullptr;
  58. /// On-demand access to message stream
  59. MsgStream& msg() const {
  60. if (!m_msg) m_msg = new MsgStream(msgSvc(), name());
  61. return *m_msg;
  62. }
  63. /// Add the prefix for reading network files.
  64. std::string expandPath(const std::string& fname);
  65. };
  66.  
  67. #endif