cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
LpairHandler.cpp File Reference
+ Include dependency graph for LpairHandler.cpp:

Go to the source code of this file.

Classes

class  LpairHandler
 LPAIR-like steering cards parser and writer. More...
 

Namespaces

namespace  cepgen
 Common namespace for this Monte Carlo generator.
 
namespace  cepgen::card
 Location for all steering card parsers/writers.
 

Macros

#define REGISTER_LPAIR_CONTENT_TYPE
 
#define __TYPE_ENUM(type, map, default_val)
 
#define __TYPE_ENUM(type, map_name, default_val)   std::map<std::string, Parameter<type> > map_name;
 
#define __TYPE_ENUM(type, map, default_val)
 
#define __TYPE_ENUM(type, map, default_val)
 

Functions

 REGISTER_CARD_HANDLER (".card", LpairHandler)
 

Variables

static constexpr int kInvalidInt = -999999
 
static constexpr double kInvalidDbl = 999.999
 
static constexpr const char * kInvalidStr = "(null)"
 

Macro Definition Documentation

◆ __TYPE_ENUM [1/4]

#define __TYPE_ENUM (   type,
  map,
  default_val 
)
Value:
if (map.count(key)) \
return map.at(key).description;

Definition at line 271 of file LpairHandler.cpp.

◆ __TYPE_ENUM [2/4]

#define __TYPE_ENUM (   type,
  map,
  default_val 
)
Value:
template <> \
inline void LpairHandler::registerParameter<type>( \
const std::string& key, const std::string& description, type* def) { \
map[key] = Parameter<type>{key, description, def}; \
} \
template <> \
inline void LpairHandler::set<type>(const std::string& key, const type& value) { \
if (map.count(key)) \
*map.at(key).value = value; \
} \
template <> \
inline type LpairHandler::get(const std::string& key) const { \
if (map.count(key)) \
return *map.at(key).value; \
return default_val; \
}
static ParametersDescription description()

Definition at line 271 of file LpairHandler.cpp.

◆ __TYPE_ENUM [3/4]

#define __TYPE_ENUM (   type,
  map,
  default_val 
)
Value:
if (auto var = get<type>(key); var != default_val) \
return utils::toString(var);

Definition at line 271 of file LpairHandler.cpp.

◆ __TYPE_ENUM [4/4]

#define __TYPE_ENUM (   type,
  map_name,
  default_val 
)    std::map<std::string, Parameter<type> > map_name;

Definition at line 271 of file LpairHandler.cpp.

◆ REGISTER_LPAIR_CONTENT_TYPE

#define REGISTER_LPAIR_CONTENT_TYPE
Value:
__TYPE_ENUM(int, p_ints_, -kInvalidInt) \
__TYPE_ENUM(double, p_doubles_, -kInvalidDbl) \
__TYPE_ENUM(std::string, p_strings_, kInvalidStr)
#define __TYPE_ENUM(type, map, default_val)
static constexpr const char * kInvalidStr
static constexpr double kInvalidDbl
static constexpr int kInvalidInt

Definition at line 47 of file LpairHandler.cpp.

Function Documentation

◆ REGISTER_CARD_HANDLER()

REGISTER_CARD_HANDLER ( ".card"  ,
LpairHandler   
)

Variable Documentation

◆ kInvalidDbl

constexpr double kInvalidDbl = 999.999
staticconstexpr

Definition at line 44 of file LpairHandler.cpp.

◆ kInvalidInt

constexpr int kInvalidInt = -999999
staticconstexpr

Definition at line 43 of file LpairHandler.cpp.

◆ kInvalidStr

constexpr const char* kInvalidStr = "(null)"
staticconstexpr

Definition at line 45 of file LpairHandler.cpp.