diff --git a/Framework/Units/PhysicalConstants.h b/Framework/Units/PhysicalConstants.h new file mode 100644 index 0000000000000000000000000000000000000000..7935c3962e83b14fe27dd0f60176faac75b6eedf --- /dev/null +++ b/Framework/Units/PhysicalConstants.h @@ -0,0 +1,76 @@ +/** + * \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 + */ diff --git a/Processes/NullModel/CMakeLists.txt b/Processes/NullModel/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..e4c6a649e4bc67d922fbd2b11695a894eeb1ac1e --- /dev/null +++ b/Processes/NullModel/CMakeLists.txt @@ -0,0 +1,61 @@ + +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) + diff --git a/Processes/NullModel/testNullModel.cc b/Processes/NullModel/testNullModel.cc new file mode 100644 index 0000000000000000000000000000000000000000..b8afb99f40348b0b2419730f3929fcbbbd117ca6 --- /dev/null +++ b/Processes/NullModel/testNullModel.cc @@ -0,0 +1,13 @@ +#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") {} + +} diff --git a/Processes/Sibyll/CMakeLists.txt b/Processes/Sibyll/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..1232eb8204e24defa4a080ff722d582083421332 --- /dev/null +++ b/Processes/Sibyll/CMakeLists.txt @@ -0,0 +1,61 @@ + +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) + diff --git a/Processes/Sibyll/ParticleConversion.cc b/Processes/Sibyll/ParticleConversion.cc new file mode 100644 index 0000000000000000000000000000000000000000..15d4613919eca687b69c9045eccfa3332bac53ce --- /dev/null +++ b/Processes/Sibyll/ParticleConversion.cc @@ -0,0 +1,9 @@ +#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}, +//}; diff --git a/Processes/Sibyll/ParticleConversion.h b/Processes/Sibyll/ParticleConversion.h new file mode 100644 index 0000000000000000000000000000000000000000..84ddd44aa30def8e385af5c19a7761824a21a150 --- /dev/null +++ b/Processes/Sibyll/ParticleConversion.h @@ -0,0 +1,199 @@ +#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 diff --git a/Processes/Sibyll/testSibyll.cc b/Processes/Sibyll/testSibyll.cc new file mode 100644 index 0000000000000000000000000000000000000000..c055cdfe667593d1c2d1e0e380ae3f2fbabc2486 --- /dev/null +++ b/Processes/Sibyll/testSibyll.cc @@ -0,0 +1,24 @@ +#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") {} +}