IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 6671fa49 authored by ralfulrich's avatar ralfulrich
Browse files

some missing files from processes directory

parent 23ba39ea
No related branches found
No related tags found
No related merge requests found
/**
* \file PhysicalConstants
*
* \brief Several physical constants.
* \author Michael S. Kenniston, Martin Moene
* \date 7 September 2013
* \since 0.4
*
* Copyright 2013 Universiteit Leiden. All rights reserved.
*
* Copyright (c) 2001 by Michael S. Kenniston. For the most
* recent version check www.xnet.com/~msk/quantity. Permission is granted
* to use this code without restriction so long as this copyright
* notice appears in all source files.
*
* This code is provided as-is, with no warrantee of correctness.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*
*
*/
#ifndef INCLUDE_PHYSICAL_CONSTANTS_H
#define INCLUDE_PHYSICAL_CONSTANTS_H
#include "phys/units/quantity.hpp"
namespace phys {
namespace units {
namespace constants {
// acceleration of free-fall, standard
constexpr quantity<acceleration_d> g_sub_n{Rep(9.80665L) * meter / square(second)};
// Avogadro constant
constexpr quantity<dimensions<0, 0, 0, 0, 0, -1> > N_sub_A{Rep(6.02214199e+23L) /
mole};
// electronvolt
constexpr quantity<energy_d> eV{Rep(1.60217733e-19L) * joule};
// elementary charge
constexpr quantity<electric_charge_d> e{Rep(1.602176462e-19L) * coulomb};
// Planck constant
constexpr quantity<dimensions<2, 1, -1> > h{Rep(6.62606876e-34L) * joule * second};
// speed of light in a vacuum
constexpr quantity<speed_d> c{Rep(299792458L) * meter / second};
// unified atomic mass unit
constexpr quantity<mass_d> u{Rep(1.6605402e-27L) * kilogram};
// etc.
} // namespace constants
} // namespace units
} // namespace phys
namespace fwk {
using namespace phys;
using namespace phys::units;
} // namespace fwk
#endif // PHYS_UNITS_PHYSICAL_CONSTANTS_HPP_INCLUDED
/*
* end of file
*/
set (
MODEL_SOURCES
NullModel.cc
)
set (
MODEL_HEADERS
NullModel.h
)
set (
MODEL_NAMESPACE
process/null_model
)
add_library (ProcessNullModel STATIC ${MODEL_SOURCES})
CORSIKA_COPY_HEADERS_TO_NAMESPACE (ProcessNullModel ${MODEL_NAMESPACE} ${MODEL_HEADERS})
set_target_properties (
ProcessNullModel
PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
# PUBLIC_HEADER "${MODEL_HEADERS}"
)
# target dependencies on other libraries (also the header onlys)
target_link_libraries (
ProcessNullModel
CORSIKAunits
)
target_include_directories (
ProcessNullModel
INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/include>
)
install (
TARGETS ProcessNullModel
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
# PUBLIC_HEADER DESTINATION include/${MODEL_NAMESPACE}
)
# --------------------
# code unit testing
add_executable (testNullModel testNullModel.cc)
target_link_libraries (
testNullModel
CORSIKAgeometry
CORSIKAunits
CORSIKAthirdparty # for catch2
)
add_test (NAME testNullModel COMMAND testNullModel)
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one
// cpp file
#include <catch2/catch.hpp>
#include <fwk/PhysicalUnits.h>
TEST_CASE("NullModel", "[processes]") {
SECTION("bla") {}
SECTION("blubb") {}
}
set (
MODEL_SOURCES
ParticleConversion.cc
)
set (
MODEL_HEADERS
ParticleConversion.h
)
set (
MODEL_NAMESPACE
process/sibyll
)
add_library (ProcessSibyll STATIC ${MODEL_SOURCES})
CORSIKA_COPY_HEADERS_TO_NAMESPACE (ProcessSibyll ${MODEL_NAMESPACE} ${MODEL_HEADERS})
set_target_properties (
ProcessSibyll
PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
# PUBLIC_HEADER "${MODEL_HEADERS}"
)
# target dependencies on other libraries (also the header onlys)
target_link_libraries (
ProcessSibyll
CORSIKAunits
)
target_include_directories (
ProcessSibyll
INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/include>
)
install (
TARGETS ProcessSibyll
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
# PUBLIC_HEADER DESTINATION include/${MODEL_NAMESPACE}
)
# --------------------
# code unit testing
add_executable (testSibyll testSibyll.cc)
target_link_libraries (
testSibyll
CORSIKAgeometry
CORSIKAunits
CORSIKAthirdparty # for catch2
)
add_test (NAME testSibyll COMMAND testSibyll)
#include <process/sibyll/ParticleConversion.h>
#include <fwk/ParticleProperties.h>
using namespace process::sibyll;
//const std::map<sibyll::PID, ParticleProperties::InternalParticleCode>
// process::sibyll::Sibyll2Corsika = {
// {PID::E_MINUS, InternalParticleCode::Electron},
//};
#ifndef _include_processes_sibyll_particles_h_
#define _include_processes_sibyll_particles_h_
#include <fwk/ParticleProperties.h>
#include <map>
namespace process {
namespace sibyll {
enum class PID : int {
E_MINUS = 3,
E_PLUS = 2,
NU_E = 15,
NU_E_BAR = 16,
MU_MINUS = 5,
MU_PLUS = 4,
NU_MU = 17,
NU_MU_BAR = 18,
TAU_MINUS = 91,
TAU_PLUS = 90,
NU_TAU = 92,
NU_TAU_BAR = 93,
GAMMA = 1,
PI_0 = 6,
RHO_0 = 27,
K_L_0 = 11,
PI_PLUS = 7,
PI_MINUS = 8,
RHO_PLUS = 25,
RHO_MINUS = 26,
ETA = 23,
OMEGA = 32,
K_S_0 = 12,
K_STAR_0 = 30,
K_STAR_BAR_0 = 31,
K_PLUS = 9,
K_MINUS = 10,
K_STAR_PLUS = 28,
K_STAR_MINUS = 29,
D_PLUS = 59,
D_MINUS = 60,
D_STAR_PLUS = 78,
D_STAR_MINUS = 79,
D_0 = 71,
D_BAR_0 = 72,
D_STAR_0 = 80,
D_STAR_BAR_0 = 81,
D_S_PLUS = 74,
D_S_MINUS = 75,
D_STAR_S_PLUS = 76,
D_STAR_S_MINUS = 77,
ETA_C = 73,
N_0 = 14,
N_BAR_0 = -14,
DELTA_0 = 42,
DELTA_BAR_0 = -42,
P_PLUS = 13,
P_BAR_MINUS = -13,
DELTA_PLUS = 41,
DELTA_BAR_MINUS = -41,
DELTA_PLUS_PLUS = 40,
DELTA_BAR_MINUS_MINUS = -40,
SIGMA_MINUS = 36,
SIGMA_BAR_PLUS = -36,
LAMBDA_0 = 39,
LAMBDA_BAR_0 = -39,
SIGMA_0 = 35,
SIGMA_BAR_0 = -35,
SIGMA_PLUS = 34,
SIGMA_BAR_MINUS = -34,
XI_MINUS = 38,
XI_BAR_PLUS = -38,
XI_0 = 37,
XI_BAR_0 = -37,
OMEGA_MINUS = 49,
OMEGA_BAR_PLUS = -49,
SIGMA_C_0 = 86,
SIGMA_C_BAR_0 = -86,
SIGMA_STAR_C_0 = 96,
SIGMA_STAR_C_BAR_0 = -96,
LAMBDA_C_PLUS = 89,
LAMBDA_C_BAR_MINUS = -89,
XI_C_0 = 88,
XI_C_BAR_0 = -88,
SIGMA_C_PLUS = 85,
SIGMA_C_BAR_MINUS = -85,
SIGMA_STAR_C_PLUS = 95,
SIGMA_STAR_C_BAR_MINUS = -95,
SIGMA_C_PLUS_PLUS = 84,
SIGMA_C_BAR_MINUS_MINUS = -84,
SIGMA_STAR_C_PLUS_PLUS = 94,
SIGMA_STAR_C_BAR_MINUS_MINUS = -94,
XI_C_PLUS = 87,
XI_C_BAR_MINUS = -87,
OMEGA_C_0 = 99,
OMEGA_C_BAR_0 = -99,
J_PSI = 83,
VOID = 0,
};
static const std::map<sibyll::PID, fwk::particle::Code> Sibyll2Corsika = {
{PID::E_MINUS, fwk::particle::Code::Electron},
{PID::E_PLUS, fwk::particle::Code::Positron},
{PID::NU_E, fwk::particle::Code::NuE},
{PID::NU_E_BAR, fwk::particle::Code::NuEBar},
{PID::MU_MINUS, fwk::particle::Code::MuMinus},
{PID::MU_PLUS, fwk::particle::Code::MuPlus},
{PID::NU_MU, fwk::particle::Code::NuMu},
{PID::NU_MU_BAR, fwk::particle::Code::NuMuBar},
{PID::TAU_MINUS, fwk::particle::Code::TauMinus},
/*
TAU_PLUS = 90,
NU_TAU = 92,
NU_TAU_BAR = 93,
GAMMA = 1,
PI_0 = 6,
RHO_0 = 27,
K_L_0 = 11,
PI_PLUS = 7,
PI_MINUS = 8,
RHO_PLUS = 25,
RHO_MINUS = 26,
ETA = 23,
OMEGA = 32,
K_S_0 = 12,
K_STAR_0 = 30,
K_STAR_BAR_0 = 31,
K_PLUS = 9,
K_MINUS = 10,
K_STAR_PLUS = 28,
K_STAR_MINUS = 29,
D_PLUS = 59,
D_MINUS = 60,
D_STAR_PLUS = 78,
D_STAR_MINUS = 79,
D_0 = 71,
D_BAR_0 = 72,
D_STAR_0 = 80,
D_STAR_BAR_0 = 81,
D_S_PLUS = 74,
D_S_MINUS = 75,
D_STAR_S_PLUS = 76,
D_STAR_S_MINUS = 77,
ETA_C = 73,
N_0 = 14,
N_BAR_0 = -14,
DELTA_0 = 42,
DELTA_BAR_0 = -42,
P_PLUS = 13,
P_BAR_MINUS = -13,
DELTA_PLUS = 41,
DELTA_BAR_MINUS = -41,
DELTA_PLUS_PLUS = 40,
DELTA_BAR_MINUS_MINUS = -40,
SIGMA_MINUS = 36,
SIGMA_BAR_PLUS = -36,
LAMBDA_0 = 39,
LAMBDA_BAR_0 = -39,
SIGMA_0 = 35,
SIGMA_BAR_0 = -35,
SIGMA_PLUS = 34,
SIGMA_BAR_MINUS = -34,
XI_MINUS = 38,
XI_BAR_PLUS = -38,
XI_0 = 37,
XI_BAR_0 = -37,
OMEGA_MINUS = 49,
OMEGA_BAR_PLUS = -49,
SIGMA_C_0 = 86,
SIGMA_C_BAR_0 = -86,
SIGMA_STAR_C_0 = 96,
SIGMA_STAR_C_BAR_0 = -96,
LAMBDA_C_PLUS = 89,
LAMBDA_C_BAR_MINUS = -89,
XI_C_0 = 88,
XI_C_BAR_0 = -88,
SIGMA_C_PLUS = 85,
SIGMA_C_BAR_MINUS = -85,
SIGMA_STAR_C_PLUS = 95,
SIGMA_STAR_C_BAR_MINUS = -95,
SIGMA_C_PLUS_PLUS = 84,
SIGMA_C_BAR_MINUS_MINUS = -84,
SIGMA_STAR_C_PLUS_PLUS = 94,
SIGMA_STAR_C_BAR_MINUS_MINUS = -94,
XI_C_PLUS = 87,
XI_C_BAR_MINUS = -87,
OMEGA_C_0 = 99,
OMEGA_C_BAR_0 = -99,
J_PSI = 83,
VOID = 0,*/
};
} // namespace sibyll
} // namespace process
#endif
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one
// cpp file
#include <catch2/catch.hpp>
#include <fwk/ParticleProperties.h>
#include <fwk/PhysicalUnits.h>
#include <process/sibyll/ParticleConversion.h>
using namespace process::sibyll;
TEST_CASE("Sibyll", "[processes]") {
SECTION("ParticleConversion") {
REQUIRE(fwk::particle::Electron::GetCode() == Sibyll2Corsika.at(PID::E_MINUS));
}
SECTION("Data") {
REQUIRE(fwk::particle::GetName(Sibyll2Corsika.at(PID::E_PLUS)) == "e+");
}
SECTION("bla") {}
SECTION("blubb") {}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment