File indexing completed on 2024-09-12 04:16:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef tmEventSetup_L1TUtmTriggerMenu_hh
0012 #define tmEventSetup_L1TUtmTriggerMenu_hh
0013
0014 #include "CondFormats/L1TObjects/interface/L1TUtmScale.h"
0015 #include "CondFormats/L1TObjects/interface/L1TUtmCondition.h"
0016 #include "CondFormats/L1TObjects/interface/L1TUtmAlgorithm.h"
0017 #include "CondFormats/Serialization/interface/Serializable.h"
0018
0019 #include "tmEventSetup/esTriggerMenu.hh"
0020
0021 #include <map>
0022 #include <string>
0023
0024
0025
0026
0027 class L1TUtmTriggerMenu {
0028 public:
0029 L1TUtmTriggerMenu()
0030 : algorithm_map_(),
0031 condition_map_(),
0032 scale_map_(),
0033 external_map_(),
0034 token_to_condition_(),
0035 name_(),
0036 version_(),
0037 comment_(),
0038 datetime_(),
0039 uuid_firmware_(),
0040 scale_set_name_(),
0041 n_modules_(),
0042 version(0) {}
0043 L1TUtmTriggerMenu(std::map<std::string, L1TUtmAlgorithm> algorithm_map,
0044 std::map<std::string, L1TUtmCondition> condition_map,
0045 std::map<std::string, L1TUtmScale> scale_map,
0046 std::string name,
0047 std::string ver_s,
0048 std::string comment,
0049 std::string datetime,
0050 std::string uuid_firmware,
0051 std::string scale_set_name,
0052 unsigned int n_modules,
0053 unsigned int ver_i)
0054 : algorithm_map_(algorithm_map),
0055 condition_map_(condition_map),
0056 scale_map_(scale_map),
0057 external_map_(),
0058 token_to_condition_(),
0059 name_(name),
0060 version_(ver_s),
0061 comment_(comment),
0062 datetime_(datetime),
0063 uuid_firmware_(uuid_firmware),
0064 scale_set_name_(scale_set_name),
0065 n_modules_(n_modules),
0066 version(ver_i) {}
0067
0068 L1TUtmTriggerMenu(const tmeventsetup::esTriggerMenu& esMenu)
0069 : external_map_(),
0070 token_to_condition_(),
0071 name_(esMenu.getName()),
0072 version_(esMenu.getVersion()),
0073 comment_(esMenu.getComment()),
0074 datetime_(esMenu.getDatetime()),
0075 uuid_firmware_(esMenu.getFirmwareUuid()),
0076 scale_set_name_(esMenu.getScaleSetName()),
0077 n_modules_(esMenu.getNmodules()),
0078 version(0) {
0079 for (const auto& it : esMenu.getAlgorithmMap())
0080 algorithm_map_.emplace(std::make_pair(it.first, L1TUtmAlgorithm(it.second)));
0081 for (const auto& it : esMenu.getConditionMap())
0082 condition_map_.emplace(std::make_pair(it.first, L1TUtmCondition(it.second)));
0083 for (const auto& it : esMenu.getScaleMap())
0084 scale_map_.emplace(std::make_pair(it.first, L1TUtmScale(it.second)));
0085 };
0086
0087 virtual ~L1TUtmTriggerMenu() = default;
0088
0089
0090
0091
0092
0093 const std::map<std::string, L1TUtmAlgorithm>& getAlgorithmMap() const { return algorithm_map_; };
0094
0095
0096
0097
0098
0099 const std::map<std::string, L1TUtmCondition>& getConditionMap() const { return condition_map_; };
0100
0101
0102
0103
0104
0105 const std::map<std::string, L1TUtmScale>& getScaleMap() const { return scale_map_; };
0106
0107
0108
0109
0110
0111 const std::string& getName() const { return name_; };
0112
0113
0114
0115
0116
0117 const std::string& getVersion() const { return version_; };
0118
0119
0120
0121
0122
0123 const std::string& getComment() const { return comment_; };
0124
0125
0126
0127
0128
0129 const std::string& getDatetime() const { return datetime_; };
0130
0131
0132
0133
0134
0135 const std::string& getFirmwareUuid() const { return uuid_firmware_; };
0136
0137
0138
0139
0140
0141 const unsigned long getFirmwareUuidHashed() const;
0142
0143
0144
0145
0146
0147 const std::string& getScaleSetName() const { return scale_set_name_; };
0148
0149
0150
0151
0152
0153 const unsigned int getNmodules() const { return n_modules_; };
0154
0155
0156
0157
0158
0159 void setName(const std::string& value) { name_ = value; };
0160
0161
0162
0163
0164
0165 void setVersion(const std::string& value) { version_ = value; };
0166
0167
0168
0169
0170
0171 void setComment(const std::string& value) { comment_ = value; };
0172
0173
0174
0175
0176
0177 void setDatetime(const std::string& value) { datetime_ = value; };
0178
0179
0180
0181
0182
0183 void setFirmwareUuid(const std::string& value) { uuid_firmware_ = value; };
0184
0185
0186
0187
0188
0189 void setScaleSetName(const std::string& value) { scale_set_name_ = value; };
0190
0191
0192
0193
0194
0195 void setNmodules(const unsigned int value) { n_modules_ = value; };
0196
0197
0198
0199
0200
0201 static unsigned long murmurHashNeutral2(const void* key, int len, unsigned int seed);
0202
0203 protected:
0204 std::map<std::string, L1TUtmAlgorithm> algorithm_map_;
0205 std::map<std::string, L1TUtmCondition> condition_map_;
0206 std::map<std::string, L1TUtmScale> scale_map_;
0207 std::map<std::string, unsigned int> external_map_;
0208 std::map<std::string, std::string>
0209 token_to_condition_;
0210 std::string name_;
0211 std::string version_;
0212 std::string comment_;
0213 std::string datetime_;
0214 std::string uuid_firmware_;
0215 std::string scale_set_name_;
0216 unsigned int n_modules_;
0217 unsigned int version;
0218 COND_SERIALIZABLE;
0219 };
0220
0221 #endif