File indexing completed on 2024-09-12 04:16:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef tmEventSetup_L1TUtmCondition_hh
0011 #define tmEventSetup_L1TUtmCondition_hh
0012
0013 #include "CondFormats/L1TObjects/interface/L1TUtmCut.h"
0014 #include "CondFormats/L1TObjects/interface/L1TUtmObject.h"
0015 #include "CondFormats/Serialization/interface/Serializable.h"
0016
0017 #include "tmEventSetup/esCondition.hh"
0018
0019 #include <string>
0020 #include <vector>
0021
0022
0023
0024
0025 class L1TUtmCondition {
0026 public:
0027 L1TUtmCondition() : name_(), type_(-9999), objects_(), cuts_(), version(0) {}
0028 L1TUtmCondition(
0029 std::string name, int type, std::vector<L1TUtmObject> objects, std::vector<L1TUtmCut> cuts, unsigned int vers)
0030 : name_(name), type_(type), objects_(objects), cuts_(cuts), version(vers) {}
0031
0032 L1TUtmCondition(const tmeventsetup::esCondition& esCond)
0033 : name_(esCond.getName()), type_(esCond.getType()), version(0) {
0034 objects_.reserve(esCond.getObjects().size());
0035 for (auto it = esCond.getObjects().begin(); it != esCond.getObjects().end(); ++it)
0036 objects_.emplace_back(L1TUtmObject(*it));
0037 cuts_.reserve(esCond.getCuts().size());
0038 for (auto it = esCond.getCuts().begin(); it != esCond.getCuts().end(); ++it)
0039 cuts_.emplace_back(L1TUtmCut(*it));
0040 };
0041
0042 virtual ~L1TUtmCondition() = default;
0043
0044
0045 void setName(const std::string& x) { name_ = x; };
0046
0047
0048 void setType(const int x) { type_ = x; };
0049
0050
0051 const std::string& getName() const { return name_; };
0052
0053
0054 const int getType() const { return type_; };
0055
0056
0057 const std::vector<L1TUtmObject>& getObjects() const { return objects_; };
0058
0059
0060 const std::vector<L1TUtmCut>& getCuts() const { return cuts_; };
0061
0062 protected:
0063 std::string name_;
0064 int type_;
0065 std::vector<L1TUtmObject> objects_;
0066 std::vector<L1TUtmCut> cuts_;
0067 unsigned int version;
0068 COND_SERIALIZABLE;
0069 };
0070
0071 #endif