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&);
21  inline const T& operator[](const Key&) const;
22 };
23 
24 template<class Key,class T,class Compare,class Allocator>
27 {
29  this->find(key);
31  throw cms::Exception("KeyNotFound")
32  << "FFTJetDict: key \"" << key << "\" not found\n";
33  return const_cast<T&>(it->second);
34 }
35 
36 template<class Key,class T,class Compare,class Allocator>
38 operator[](const Key& key) const
39 {
41  this->find(key);
43  throw cms::Exception("KeyNotFound")
44  << "FFTJetDict: key \"" << key << "\" not found\n";
45  return it->second;
46 }
47 #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
T & operator[](const Key &)
Definition: FFTJetDict.h:26
#define end
Definition: vmac.h:37
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
long double T