CMS 3D CMS Logo

TriggerFilterObjectWithRefs.h
Go to the documentation of this file.
1 #ifndef HLTReco_TriggerFilterObjectWithRefs_h
2 #define HLTReco_TriggerFilterObjectWithRefs_h
3 
23 
24 #include <string>
25 #include <vector>
26 #include <algorithm>
27 
28 namespace trigger
29 {
30 
37 
39  private:
40  int path_;
41  int module_;
42  std::vector<std::string> collectionTags_;
43 
45  public:
49  path_(-9),
50  module_(-9),
51  collectionTags_() { }
52 
55  path_(path),
56  module_(module),
57  collectionTags_() { }
58 
60  int path() const {return path_;}
61  int module() const {return module_;}
62 
64  void addCollectionTag(const edm::InputTag& collectionTag){
65  collectionTags_.push_back(collectionTag.encode());
66  }
67 
68  void getCollectionTags(std::vector<edm::InputTag>& collectionTags) const {
69  const trigger::size_type n(collectionTags_.size());
70  collectionTags.resize(n);
71  for (trigger::size_type i=0; i!=n; ++i) {
72  collectionTags[i]=edm::InputTag(collectionTags_[i]);
73  }
74  }
75 
77  const std::vector<std::string>& getCollectionTagsAsStrings() const {
78  return collectionTags_;
79  }
80 
83  TriggerRefsCollections::swap(other); // swap base instance
84  std::swap(path_, other.path_);
85  std::swap(module_, other.module_);
86  std::swap(collectionTags_, other.collectionTags_); // use specialized version for STL containers
87  }
88 
89  };
90 
91  // picked up via argument dependent lookup, e-g- by boost::swap()
93  first.swap(second);
94  }
95 
96 }
97 
98 #endif
void swap(TriggerRefsCollections &other)
utility
uint16_t size_type
std::string encode() const
Definition: InputTag.cc:159
const std::vector< std::string > & getCollectionTagsAsStrings() const
low-level technical accessor
U second(std::pair< T, U > const &p)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void getCollectionTags(std::vector< edm::InputTag > &collectionTags) const
void swap(TriggerFilterObjectWithRefs &other)
utility
Definition: vlib.h:208