CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FFTJetDict.h
Go to the documentation of this file.
1 #ifndef JetMETCorrections_FFTJetObjects_FFTJetDict_h
2 #define JetMETCorrections_FFTJetObjects_FFTJetDict_h
3 
4 //
5 // This template provides a variation of std::map with
6 // subscripting operator which does not automatically
7 // insert default values
8 //
9 // I. Volobouev
10 // 08/03/2012
11 
12 #include <map>
14 
15 template <class Key, class T,
16  class Compare = std::less<Key>,
17  class Allocator = std::allocator<std::pair<const Key,T> > >
18 struct FFTJetDict : public std::map<Key,T,Compare,Allocator>
19 {
20  inline T& operator[](const Key&) const;
21 };
22 
23 template<class Key,class T,class Compare,class Allocator>
25 operator[](const Key& key) const
26 {
28  this->find(key);
30  throw cms::Exception("KeyNotFound")
31  << "FFTJetDict: key \"" << key << "\" not found\n";
32  return const_cast<T&>(it->second);
33 }
34 
35 #endif // JetMETCorrections_FFTJetObjects_FFTJetDict_h
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
dictionary map
Definition: Association.py:205
#define end
Definition: vmac.h:38
T & operator[](const Key &) const
Definition: FFTJetDict.h:25
list key
Definition: combine.py:13
long double T