CMS 3D CMS Logo

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, class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> > >
16 struct FFTJetDict : public std::map<Key, T, Compare, Allocator> {
17  inline T& operator[](const Key&);
18  inline const T& operator[](const Key&) const;
19 };
20 
21 template <class Key, class T, class Compare, class Allocator>
25  throw cms::Exception("KeyNotFound") << "FFTJetDict: key \"" << key << "\" not found\n";
26  return const_cast<T&>(it->second);
27 }
28 
29 template <class Key, class T, class Compare, class Allocator>
33  throw cms::Exception("KeyNotFound") << "FFTJetDict: key \"" << key << "\" not found\n";
34  return it->second;
35 }
36 #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:19
T & operator[](const Key &)
Definition: FFTJetDict.h:22
#define end
Definition: vmac.h:39
long double T