20 enum class QgsjetIICode : int8_t;
21 using QgsjetIICodeIntType = std::underlying_type<QgsjetIICode>::type;
26 enum class QgsjetIIXSClass : int8_t {
32 using QgsjetIIXSClassIntType = std::underlying_type<QgsjetIIXSClass>::type;
37 enum class QgsjetIIHadronType : int8_t {
51 NeutralLightMesonType = 101,
53 using QgsjetIIHadronTypeIntType = std::underlying_type<QgsjetIIHadronType>::type;
57 #include <corsika/modules/qgsjetII/Generated.inc> 61 QgsjetIICode constexpr convertToQgsjetII(Code pCode) {
62 return corsika2qgsjetII[
static_cast<CodeIntType>(pCode)];
65 Code constexpr convertFromQgsjetII(QgsjetIICode pCode) {
66 auto const pCodeInt =
static_cast<QgsjetIICodeIntType
>(pCode);
67 auto const corsikaCode = qgsjetII2corsika[pCodeInt - minQgsjetII];
68 if (corsikaCode == Code::Unknown) {
69 throw std::runtime_error(std::string(
"QGSJETII/CORSIKA conversion of pCodeInt=")
71 .append(
" impossible"));
76 QgsjetIICodeIntType constexpr convertToQgsjetIIRaw(Code pCode) {
77 return static_cast<QgsjetIICodeIntType
>(convertToQgsjetII(pCode));
80 QgsjetIIXSClass constexpr getQgsjetIIXSCode(Code pCode) {
83 return corsika2qgsjetIIXStype[
static_cast<CodeIntType>(pCode)];
86 QgsjetIIXSClassIntType constexpr getQgsjetIIXSCodeRaw(Code pCode) {
87 return static_cast<QgsjetIIXSClassIntType
>(getQgsjetIIXSCode(pCode));
90 bool constexpr canInteract(Code pCode) {
91 return getQgsjetIIXSCode(pCode) != QgsjetIIXSClass::CannotInteract;
94 QgsjetIIHadronType constexpr getQgsjetIIHadronType(Code pCode) {
95 return corsika2qgsjetIIHadronType[
static_cast<CodeIntType>(pCode)];
int32_t std::underlying_type< Code >::type CodeIntType
The Code enum is the actual place to define CORSIKA 8 particle codes.
std::string to_string(long double const value)
string representation of value.
Interface to particle properties.