CMS 3D CMS Logo

MtdRecoClusterToSimLayerClusterAssociationMap.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_Associations_MtdRecoClusterToSimLayerClusterAssociationMap_h
2 #define SimDataFormats_Associations_MtdRecoClusterToSimLayerClusterAssociationMap_h
3 
8 
9 #include <vector>
10 #include <utility>
11 #include <algorithm>
12 
18 public:
21  using value_type = std::pair<key_type, std::vector<mapped_type>>;
22  using map_type = std::vector<value_type>;
23  using const_iterator = typename map_type::const_iterator;
24  using range = std::pair<const_iterator, const_iterator>;
25 
30 
31  void emplace_back(const FTLClusterRef& recoClus, std::vector<MtdSimLayerClusterRef>& simClusVect) {
32  map_.emplace_back(recoClus, simClusVect);
33  }
34 
35  void post_insert() { std::sort(map_.begin(), map_.end(), compare); }
36 
37  bool empty() const { return map_.empty(); }
38  size_t size() const { return map_.size(); }
39 
40  const_iterator begin() const { return map_.begin(); }
41  const_iterator cbegin() const { return map_.cbegin(); }
42  const_iterator end() const { return map_.end(); }
43  const_iterator cend() const { return map_.cend(); }
44 
46  return std::equal_range(map_.begin(), map_.end(), value_type(key, std::vector<MtdSimLayerClusterRef>()), compare);
47  }
48 
49  const map_type& map() const { return map_; }
50 
51 private:
52  static bool compare(const value_type& i, const value_type& j) { return (i.first < j.first); }
53 
55 };
56 
57 #endif
edm::Ref< MtdSimLayerClusterCollection > MtdSimLayerClusterRef
std::pair< key_type, std::vector< mapped_type > > value_type
edm::Ref< FTLClusterCollection, FTLCluster > FTLClusterRef
key
prepare the HTCondor submission files and eventually submit them
static bool compare(const value_type &i, const value_type &j)
void emplace_back(const FTLClusterRef &recoClus, std::vector< MtdSimLayerClusterRef > &simClusVect)