File indexing completed on 2023-10-25 09:39:11
0001 #ifndef HLTReco_TriggerFilterObjectWithRefs_h
0002 #define HLTReco_TriggerFilterObjectWithRefs_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include "DataFormats/HLTReco/interface/TriggerRefsCollections.h"
0022 #include "FWCore/Utilities/interface/InputTag.h"
0023
0024 #include <string>
0025 #include <vector>
0026 #include <algorithm>
0027
0028 namespace trigger {
0029
0030
0031
0032
0033
0034
0035 class TriggerFilterObjectWithRefs : public TriggerRefsCollections {
0036
0037 private:
0038 int path_;
0039 int module_;
0040 std::vector<std::string> collectionTags_;
0041
0042
0043 public:
0044
0045 TriggerFilterObjectWithRefs() : TriggerRefsCollections(), path_(-9), module_(-9), collectionTags_() {}
0046
0047 TriggerFilterObjectWithRefs(int path, int module)
0048 : TriggerRefsCollections(), path_(path), module_(module), collectionTags_() {}
0049
0050
0051 int path() const { return path_; }
0052 int module() const { return module_; }
0053
0054
0055 void addCollectionTag(const edm::InputTag& collectionTag) { collectionTags_.push_back(collectionTag.encode()); }
0056
0057 void getCollectionTags(std::vector<edm::InputTag>& collectionTags) const {
0058 const trigger::size_type n(collectionTags_.size());
0059 collectionTags.resize(n);
0060 for (trigger::size_type i = 0; i != n; ++i) {
0061 collectionTags[i] = edm::InputTag(collectionTags_[i]);
0062 }
0063 }
0064
0065
0066 const std::vector<std::string>& getCollectionTagsAsStrings() const { return collectionTags_; }
0067
0068
0069 void swap(TriggerFilterObjectWithRefs& other) {
0070 TriggerRefsCollections::swap(other);
0071 std::swap(path_, other.path_);
0072 std::swap(module_, other.module_);
0073 std::swap(collectionTags_, other.collectionTags_);
0074 }
0075 };
0076
0077
0078 inline void swap(TriggerFilterObjectWithRefs& first, TriggerFilterObjectWithRefs& second) { first.swap(second); }
0079
0080 }
0081
0082 #endif