src
L1Trigger
Phase2L1GT
plugins
L1GTOptionalParam.h
Go to the documentation of this file.
1
#ifndef L1Trigger_Phase2L1GT_L1GTOptionalParam_h
2
#define L1Trigger_Phase2L1GT_L1GTOptionalParam_h
3
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
6
#include <string>
7
#include <optional>
8
#include <functional>
9
10
namespace
l1t
{
11
12
template
<
typename
T,
typename
K>
13
inline
std::optional<T>
getOptionalParam
(
const
std::string
&
name
,
14
const
edm::ParameterSet
&
config
,
15
std::function
<
T
(K)>
conv
) {
16
if
(
config
.exists(
name
)) {
17
return
std::optional<T>(
conv
(
config
.getParameter<K>(
name
)));
18
}
19
return
std::optional<T>();
20
}
21
22
template
<
typename
T>
23
inline
std::optional<T>
getOptionalParam
(
const
std::string
&
name
,
const
edm::ParameterSet
&
config
) {
24
if
(
config
.exists(
name
)) {
25
return
std::optional<T>(
config
.getParameter<
T
>(
name
));
26
}
27
return
std::optional<T>();
28
}
29
}
// namespace l1t
30
31
#endif // L1Trigger_Phase2L1GT_L1GTOptionalParam_h
l1t
delete x;
Definition:
CaloConfig.h:22
config
Definition:
config.py:1
HiBiasedCentrality_cfi.function
function
Definition:
HiBiasedCentrality_cfi.py:4
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::getOptionalParam
std::optional< T > getOptionalParam(const std::string &name, const edm::ParameterSet &config, std::function< T(K)> conv)
Definition:
L1GTOptionalParam.h:13
ParameterSet.h
conv
EPOS::IO_EPOS conv
Definition:
ReggeGribovPartonMCHadronizer.cc:40
edm::ParameterSet
Definition:
ParameterSet.h:48
T
long double T
Definition:
Basic3DVectorLD.h:48
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
Generated for CMSSW Reference Manual by
1.8.14