Newer
Older
TB_Chris / TbUT / src / .svn / text-base / TbUTNTupleCreator.h.svn-base
  1.  
  2. #pragma once
  3.  
  4. #include "GaudiAlg/GaudiTupleAlg.h"
  5. #include "TbUTRawData.h"
  6. #include "TbUTCluster.h"
  7.  
  8. #include <string>
  9. #include <stdexcept>
  10.  
  11.  
  12. namespace TbUT
  13. {
  14. class NTupleCreator : public GaudiTupleAlg {
  15.  
  16. class DataError: public std::runtime_error
  17. {
  18. public:
  19. DataError(const std::string& err) :
  20. std::runtime_error(err)
  21. {
  22. }
  23. };
  24.  
  25. public:
  26. NTupleCreator(const std::string& name, ISvcLocator* pSvcLocator);
  27.  
  28. virtual StatusCode initialize();
  29. virtual StatusCode execute();
  30.  
  31. private:
  32. void bookRawData();
  33. void bookHeaderData();
  34. void bookPedestal();
  35. void bookCMS();
  36. void bookClusters();
  37.  
  38.  
  39. void fillRawData();
  40. void fillHeaderData();
  41. void fillPedestal();
  42. void fillCMS();
  43. void fillClusters();
  44. template <typename DATA_TYPE = int>
  45. RawDataContainer<DATA_TYPE>* getDataFromTES(const std::string& p_location);
  46. ClusterContainer* getClustersFromTES();
  47.  
  48. int m_eventNumber;
  49. int m_storeEventNumber;
  50. bool m_isRawWritten;
  51. bool m_isHeaderWritten;
  52. bool m_isPedestalWritten;
  53. bool m_isCMSWritten;
  54. bool m_isClusterWritten;
  55.  
  56. std::string m_rawLocation;
  57. std::string m_pedestalLocation;
  58. std::string m_cmsLocation;
  59. std::string m_clusterLocation;
  60. std::string m_headerLocation;
  61. NTuple::Array<double> m_rawSignal;
  62. NTuple::Array<double> m_header0Signal;
  63. NTuple::Array<double> m_header1Signal;
  64. NTuple::Array<double> m_header2Signal;
  65. NTuple::Array<double> m_header3Signal;
  66. NTuple::Array<double> m_header3P1Signal;
  67. NTuple::Array<double> m_header3P2Signal;
  68. NTuple::Array<double> m_pedestalSignal;
  69. NTuple::Array<double> m_cmsSignal;
  70.  
  71. NTuple::Item<int> m_clusterNumberPerEvent;
  72. NTuple::Item<unsigned int> m_tdc;
  73. NTuple::Item<unsigned long long> m_timestamp;
  74.  
  75. NTuple::Array<double> m_clusterPosition;
  76. NTuple::Array<int> m_clusterSize;
  77. NTuple::Array<int> m_clusterSeedPosition;
  78. NTuple::Array<double> m_clusterCharge;
  79. NTuple::Array<double> m_clusterSeedCharge;
  80. NTuple::Array<double> m_clusterCharge2StripLeft;
  81. NTuple::Array<double> m_clusterCharge1StripLeft;
  82. NTuple::Array<double> m_clusterCharge2StripRight;
  83. NTuple::Array<double> m_clusterCharge1StripRight;
  84.  
  85. };
  86.  
  87. }