CMS 3D CMS Logo

L1GTOptionalParam.h
Go to the documentation of this file.
1 #ifndef L1Trigger_Phase2L1GT_L1GTOptionalParam_h
2 #define L1Trigger_Phase2L1GT_L1GTOptionalParam_h
3 
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,
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
delete x;
Definition: CaloConfig.h:22
Definition: config.py:1
std::optional< T > getOptionalParam(const std::string &name, const edm::ParameterSet &config, std::function< T(K)> conv)
EPOS::IO_EPOS conv
long double T