File indexing completed on 2024-04-06 12:22:18
0001 #ifndef L1GtConfigProducers_L1GtVmeWriterCore_h
0002 #define L1GtConfigProducers_L1GtVmeWriterCore_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <string>
0022 #include <vector>
0023
0024
0025 #include "L1TriggerConfig/L1GtConfigProducers/interface/L1GtXmlParserTags.h"
0026 #include "L1TriggerConfig/L1GtConfigProducers/interface/L1GtVhdlTemplateFile.h"
0027
0028 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h"
0029 #include "CondFormats/L1TObjects/interface/L1GtFwd.h"
0030
0031
0032
0033
0034 class L1GtVmeWriterCore : public L1GtXmlParserTags {
0035 public:
0036
0037 L1GtVmeWriterCore(const std::string &outputDir, const std::string &vmeXmlFile);
0038
0039
0040 ~L1GtVmeWriterCore() override;
0041
0042 void writeVME(const std::vector<ConditionMap> &conditionMap,
0043 const std::map<std::string, int> &cond2intMap,
0044 const L1GtVhdlTemplateFile &header,
0045 const int spacesPerLevel = 2);
0046
0047
0048 std::string openTag(const std::string &tag);
0049
0050
0051 std::string closeTag(const std::string &tag);
0052
0053
0054 std::string spaces(const unsigned int &level);
0055
0056
0057 std::string vmeAddrValueBlock(const std::string &addr,
0058 const int &val,
0059 const int &spaceLevel,
0060 const bool setMsb = false);
0061
0062
0063
0064 int condIndex2reg(const unsigned int &index);
0065
0066
0067 std::string calculateAddress(const L1GtObject &obj,
0068 const L1GtConditionType &type,
0069 const std::string ®,
0070 const int &index);
0071
0072
0073 std::string calculateJetsAddress(const int &countIndex, const int &obj, const int &index);
0074
0075 private:
0076
0077 std::string m_outputDir;
0078
0079
0080 std::string m_vmeXmlFile;
0081
0082 std::map<L1GtObject, int> object2reg_;
0083
0084 std::map<L1GtConditionType, int> type2reg_;
0085
0086 std::map<std::string, int> reg2hex_;
0087
0088 std::map<int, int> jetType2reg_;
0089
0090 std::map<int, int> jetObj2reg_;
0091
0092 int spacesPerLevel_;
0093 };
0094
0095 #endif