IAP GITLAB

Skip to content
Snippets Groups Projects
Forked from Air Shower Physics / corsika
4051 commits behind the upstream repository.
ParticleConversion.h 1.20 KiB

/**
 * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
 *
 * See file AUTHORS for a list of contributors.
 *
 * This software is distributed under the terms of the GNU General Public
 * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
 * the license.
 */

#ifndef _include_processes_sibyll_particles_h_
#define _include_processes_sibyll_particles_h_

#include <corsika/particles/ParticleProperties.h>

#include <bitset2/bitset2.hpp>

#include <map>

namespace corsika::process::sibyll {

  enum class Code : int8_t;
  using SibyllCodeIntType = std::underlying_type<Code>::type;

#include <corsika/process/sibyll/Generated.inc>

  bool HandledBySibyll(corsika::particles::Code pCode) {
    return handleable[static_cast<corsika::particles::CodeIntType>(pCode)];
  }
  
  Code constexpr ConvertToSibyll(corsika::particles::Code pCode) {
    //~ assert(handledBySibyll(pCode));
    return static_cast<Code>(corsika2sibyll[static_cast<corsika::particles::CodeIntType>(pCode)]);
  }
  
  corsika::particles::Code constexpr ConvertFromSibyll(Code pCode) {
    return sibyll2corsika[static_cast<SibyllCodeIntType>(pCode) - minSibyll];
  }

} // namespace corsika::process::sibyll

#endif