src
JetMETCorrections
FFTJetObjects
interface
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>
13
#include "
FWCore/Utilities/interface/Exception.h
"
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>
22
T
&
FFTJetDict<Key, T, Compare, Allocator>::operator[]
(
const
Key
&
key
) {
23
typename
FFTJetDict<Key, T, Compare, Allocator>::const_iterator
it
= this->
find
(key);
24
if
(
it
==
std::map<Key, T, Compare, Allocator>::end
())
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>
30
const
T
&
FFTJetDict<Key, T, Compare, Allocator>::operator[]
(
const
Key
&
key
)
const
{
31
typename
FFTJetDict<Key, T, Compare, Allocator>::const_iterator
it
= this->
find
(key);
32
if
(
it
==
std::map<Key, T, Compare, Allocator>::end
())
33
throw
cms::Exception
(
"KeyNotFound"
) <<
"FFTJetDict: key \""
<<
key
<<
"\" not found\n"
;
34
return
it
->second;
35
}
36
#endif // JetMETCorrections_FFTJetObjects_FFTJetDict_h
Exception
Definition:
hltDiff.cc:245
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition:
FindCaloHit.cc:19
FFTJetDict::operator[]
T & operator[](const Key &)
Definition:
FFTJetDict.h:22
submitPVResolutionJobs.key
key
prepare the HTCondor submission files and eventually submit them
Definition:
submitPVResolutionJobs.py:222
genParticles_cff.map
map
Definition:
genParticles_cff.py:11
Exception.h
mps_fire.end
end
Definition:
mps_fire.py:242
FFTJetDict
Definition:
FFTJetDict.h:16
Key
Definition:
GoldenPattern.h:15
ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it
auto & it
Definition:
splitVertices.h:27
T
long double T
Definition:
Basic3DVectorLD.h:48
Generated for CMSSW Reference Manual by
1.8.14