Newer
Older
TB_Chris / TbUT / src / .svn / text-base / TbUTPedestalSubtractorAlgorithm.h.svn-base
  1. /*
  2. * TbUTPedestalSubtractorAlgorithm.h
  3. *
  4. * Created on: Oct 14, 2014
  5. * Author: ADendek
  6. */
  7.  
  8. #pragma once
  9. #include "GaudiAlg/GaudiAlgorithm.h"
  10.  
  11. #include "TbUTRawData.h"
  12. #include "TbUTPedestalFollowingFactory.h"
  13. #include "TbUTIPedestalFollowing.h"
  14. #include "TbUTPedestalSubtractor.h"
  15. #include "TbUTChannelMaskProvider.h"
  16. #include "TbUTChannelMaskFileValidator.h"
  17. #include "TbUTPedestal.h"
  18. #include "TbUTPedestalFileValidator.h"
  19.  
  20.  
  21. #include <string>
  22. #include <boost/shared_ptr.hpp>
  23.  
  24. namespace TbUT
  25. {
  26.  
  27. class PedestalSubtractorAlgorithm: public GaudiAlgorithm
  28. {
  29. typedef boost::shared_ptr<IPedestalFollowing> PedestalFollowingPtr;
  30.  
  31. enum RunPhase
  32. {
  33. SKIPP,
  34. TREANING,
  35. SUBTRACTION
  36. };
  37.  
  38. public:
  39. PedestalSubtractorAlgorithm(const std::string& name, ISvcLocator* pSvcLocator);
  40.  
  41. virtual StatusCode initialize();
  42. virtual StatusCode execute();
  43. virtual StatusCode finalize();
  44.  
  45. private:
  46.  
  47. StatusCode initializeBase();
  48. StatusCode buildFollowing();
  49. StatusCode retriveMasksFromFile();
  50.  
  51. void skippEvent();
  52. void processTreaning();
  53. void subtractPedestals();
  54. StatusCode getData();
  55. void processAndSaveDataToTES();
  56. StatusCode savePedestalsToFile();
  57.  
  58. RunPhase getRunPhase();
  59.  
  60. bool m_isStandalone;
  61. RawDataContainer<>* m_dataContainer;
  62. RawData<>* m_data;
  63. RawDataContainer<>* m_outputDataContainer;
  64.  
  65. std::string m_inputDataLocation;
  66. std::string m_outputDataLocation;
  67. std::string m_pedestalInputLocation;
  68. std::string m_pedestalOutputLocation;
  69. std::string m_channelMaskInputLocation;
  70. std::string m_followingOption;
  71. int m_event;
  72. int m_treningEventNumber;
  73. int m_skippEvent;
  74.  
  75. ChannelMaskFileValidator m_channelMaskFileValidator;
  76. ChannelMaskProvider m_channelMaskProvider;
  77. Pedestal m_pedestal;
  78. PedestalFileValidator m_pedestalFileValidator;
  79. PedestalFollowingFactory m_followingFactory;
  80. PedestalFollowingPtr m_pedestalFollowingPtr;
  81. PedestalSubtractor m_pedestalSubtractor;
  82.  
  83. };
  84.  
  85. }
  86.