Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
JetMETCorrections
FFTJetObjects
interface
FFTJetObjectFactory.h
Go to the documentation of this file.
1
#ifndef JetMETCorrections_FFTJetObjects_FFTJetObjectFactory_h
2
#define JetMETCorrections_FFTJetObjects_FFTJetObjectFactory_h
3
4
//
5
// Simple factory for objects which can be constructed from ParameterSet
6
//
7
#include <map>
8
#include <string>
9
10
#include "
FWCore/ParameterSet/interface/ParameterSetfwd.h
"
11
#include "
FWCore/Utilities/interface/Exception.h
"
12
13
template
<
class
Base>
14
struct
AbsFFTJetObjectFactory
{
15
virtual
~AbsFFTJetObjectFactory
() {}
16
virtual
Base
*
create
(
const
edm::ParameterSet
& ps)
const
= 0;
17
};
18
19
template
<
class
Base,
class
Derived>
20
struct
ConcreteFFTJetObjectFactory
:
public
AbsFFTJetObjectFactory
<Base> {
21
~ConcreteFFTJetObjectFactory
()
override
{}
22
inline
Derived*
create
(
const
edm::ParameterSet
& ps)
const override
{
return
new
Derived(ps); }
23
};
24
25
template
<
class
Base>
26
struct
DefaultFFTJetObjectFactory
:
public
std::map
<std::string, AbsFFTJetObjectFactory<Base>*> {
27
typedef
Base
base_type
;
28
29
inline
DefaultFFTJetObjectFactory
() :
std
::
map
<
std
::
string
,
AbsFFTJetObjectFactory
<
Base
>*>() {}
30
31
virtual
~DefaultFFTJetObjectFactory
() {
32
for
(
typename
std::map
<
std::string
,
AbsFFTJetObjectFactory<Base>
*>::iterator it = this->begin(); it != this->
end
();
33
++it)
34
delete
it->second;
35
}
36
37
inline
Base
*
create
(
const
std::string
& derivedType,
const
edm::ParameterSet
& ps)
const
{
38
typename
std::map<std::string, AbsFFTJetObjectFactory<Base>*>::const_iterator it = this->
find
(derivedType);
39
if
(it == this->
end
())
40
throw
cms::Exception
(
"KeyNotFound"
)
41
<<
"Derived type \""
<< derivedType <<
"\" is not registered with the factory\n"
;
42
return
it->second->create(ps);
43
}
44
45
private
:
46
DefaultFFTJetObjectFactory
(
const
DefaultFFTJetObjectFactory
&) =
delete
;
47
DefaultFFTJetObjectFactory
&
operator=
(
const
DefaultFFTJetObjectFactory
&) =
delete
;
48
};
49
50
//
51
// Singleton for the factory
52
//
53
template
<
class
Factory>
54
class
StaticFFTJetObjectFactory
{
55
public
:
56
typedef
typename
Factory::Base::base_type
base_type
;
57
58
static
const
Factory&
instance
() {
59
static
Factory
const
obj
;
60
return
obj
;
61
}
62
63
template
<
class
T>
64
static
void
registerType
(
const
std::string
&
className
) {
65
Factory& rd = const_cast<Factory&>(
instance
());
66
delete
rd[
className
];
67
rd[
className
] =
new
ConcreteFFTJetObjectFactory<base_type, T>
();
68
}
69
70
private
:
71
StaticFFTJetObjectFactory
() =
delete
;
72
};
73
74
#endif // JetMETCorrections_FFTJetObjects_FFTJetObjectFactory_h
StaticFFTJetObjectFactory::base_type
Factory::Base::base_type base_type
Definition:
FFTJetObjectFactory.h:56
StaticFFTJetObjectFactory::instance
static const Factory & instance()
Definition:
FFTJetObjectFactory.h:58
ConcreteFFTJetObjectFactory::create
Derived * create(const edm::ParameterSet &ps) const override
Definition:
FFTJetObjectFactory.h:22
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition:
FindCaloHit.cc:19
CustomConfigs.Base
def Base(process)
Definition:
CustomConfigs.py:17
mps_fire.end
end
Definition:
mps_fire.py:242
ConcreteFFTJetObjectFactory
Definition:
FFTJetObjectFactory.h:20
DefaultFFTJetObjectFactory
Definition:
FFTJetObjectFactory.h:26
getGTfromDQMFile.obj
obj
Definition:
getGTfromDQMFile.py:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
AbsFFTJetObjectFactory::create
virtual Base * create(const edm::ParameterSet &ps) const =0
edm::ParameterSet
Definition:
ParameterSet.h:47
StaticFFTJetObjectFactory
Definition:
FFTJetObjectFactory.h:54
StaticFFTJetObjectFactory::registerType
static void registerType(const std::string &className)
Definition:
FFTJetObjectFactory.h:64
DefaultFFTJetObjectFactory::create
Base * create(const std::string &derivedType, const edm::ParameterSet &ps) const
Definition:
FFTJetObjectFactory.h:37
DefaultFFTJetObjectFactory::~DefaultFFTJetObjectFactory
virtual ~DefaultFFTJetObjectFactory()
Definition:
FFTJetObjectFactory.h:31
std
Definition:
JetResolutionObject.h:76
AbsFFTJetObjectFactory
Definition:
FFTJetObjectFactory.h:14
Exception
Definition:
hltDiff.cc:245
ParameterSetfwd.h
DefaultFFTJetObjectFactory::DefaultFFTJetObjectFactory
DefaultFFTJetObjectFactory()
Definition:
FFTJetObjectFactory.h:29
Exception.h
className
std::string className(const T &t)
Definition:
ClassName.h:31
genParticles_cff.map
map
Definition:
genParticles_cff.py:11
StaticFFTJetObjectFactory::StaticFFTJetObjectFactory
StaticFFTJetObjectFactory()=delete
ConcreteFFTJetObjectFactory::~ConcreteFFTJetObjectFactory
~ConcreteFFTJetObjectFactory() override
Definition:
FFTJetObjectFactory.h:21
DefaultFFTJetObjectFactory::base_type
Base base_type
Definition:
FFTJetObjectFactory.h:27
DefaultFFTJetObjectFactory::operator=
DefaultFFTJetObjectFactory & operator=(const DefaultFFTJetObjectFactory &)=delete
AbsFFTJetObjectFactory::~AbsFFTJetObjectFactory
virtual ~AbsFFTJetObjectFactory()
Definition:
FFTJetObjectFactory.h:15
Generated for CMSSW Reference Manual by
1.8.16