IAP GITLAB

Skip to content
Snippets Groups Projects
Commit ab5a6fa0 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by ralfulrich
Browse files

start

parent f2d483b4
No related branches found
No related tags found
No related merge requests found
set (
MODEL_SOURCES
CONEXSourceCut.cc
)
set (
MODEL_HEADERS
CONEXSourceCut.h
)
set (
MODEL_NAMESPACE
corsika/process/conex_source_cut
)
add_library (ProcessCONEXSourceCut STATIC ${MODEL_SOURCES})
CORSIKA_COPY_HEADERS_TO_NAMESPACE (ProcessCONEXSourceCut ${MODEL_NAMESPACE} ${MODEL_HEADERS})
set_target_properties (
ProcessCONEXSourceCut
PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
# PUBLIC_HEADER "${MODEL_HEADERS}"
)
# target dependencies on other libraries (also the header onlys)
target_link_libraries (
ProcessCONEXSourceCut
CORSIKAunits
CORSIKAparticles
CORSIKAprocesssequence
CORSIKAsetup
)
target_include_directories (
ProcessCONEXSourceCut
INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/include>
)
install (
TARGETS ProcessCONEXSourceCut
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
# PUBLIC_HEADER DESTINATION include/${MODEL_NAMESPACE}
)
# --------------------
# code unit testing
# CORSIKA_ADD_TEST(testCONEXSourceCut SOURCES
# testCONEXSourceCut.cc
# ${MODEL_HEADERS}
# )
#
# target_link_libraries (
# testCONEXSourceCut
# ProcessCONEXSourceCut
# CORSIKAunits
# CORSIKAstackinterface
# CORSIKAprocesssequence
# CORSIKAsetup
# CORSIKAgeometry
# CORSIKAenvironment
# CORSIKAtesting
# )
#pragma once
#include <array>
extern "C" {
int InitialParticle_(int const&);
struct cxoptl_ {
std::array<double, 16> dptl;
};
}
/*
* (c) Copyright 2020 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.
*/
#include <corsika/process/conex_source_cut/CONEXSourceCut.h>
#include <algorithm>
#include <iomanip>
using namespace std;
using namespace corsika::process::conex_source_cut;
using namespace corsika::units::si;
using namespace corsika::particles;
using namespace corsika::setup;
corsika::process::EProcessReturn CONEXSourceCut::DoSecondaries(
corsika::setup::StackView& vS) {
auto p = vS.begin();
while (p != vS.end()) {
Code const pid = p.GetPID();
HEPEnergyType const energy = p.GetEnergy();
if (std::find(em_codes_.cbegin(), em_codes_.cend(), pid) != em_codes_.cend()) {
std::cout << "CONEXSourceCut: removing " << pid << " " << std::scientific << energy
<< std::endl;
p.Delete();
}
else {
++p;
}
}
return corsika::process::EProcessReturn::eOk;
}
void CONEXSourceCut::Init() {}
CONEXSourceCut::CONEXSourceCut() {}
/*
* (c) Copyright 2020 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 _corsika_process_particle_cut_CONEXSourceCut_h_
#define _corsika_process_particle_cut_CONEXSourceCut_h_
#include <corsika/particles/ParticleProperties.h>
#include <corsika/process/SecondariesProcess.h>
#include <corsika/setup/SetupStack.h>
#include <corsika/units/PhysicalUnits.h>
namespace corsika::process {
namespace conex_source_cut {
class CONEXSourceCut : public process::SecondariesProcess<CONEXSourceCut> {
public:
CONEXSourceCut();
corsika::process::EProcessReturn DoSecondaries(corsika::setup::StackView&);
void Init();
private:
static std::array<particles::Code, 3> constexpr em_codes_{
particles::Code::Gamma, particles::Code::Electron, particles::Code::Positron};
};
} // namespace conex_source_cut
} // namespace corsika::process
#endif
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