File indexing completed on 2023-10-25 09:54:34
0001 #ifndef GlobalTriggerAnalyzer_L1GtPatternWriter_h
0002 #define GlobalTriggerAnalyzer_L1GtPatternWriter_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include <iosfwd>
0019 #include <string>
0020 #include <vector>
0021 #include <cstdint>
0022
0023 class L1GtPatternMap;
0024 class L1GtPatternLine;
0025
0026
0027
0028 class L1GtPatternWriter {
0029 public:
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 L1GtPatternWriter(std::ostream& destination,
0042 const std::string& header,
0043 const std::string& footer,
0044 const std::vector<std::string>& columns,
0045 const std::vector<uint32_t>& lengths,
0046 const std::vector<uint32_t>& defaultValues,
0047 const std::vector<int>& bx,
0048 bool debug = false);
0049
0050
0051 void writePatterns(const L1GtPatternMap& patterns);
0052
0053
0054 virtual void writePatternLine(const L1GtPatternLine& line);
0055
0056
0057 void close();
0058
0059 virtual ~L1GtPatternWriter();
0060
0061 protected:
0062
0063
0064 static uint32_t mask(uint32_t length);
0065
0066 private:
0067 std::ostream& m_dest;
0068 std::string m_header;
0069 std::string m_footer;
0070 std::vector<std::string> m_columns;
0071 std::vector<uint32_t> m_lengths;
0072 std::vector<uint32_t> m_defaults;
0073 std::vector<int> m_bx;
0074 bool m_debug;
0075
0076 uint32_t m_lineNo;
0077 };
0078
0079 #endif