File indexing completed on 2024-09-12 04:16:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef tmEventSetup_L1TUtmObject_hh
0011 #define tmEventSetup_L1TUtmObject_hh
0012
0013 #include "CondFormats/L1TObjects/interface/L1TUtmCut.h"
0014 #include "CondFormats/Serialization/interface/Serializable.h"
0015
0016 #include "tmEventSetup/esObject.hh"
0017
0018 #include <limits>
0019 #include <string>
0020 #include <vector>
0021
0022
0023
0024
0025 class L1TUtmObject {
0026 public:
0027 L1TUtmObject()
0028 : name_(),
0029 type_(),
0030 comparison_operator_(),
0031 bx_offset_(),
0032 threshold_(),
0033 ext_signal_name_(),
0034 ext_channel_id_(std::numeric_limits<unsigned int>::max()),
0035 cuts_(),
0036 version(0) {}
0037 L1TUtmObject(std::string name,
0038 int type,
0039 int comparison_operator,
0040 int bx_offset,
0041 double threshold,
0042 std::string ext_signal_name,
0043 unsigned int ext_channel_id,
0044 std::vector<L1TUtmCut> cuts,
0045 unsigned int vers)
0046 : name_(name),
0047 type_(type),
0048 comparison_operator_(comparison_operator),
0049 bx_offset_(bx_offset),
0050 threshold_(threshold),
0051 ext_signal_name_(ext_signal_name),
0052 ext_channel_id_(ext_channel_id),
0053 cuts_(cuts),
0054 version(vers) {}
0055
0056 L1TUtmObject(const tmeventsetup::esObject& esObj)
0057 : name_(esObj.getName()),
0058 type_(esObj.getType()),
0059 comparison_operator_(esObj.getComparisonOperator()),
0060 bx_offset_(esObj.getBxOffset()),
0061 threshold_(esObj.getThreshold()),
0062 ext_signal_name_(esObj.getExternalSignalName()),
0063 ext_channel_id_(esObj.getExternalChannelId()),
0064 version(0) {
0065 cuts_.reserve(esObj.getCuts().size());
0066 for (auto it = esObj.getCuts().begin(); it != esObj.getCuts().end(); ++it)
0067 cuts_.emplace_back(L1TUtmCut(*it));
0068 };
0069
0070 virtual ~L1TUtmObject() = default;
0071
0072
0073 void setName(const std::string& x) { name_ = x; };
0074
0075
0076 void setType(const int x) { type_ = x; };
0077
0078
0079 void setComparisonOperator(const int x) { comparison_operator_ = x; };
0080
0081
0082 void setBxOffset(const int x) { bx_offset_ = x; };
0083
0084
0085 void setThreshold(double x) { threshold_ = x; };
0086
0087
0088 void setExternalSignalName(const std::string& x) { ext_signal_name_ = x; };
0089
0090
0091 void setExternalChannelId(const unsigned int x) { ext_channel_id_ = x; };
0092
0093
0094 void setCuts(const std::vector<L1TUtmCut>& x) { cuts_ = x; };
0095
0096
0097 const std::string& getName() const { return name_; };
0098
0099
0100 const int getType() const { return type_; };
0101
0102
0103 const int getComparisonOperator() const { return comparison_operator_; };
0104
0105
0106 const int getBxOffset() const { return bx_offset_; };
0107
0108
0109 const double getThreshold() const { return threshold_; };
0110
0111
0112 const std::string& getExternalSignalName() const { return ext_signal_name_; };
0113
0114
0115 const unsigned int getExternalChannelId() const { return ext_channel_id_; };
0116
0117
0118 const std::vector<L1TUtmCut>& getCuts() const { return cuts_; };
0119
0120 protected:
0121 std::string name_;
0122 int type_;
0123 int comparison_operator_;
0124 int bx_offset_;
0125 double threshold_;
0126 std::string ext_signal_name_;
0127 unsigned int ext_channel_id_;
0128 std::vector<L1TUtmCut> cuts_;
0129 unsigned int version;
0130 COND_SERIALIZABLE;
0131 };
0132
0133 #endif