IAP GITLAB

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

Merge branch 'master' of gitlab.ikp.kit.edu:AirShowerPhysics/corsika

parents 829e0de6 c8d72192
No related branches found
No related tags found
No related merge requests found
Showing
with 526 additions and 84 deletions
**/*~
**/*.bak
**/*log
build/
Framework/Particles/GeneratedParticleProperties.inc
flymd.html
flymd.md
Maximilian Reininghaus, maximilian.reininghaus@kit.edu
Ralf Ulrich, ralf.ulrich@kit.edu
Everything
\ No newline at end of file
* milestone1 release: So 7. Okt 15:51:07 CEST 2018
......@@ -17,7 +17,6 @@ include (CorsikaUtilities) # a few cmake function
# enable warnings and disallow non-standard language
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra")
# --std=c++17
set (CMAKE_CXX_STANDARD 17)
enable_testing ()
set (CTEST_OUTPUT_ON_FAILURE 1)
......@@ -37,15 +36,16 @@ set (CTEST_OUTPUT_ON_FAILURE 1)
#add_custom_command (TARGET corsika_pre_build PRE_BUILD COMMAND "${PROJECT_SOURCE_DIR}/pre_compile.py")
# dependencies
find_package (Boost 1.40 COMPONENTS program_options REQUIRED)
#find_package (Boost 1.40 COMPONENTS program_options REQUIRED)
find_package (Eigen3 REQUIRED)
#find_package (HDF5) # not yet needed
# order of subdirectories
add_subdirectory (ThirdParty)
#add_subdirectory (Utilities)
add_subdirectory (Framework)
add_subdirectory (Stack)
add_subdirectory (Setup)
add_subdirectory (Processes)
add_subdirectory (Documentation)
add_subdirectory (Main)
......@@ -55,3 +55,26 @@ function (CORSIKA_COPY_HEADERS_TO_NAMESPACE for_library in_namespace)
endfunction (CORSIKA_COPY_HEADERS_TO_NAMESPACE)
#
# use: CORSIKA_ADD_FILES_ABSOLUTE varname
#
# add list of filenames with absolute paths (pointing to CMAKE_SOURCE_DIR) to ${varname} in PARAENT_SCOPE
#
macro (CORSIKA_ADD_FILES_ABSOLUTE varname)
file (RELATIVE_PATH _relPath "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
foreach (_src ${ARGN})
if (_relPath)
list (APPEND "${varname}" "${CMAKE_SOURCE_DIR}/${_relPath}/${_src}")
else()
list (APPEND "${varname}" "${CMAKE_SOURCE_DIR}/${_src}")
endif()
endforeach()
if (_relPath)
# propagate SRCS to parent directory
set ("${varname}" "${${varname}}" PARENT_SCOPE)
endif()
endmacro(CORSIKA_ADD_FILES_ABSOLUTE)
# Collaboration agreement
The CORSIKA project very much welcomes all collaboration and
contributions. The aim of the CORSIKA project is to create a
scientific software framework as a fundamental tool for research. The
collaboration agreement and the licensing model are based on the
guidelines layed out by HSF
[[1]](https://hepsoftwarefoundation.org/activities/licensing.html) or
CERN
[[2]](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=2ahUKEwiLqKG00dXdAhUOZFAKHdIwAh4QFjAAegQIARAC&url=https%3A%2F%2Findico.cern.ch%2Fcategory%2F4251%2Fattachments%2F101%2F505%2FOSL-2012-01-Open_Source_Licences_at_CERN-Short_version.pdf&usg=AOvVaw1n4S0PQCSeE6wbdfdhKDqF),
[[3]](http://legal.web.cern.ch/licensing/software), and follow the
examples of other big scientific software projects.
The CORSIKA project consists of the contributions from the scientific
community and individuals in a best effort to deliver the best
possible computing performance and physics output.
The MCnet guidelines developed by [www.montecarlonet.org](www.montecarlonet.org)
are copied in [MCNET_GUIDELINES](MCNET_GUIDELINES) -- they provide a very good
additional scope that contributors should read and follow.
All possible
liability and licensing question are only handled by the adopted
software license.
## The software license of the CORSIKA project
The license adopted for the CORSIKA project is the explicit copyleft
license GPLv3, as copied in full in the file
[LICENSE](LICENSE). Each source file of the CORSIKA project contains a
short statement of the copyright and this license. Each binary or
source code release of CORSIKA must contain the file LICENSE. The
code, documentation and content in the folder [ThirdParty](ThirdParty)
is not integral part of the CORSIKA project and can be based on or
include other licenses, which must be compatible with GPLv3. Check the
content of this folder for details. It depends on the configuration of
the build system to what extend this code is used to build CORSIKA.
## Who is the "copyright holder"
For legal reasons and the ability to maintain the CORSIKA project
effectively over a very long lifespan of several decades, all
contributors are required to transfer their copyright to the CORSIKA
Project. Of course you will be duly credited and your name will appear
on the contributors page and in the [AUTHORS](AUTHORS) file shipped
with every binary and source distribution. The copyright transfer is
necessary to be able to effectively defend the project in case of
litigation. The copyright holder may change, if decided by the CORSIKA
Project. The current copyright holder is the CORSIKA Project
corsika-project@lists.kit.edu, with the current chair person Ralf Ulrich (KIT) ralf.ulrich@kit.edu.
## Definition of a "contributor"
Contributor is a person of whom at least one merge request was
accepted for the master branch of the CORSIKA project at
[https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika).
All contributors will be co-listed and credited as (software) authors
of the CORSIKA project, as well as listed indefinitely in the
[AUTHORS](AUTHORS) file. Contributors should add their name and
contact data to the [AUTHORS](AUTHORS) file, as part of one of their
merge requests. This file is always distributed together with all
source and binary releases. If you contribute to any non-master
branch, you can add your name to the [AUTHORS](AUTHORS) file of this
particular branch, but all official releases are normally performed
via the master branch.
If you want to contribute, you need to read
[GUIDELINES](GUIDELINES.md) and comply with these rules, or help to
improve them.
## Definition and working mode of the CORSIKA Project panel
The CORSIKA Project panel makes all decisions for the CORSIKA
Project. It can also change the
[COLLABORATION\_AGREEMENT](COLLABORATION\_AGREEMENT.md), the
[GUIDELINES](GUIDELINES.md) or any other structure or document relevant for the CORSIKA Project.
The CORSIKA Project *panel* consists (October 2018) of
* Ralph Engel (KIT)
* Dieter Heck (KIT)
* Tanguy Pierog (KIT)
* Maximilian Reininghaus (KIT)
* Markus Roth (KIT)
* Ralf Ulrich (KIT)
* Michael Unger (KIT)
* Darko Veberic (KIT)
and can be contacted via corsika-project@lists.kit.edu. The chair
person of the CORSIKA Project is Ralf Ulrich (KIT). Members of the
CORSIKA Project *panel* are *Maintainer* of the CORSIKA Project in
gitlab at
[https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika](https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika),
and have special responsibilities for this reason.
## Changing to a different license, for parts, or the complete project
The CORSIKA Project panel can change the license for parts or the entire project.
## Planning and performing releases
The CORSIKA Project panel decides on releases of the software, and about the content of it.
## Changes to the Collaboration Agreement
The CORSIKA Project panel decides on changes to the Collaboration
agreement.
# Contributing
The CORSIKA project is committed to fostering and preserving a
diverse, welcoming community; all participants are expected to
respect that.
- [Getting Started](#getting-started)
- [Very first steps](#very-first-steps)
- [Opening issues](#opening-issues)
- [Participating in discussions](#participating-in-discussions)
- [Improving and reviewing docs](#improving-and-reviewing-docs)
- [Reviewing and testing changes](#reviewing-and-testing-changes)
- [Proposing and making changes](#proposing-and-making-changes)
- [Finding something to work on](#finding-something-to-work-on)
- [Before you start](#before-you-start-work)
- [Before you open your PR](#before-you-open-your-pr)
- [Review process](#review-process)
- [Getting more involved](#getting-more-involved)
## Getting started
Not sure where to start? If you haven't already, take a look at the
[docs](http://xi-editor.github.io/xi-editor/docs.html) to get a better
sense of the project. Read through some issues and some open PRs, to
get a sense for the habits of existing contributors. Drop by the #xi
channel on [irc.mozilla.org](https://mozilla.logbot.info/xi) to follow
ongoing discussions or ask questions. Clone the repos you're
interested in, and make sure you can build and run the tests. If you
can't, open an issue, and someone will try to help. Once you're up and
running, there are a a number of ways to participate:
### Opening issues
If you have a question or a feature request or think you've found a bug,
please open an issue. When opening an issue, include any details that
might be relevant: for a bug this might be the steps required to
reproduce; for a feature request it might be a detailed explanation of
the behaviour you are imagining, an outline of how it would be used,
and/or examples of how this feature is used in other editors.
#### Before you open an issue
Before opening an issue, **try to identify where the issue belongs**.
Is it a problem with the frontend or with core? The frontend is
responsible for drawing windows and UI, and handling events; the core
is responsible for most everything else. Issues with the frontend
should be opened in that frontend's repository, and issues with
core should be opened in the
[xi-editor](https://github.com/xi-editor/xi-editor/issues) repo.
Finally, before opening an issue, **use github's search bar** to make
sure there isn't an existing (open or closed) issue for your particular
problem.
### Participating in discussions
An _explicit_ goal of xi-editor is to be an educational resource.
Everyone is encouraged to participate in discussion issues (issues with
the 'discussion' or 'planning' labels), and we expect people
participating in discussions to be respectful of the fact that we all
have different backgrounds and levels of experience. Similarly, if
something is confusing, feel free to ask for clarification! If you're
confused, other people probably are as well.
### Improving and reviewing docs
If the docs are unclear or incomplete, please open an issue or a PR to
improve them. This is an especially valuable form of feedback from new
contributors, who are seeing things for the first time, and will be best
positioned to identify areas that need improvement.
### Reviewing and testing changes
One of the best ways to get more familiar with the project is by reading
other people's pull requests. If there's something in a commit that you
don't understand, this is a great time to ask for clarification. Testing
changes is also very helpful, especially for bug fixes or feature
additions. Check out a change and try it out; does it work? Can you find
edge cases? Manual testing is very valuable. For more information on
reviews, see [code review process](#review-process).
## Proposing and making changes
### Finding something to work on
If you're looking for something to work on, a good first step is to browse
the [issues](https://github.com/xi-editor/xi-editor/issues). Specifically,
issues that are labeled
[help wanted](https://github.com/xi-editor/xi-editor/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and/or
[easy](https://github.com/xi-editor/xi-editor/issues?q=is%3Aissue+is%3Aopen+label%3Aeasy)
are good places to start. If you can't find anything there, feel free to ask
on IRC, or play around with the editor and try to identify something that
_you_ think is missing.
### Before you start work
Before starting to work on an issue, consider the following:
- _Is it a bugfix or small change?_ If you notice a small bug somewhere,
and you believe you have a fix, feel free to open a pull request directly.
- _Is it a feature?_ If you have an idea for a new editor feature that is
along the lines of something that already exists (for instance, adding a
new command to reverse the letters in a selected region) _consider_
opening a short issue beforehand, describing the feature you have in mind.
Other contributors might be able to identify possible issues or
refinements. This isn't _necessary_, but it might end up saving you work,
and it means you will get to close an issue when your PR gets merged,
which feels good.
- _Is it a major feature, affecting for instance the behaviour or appearance
of a frontend, or the API or architecture of core?_ Before working on a
large change, please open a discussion/proposal issue. This should describe
the problem you're trying to solve, and the approach you're considering;
think of this as a 'lite' version of Rust's
[RFC](https://github.com/rust-lang/rfcs) process.
### Before you open your PR
Before pressing the 'Create pull request' button,
- _Run the tests_. It's easy to accidentally break something with even a small
change, so always run the tests locally before submitting (or updating) a PR.
You can run all checks locally with the `xi-editor/rust/run_all_checks`. script.
- _Add a message for your reviewers_. When submitting a PR, take advantage
of the opportunity to include a message. Your goal here should be to help
your reviewers. Are there any parts of your change that you're uncertain
about? Are there any non-obvious explanations for some of your decisions?
If your change changes some behaviour, how might it be tested?
- ***Be your own first reviewer***. On the page where you enter your message,
you have a final opportunity to see your PR _as it will be seen by your
reviewers_. This is a great opportunity to give it one last review, yourself.
Imagine that it is someone else's work, that you're reviewing: what comments
would you have? If you spot a typo or a problem, you can push an update in
place, without losing your PR message or other state.
- _Add yourself to the AUTHORS file_. If this is your first substantive pull
request in this repo, feel free to add yourself to the AUTHORS file.
### Review process
Every non-trivial pull request goes through review. Everyone is welcome to
participate in review; review is an excellent time to ask questions about
code or design decisions that you don't understand.
All pull requests must be approved by an appropriate reviewer before they
are merged. For bug fixes and smaller changes, this can be anyone who has
commit rights to the repo in question; larger changes (changes which add a
feature, or significantly change behaviour or API) should also be approved by
a maintainer.
Before being merged, a change must pass
[CI](https://en.wikipedia.org/wiki/Continuous_integration).
#### Responsibilites of the approving reviewer
If you approve a change, it is expected that you:
- understand what the change is trying to do, and how it is doing it
- have manually built and tested the change, to verify it works as intended
- believe the change generally matches the idioms, formatting rules,
and overall coding style of the relevant repo
- are ready and able to help resolve any problems that may be introduced by
merging the change.
If a PR is made by a contributor who has write access to the repo in question,
they are responsible for merging/rebasing the PR after it has been approved;
otherwise it will be merged by the reviewer.
If a patch adds or modifies behaviour that is observable in the client,
the reviewer should build the patch and verify that it works as expected.
### After submitting your change
You've done all this, and submitted your patch. What now?
_Read other PRs_. If you're waiting for a review, it's likely that other
pull requests are waiting for review as well. This can be a good time
to go and take a look at what other work is happening in the project;
and if another PR has review comments, it might provide a clue to the
type of feedback you might expect.
_Patience_. As a general goal, we try to respond to all pull requests
within a few days, and to do preliminary review within a week, but we
don't always succeed. If you've opened a PR and haven't heard from
anyone, feel free to comment on it, or stop by the IRC channel, to ask
if anyone has had a chance to take a look. It's very possible that it's
been lost in the shuffle.
## Getting more involved
If you are participating in the xi-editor project, you may receive
additional privileges:
_Organization membership_: If you are regularly making contributions
to a xi project, in any of the forms outlined above, we will be happy to
add you to the xi-editor organization, which will give you the ability
to do things like add labels to issues and view active projects.
_Contributor_: If you are regularly making substantive contributions
to a specific xi project, we will be happy to add you as a contributor
to the repo in question. Contributors are encouraged to review and
approve changes, respond to issues, and generally help to maintain
the project in question.
_Maintainer_: If you are making substantive contributions to multiple
repos over an extended period, you are regularly reviewing the work of
other contributors, and you are actively participating in planning and
discussion, you may, (at the discretion of @raphlinus) be invited to
take on the role of _maintainer_. Maintainers are responsible for
coordinating the general direction of the project, resolving
architectural questions, and doing the day to day work of moving the
project forward.
/**
* (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 <corsika/geometry/CoordinateSystem.h>
#include <corsika/geometry/Point.h>
#include <corsika/geometry/Sphere.h>
......
/**
* (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 <corsika/geometry/CoordinateSystem.h>
#include <corsika/geometry/Helix.h>
#include <corsika/geometry/Point.h>
......
/**
* (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 <corsika/logging/Logger.h>
#include <boost/format.hpp>
#include <fstream>
......
/**
* (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 <corsika/particles/ParticleProperties.h>
#include <corsika/stack/super_stupid/SuperStupidStack.h>
#include <iomanip>
......
/**
* (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 <array>
#include <iomanip>
#include <iostream>
......
/**
* (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.
*/
......@@ -51,11 +51,13 @@ add_executable (
target_link_libraries (
testCascade
# CORSIKAutls
CORSIKAcascade
ProcessStackInspector
CORSIKAprocesses
CORSIKAparticles
CORSIKAgeometry
CORSIKAprocesssequence
SuperStupidStack
CORSIKAunits
CORSIKAthirdparty # for catch2
)
......
/**
* (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 <corsika/cascade/Cascade.h>
using namespace corsika::cascade;
template <typename ProcessList, typename Particle, typename Trajectory, typename Stack>
Cascade<ProcessList, Particle, Trajectory, Stack>::Cascade() {
// kkk;
// kk;
}
template <typename ProcessList, typename Particle, typename Trajectory, typename Stack>
template <typename ProcessList, typename Stack> //, typename Trajectory>
void Cascade::Init() {
fStack.Init();
fProcesseList.Init();
}
template <typename ProcessList, typename Particle, typename Trajectory, typename Stack>
template <typename ProcessList, typename Stack> //, typename Trajectory>
void Cascade::Run() {
if (!fStack.IsEmpty()) {
if (!fStack.IsEmpty()) {
......@@ -27,10 +32,11 @@ void Cascade::Run() {
}
}
template <typename Sequence, typename Trajectory>
template <typename ProcessList, typename Stack> //, typename Trajectory>
void Cascade::Step(Particle& particle) {
double nextStep = fProcesseList.MinStepLength(particle);
Trajectory trajectory = fProcesseList.Transport(particle, nextStep);
corsika::geometry::LineTrajectory trajectory =
fProcesseList.Transport(particle, nextStep);
sequence.DoContinuous(particle, trajectory);
sequence.DoDiscrete(particle);
}
/**
* (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_Cascade_h_
#define _include_Cascade_h_
#include <corsika/geometry/LineTrajectory.h> // to be removed
#include <corsika/geometry/Point.h> // to be removed
#include <corsika/geometry/LineTrajectory.h> // to be removed. for dummy trajectory only
#include <corsika/geometry/Point.h> // to be removed. for dummy trajectory only
#include <corsika/process/ProcessReturn.h>
#include <corsika/units/PhysicalUnits.h>
......@@ -10,11 +21,13 @@ using namespace corsika::units::si;
namespace corsika::cascade {
template <typename Trajectory, typename ProcessList, typename Stack>
template <typename ProcessList, typename Stack> //, typename Trajectory>
class Cascade {
typedef typename Stack::ParticleType Particle;
Cascade() = delete;
public:
Cascade(ProcessList& pl, Stack& stack)
: fProcesseList(pl)
......@@ -28,34 +41,37 @@ namespace corsika::cascade {
void Run() {
while (!fStack.IsEmpty()) {
while (!fStack.IsEmpty()) {
// Particle& p = *fStack.GetNextParticle();
EnergyType Emin;
typename Stack::StackIterator pMin(fStack, 0);
bool first = true;
for (typename Stack::StackIterator ip = fStack.begin(); ip != fStack.end();
++ip) {
Particle& pNext = *fStack.GetNextParticle();
/*
EnergyType Emin;
typename Stack::StackIterator pNext(fStack, 0);
bool first = true;
for (typename Stack::StackIterator ip = fStack.begin(); ip != fStack.end();
++ip) {
if (first || ip.GetEnergy() < Emin) {
first = false;
pMin = ip;
Emin = pMin.GetEnergy();
first = false;
pNext = ip;
Emin = pMin.GetEnergy();
}
}
Step(pMin);
}
*/
Step(pNext);
}
// do cascade equations, which can put new particles on Stack,
// thus, the double loop
// DoCascadeEquations(); //
}
}
void Step(Particle& particle) {
double nextStep = fProcesseList.MinStepLength(particle);
[[maybe_unused]] double nextStep = fProcesseList.MinStepLength(particle);
// corsika::utls::ignore(nextStep);
corsika::geometry::CoordinateSystem root;
Trajectory trajectory(
corsika::geometry::Point(root, {0_m, 0_m, 0_m}),
corsika::geometry::Vector<corsika::units::si::SpeedType::dimension_type>(
root, 0 * 1_m / second, 0 * 1_m / second, 1 * 1_m / second));
corsika::geometry::LineTrajectory
trajectory( // trajectory is not yet used. this is a dummy.
corsika::geometry::Point(root, {0_m, 0_m, 0_m}),
corsika::geometry::Vector<corsika::units::si::SpeedType::dimension_type>(
root, 0 * 1_m / second, 0 * 1_m / second, 1 * 1_m / second));
corsika::process::EProcessReturn status =
fProcesseList.DoContinuous(particle, trajectory, fStack);
if (status == corsika::process::EProcessReturn::eParticleAbsorbed) {
......@@ -64,10 +80,10 @@ namespace corsika::cascade {
fProcesseList.DoDiscrete(particle, fStack);
}
}
private:
Stack& fStack;
ProcessList& fProcesseList;
Stack& fStack;
};
} // namespace corsika::cascade
......
/**
* (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.
*/
namespace cascade;
......
/**
* (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 <corsika/cascade/Cascade.h>
#include <corsika/geometry/LineTrajectory.h>
#include <corsika/process/ProcessSequence.h>
#include <corsika/process/stack_inspector/StackInspector.h>
#include <corsika/stack/super_stupid/SuperStupidStack.h>
#include <corsika/setup/SetupStack.h>
#include <corsika/setup/SetupTrajectory.h>
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one
// cpp file
#include <catch2/catch.hpp>
using namespace corsika;
using namespace corsika::process;
using namespace corsika::units;
......@@ -26,7 +40,8 @@ public:
}
template <typename Particle, typename Trajectory, typename Stack>
EProcessReturn DoContinuous(Particle& p, Trajectory& t, Stack& s) const {
EProcessReturn DoContinuous(Particle&, Trajectory&, Stack&) const {
// corsika::utls::ignore(p);
return EProcessReturn::eOk;
}
......@@ -49,55 +64,14 @@ public:
private:
};
class ProcessReport : public corsika::process::BaseProcess<ProcessReport> {
bool fReport = false;
public:
ProcessReport(bool v)
: fReport(v) {}
template <typename Particle>
double MinStepLength(Particle&) const {
return 0;
}
template <typename Particle, typename Trajectory, typename Stack>
EProcessReturn DoContinuous(Particle& p, Trajectory& t, Stack& s) const {
static int countStep = 0;
if (!fReport) return EProcessReturn::eOk;
// std::cout << "generation " << countStep << std::endl;
int i = 0;
EnergyType Etot = 0_GeV;
for (auto& iterP : s) {
EnergyType E = iterP.GetEnergy();
Etot += E;
/* std::cout << " particle data: " << i++ << ", id=" << iterP.GetPID()
<< ", E=" << double(E / 1_GeV) << " GeV "
<< " | " << std::endl;
*/
}
countStep++;
// cout << "#=" << countStep << " " << s.GetSize() << " " << Etot/1_GeV << endl;
cout << countStep << " " << s.GetSize() << " " << Etot / 1_GeV << " " << fCount
<< endl;
return EProcessReturn::eOk;
}
template <typename Particle, typename Stack>
void DoDiscrete(Particle& p, Stack& s) const {}
void Init() {}
};
TEST_CASE("Cascade", "[Cascade]") {
ProcessReport p0(true);
stack_inspector::StackInspector<setup::Stack, setup::Trajectory> p0(true);
ProcessSplit p1;
const auto sequence = p0 + p1;
corsika::stack::super_stupid::SuperStupidStack stack;
setup::Stack stack;
corsika::cascade::Cascade<corsika::geometry::LineTrajectory, decltype(sequence),
decltype(stack)>
EAS(sequence, stack);
corsika::cascade::Cascade EAS(sequence, stack);
stack.Clear();
auto particle = stack.NewParticle();
......
/**
* (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_BASETRAJECTORY_H
#define _include_BASETRAJECTORY_H
......
/**
* (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_BASEVECTOR_H_
#define _include_BASEVECTOR_H_
......
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