00001 #ifndef GlobalTriggerAnalyzer_L1GtPatternWriter_h 00002 #define GlobalTriggerAnalyzer_L1GtPatternWriter_h 00003 00020 #include <iosfwd> 00021 #include <string> 00022 #include <vector> 00023 #include <boost/cstdint.hpp> 00024 00025 class L1GtPatternMap; 00026 class L1GtPatternLine; 00027 00030 class L1GtPatternWriter { 00031 public: 00043 L1GtPatternWriter(std::ostream& destination, const std::string& header, 00044 const std::string& footer, const std::vector<std::string> columns, 00045 const std::vector<boost::uint32_t>& lengths, 00046 const std::vector<boost::uint32_t>& defaultValues, 00047 const std::vector<int>& bx, 00048 bool debug = false); 00049 00051 void writePatterns(const L1GtPatternMap& patterns); 00052 00054 virtual void writePatternLine(const L1GtPatternLine& line); 00055 00057 void close(); 00058 00059 virtual ~L1GtPatternWriter(); 00060 protected: 00063 static boost::uint32_t mask(boost::uint32_t length); 00064 00065 00066 private: 00067 std::ostream& m_dest; 00068 std::string m_header; 00069 std::string m_footer; 00070 std::vector<std::string> m_columns; 00071 std::vector<boost::uint32_t> m_lengths; 00072 std::vector<boost::uint32_t> m_defaults; 00073 std::vector<int> m_bx; 00074 bool m_debug; 00075 00076 boost::uint32_t m_lineNo; 00077 }; 00078 00079 00080 #endif /*GlobalTriggerAnalyzer_L1GtPatternWriter_h*/