IAP GITLAB

Skip to content
Snippets Groups Projects
Commit d672ca89 authored by Ralf Ulrich's avatar Ralf Ulrich
Browse files

Merge branch '48_particle_creator' into 'master'

48 particle creator

See merge request !68
parents e5906219 5435e28c
No related branches found
No related tags found
No related merge requests found
Showing
with 70 additions and 28 deletions
...@@ -22,6 +22,7 @@ build: ...@@ -22,6 +22,7 @@ build:
- ls - ls
- pwd - pwd
artifacts: artifacts:
expire_in: 1 week
paths: paths:
- build/test.log.gz - build/test.log.gz
when: on_failure when: on_failure
......
...@@ -45,7 +45,12 @@ target_include_directories ( ...@@ -45,7 +45,12 @@ target_include_directories (
PUBLIC PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/include> $<INSTALL_INTERFACE:include/include>
SYSTEM )
target_include_directories (
COAST
SYSTEM
PUBLIC
$ENV{COAST_DIR}/include $ENV{COAST_DIR}/include
) )
......
/**
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/*
* (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_corsika_coast_coastprocess_h_ #ifndef _include_corsika_coast_coastprocess_h_
#define _include_corsika_coast_coastprocess_h_ #define _include_corsika_coast_coastprocess_h_
......
/** /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/*
* (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.
*/
#include <interface/CorsikaInterface.h> #include <interface/CorsikaInterface.h>
#include <corsika/coast/COASTProcess.h> #include <corsika/coast/COASTProcess.h>
......
/** /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/** /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
# COAST interface {#COASTinterface}
With the COAST interface of CORSIKA 8 you can write a CORSIKA 8
"process" class and link it to CORSIKA 7. This can be very powerful to
benchmark new CORSIKA 8 physics code in the context of "old" CORSIKA 7
simulations.
This is based on corsika7/trunk/coast/CoastOptions/example with an This is based on corsika7/trunk/coast/CoastOptions/example with an
additional interface to CORSIKA8. additional interface to CORSIKA 8.
This is an example for a "COAST user library" using CORSIKA8 We provide a step-by-step example for a "COAST user library" using CORSIKA 8
technology. It explains the steps, how to use the COAST_USER_LIB technology. It explains the steps, how to use the COAST_USER_LIB
option of CORSIKA together with CORSIKA8/COAST option of CORSIKA together with CORSIKA8/COAST
......
...@@ -8,12 +8,13 @@ EXCLUDE_PATTERNS = */ThirdParty/*/* ...@@ -8,12 +8,13 @@ EXCLUDE_PATTERNS = */ThirdParty/*/*
GENERATE_HTML = YES GENERATE_HTML = YES
GENERATE_LATEX = YES GENERATE_LATEX = YES
FILE_PATTERNS = *.cc *.cpp *.cxx *.h *.dox *.inc FILE_PATTERNS = *.cc *.cpp *.cxx *.h *.dox *.inc *.md
EXTENSION_MAPPING = inc=C++ EXTENSION_MAPPING = inc=C++
RECURSIVE = YES RECURSIVE = YES
SOURCE_BROWSER = YES SOURCE_BROWSER = YES
# INLINE_SOURCES # INLINE_SOURCES
GENERATE_TREEVIEW = YES
CLASS_DIAGRAMS = NO CLASS_DIAGRAMS = NO
HAVE_DOT = YES HAVE_DOT = YES
......
/**
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
...@@ -256,8 +257,6 @@ int main() { ...@@ -256,8 +257,6 @@ int main() {
double theta = 0.; double theta = 0.;
double phi = 0.; double phi = 0.;
{ {
auto particle = stack.NewParticle();
particle.SetPID(Code::Proton);
HEPMomentumType P0 = sqrt(E0 * E0 - Proton::GetMass() * Proton::GetMass()); HEPMomentumType P0 = sqrt(E0 * E0 - Proton::GetMass() * Proton::GetMass());
auto momentumComponents = [](double theta, double phi, HEPMomentumType ptot) { auto momentumComponents = [](double theta, double phi, HEPMomentumType ptot) {
return std::make_tuple(ptot * sin(theta) * cos(phi), ptot * sin(theta) * sin(phi), return std::make_tuple(ptot * sin(theta) * cos(phi), ptot * sin(theta) * sin(phi),
...@@ -268,11 +267,8 @@ int main() { ...@@ -268,11 +267,8 @@ int main() {
auto plab = stack::super_stupid::MomentumVector(rootCS, {px, py, pz}); auto plab = stack::super_stupid::MomentumVector(rootCS, {px, py, pz});
cout << "input angles: theta=" << theta << " phi=" << phi << endl; cout << "input angles: theta=" << theta << " phi=" << phi << endl;
cout << "input momentum: " << plab.GetComponents() / 1_GeV << endl; cout << "input momentum: " << plab.GetComponents() / 1_GeV << endl;
particle.SetEnergy(E0); Point pos(rootCS, 0_m, 0_m, 0_m);
particle.SetMomentum(plab); stack.AddParticle(Code::Proton, E0, plab, pos, 0_ns);
particle.SetTime(0_ns);
Point p(rootCS, 0_m, 0_m, 0_m);
particle.SetPosition(p);
} }
// define air shower object, run simulation // define air shower object, run simulation
......
/** /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/** /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/** /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/** /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
#include <corsika/particles/ParticleProperties.h> #include <corsika/particles/ParticleProperties.h>
#include <corsika/stack/super_stupid/SuperStupidStack.h> #include <corsika/stack/super_stupid/SuperStupidStack.h>
#include <corsika/geometry/Point.h>
#include <corsika/geometry/RootCoordinateSystem.h>
#include <cassert> #include <cassert>
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
...@@ -20,10 +24,12 @@ using namespace corsika::stack; ...@@ -20,10 +24,12 @@ using namespace corsika::stack;
using namespace std; using namespace std;
void fill(corsika::stack::super_stupid::SuperStupidStack& s) { void fill(corsika::stack::super_stupid::SuperStupidStack& s) {
const geometry::CoordinateSystem& rootCS =
geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
for (int i = 0; i < 11; ++i) { for (int i = 0; i < 11; ++i) {
auto p = s.NewParticle(); s.AddParticle(corsika::particles::Code::Electron, 1.5_GeV * i,
p.SetPID(corsika::particles::Code::Electron); stack::super_stupid::MomentumVector(rootCS, {0_GeV, 0_GeV, 1_GeV}),
p.SetEnergy(1.5_GeV * i); geometry::Point(rootCS, 0_m, 0_m, 0_m), 0_ns);
} }
} }
......
/** /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/**
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/** /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/**
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
/**
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* See file AUTHORS for a list of contributors. * See file AUTHORS for a list of contributors.
......
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