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 325 additions and 11 deletions
add_subdirectory (NullModel)
#add_subdirectory (Sibyll)
add_subdirectory (StackInspector)
#add_custom_target(CORSIKAprocesses)
add_library (CORSIKAprocesses INTERFACE)
add_dependencies(CORSIKAprocesses ProcessNullModel)
add_dependencies(CORSIKAprocesses ProcessSibyll)
add_dependencies(CORSIKAprocesses ProcessStackInspector)
/**
* (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/process/null_model/NullModel.h>
using namespace corsika::process::null_model;
......
/**
* (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 _Physics_NullModel_NullModel_h_
#define _Physics_NullModel_NullModel_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.
*/
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one
// cpp file
#include <catch2/catch.hpp>
......
/**
* (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/process/sibyll/ParticleConversion.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_processes_sibyll_particles_h_
#define _include_processes_sibyll_particles_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/particles/ParticleProperties.h>
#include <corsika/process/sibyll/ParticleConversion.h>
#include <corsika/units/PhysicalUnits.h>
......
......@@ -29,6 +29,7 @@ set_target_properties (
target_link_libraries (
ProcessStackInspector
CORSIKAunits
CORSIKAsetup
)
target_include_directories (
......@@ -52,7 +53,6 @@ add_executable (testStackInspector testStackInspector.cc)
target_link_libraries (
testStackInspector
CORSIKAgeometry
CORSIKAunits
CORSIKAthirdparty # for catch2
)
......
#include <corsika/process/stack_inspector/StackInspector.h>
#include <corsika/units/PhysicalUnits.h>
#include <iostream>
using namespace std;
using namespace corsika;
using namespace corsika::units::si;
using namespace corsika::process::stack_inspector;
StackInspector::StackInspector() {}
template <typename Stack, typename Trajectory>
StackInspector<Stack, Trajectory>::StackInspector(const bool aReport)
: fReport(aReport) {}
template <typename Stack, typename Trajectory>
StackInspector<Stack, Trajectory>::~StackInspector() {}
template <typename Stack, typename Trajectory>
process::EProcessReturn StackInspector<Stack, Trajectory>::DoContinuous(Particle&,
Trajectory&,
Stack& s) const {
// using namespace corsika::particles::io;
static int countStep = 0;
if (!fReport) return EProcessReturn::eOk;
// std::cout << "generation " << countStep << std::endl;
[[maybe_unused]] int i = 0;
EnergyType Etot = 0_GeV;
for (auto& iterP : s) {
EnergyType E = iterP.GetEnergy();
Etot += E;
// std::cout << " particle data: " << i++ << ", id=" << iterP << " | " << std::endl;
}
countStep++;
// cout << "#=" << countStep << " " << s.GetSize() << " " << Etot/1_GeV << endl;
cout << countStep << " " << s.GetSize() << " " << Etot / 1_GeV << " " << endl;
return EProcessReturn::eOk;
}
template <typename Stack, typename Trajectory>
double StackInspector<Stack, Trajectory>::MinStepLength(Particle&) const {
return 0;
}
StackInspector::~StackInspector() {}
template <typename Stack, typename Trajectory>
void StackInspector<Stack, Trajectory>::DoDiscrete(Particle&, Stack&) const {}
void StackInspector::init() {}
template <typename Stack, typename Trajectory>
void StackInspector<Stack, Trajectory>::Init() {}
void StackInspector::run() {}
#include <corsika/setup/SetupStack.h>
#include <corsika/setup/SetupTrajectory.h>
double StackInspector::GetStepLength() { return 0; }
template class corsika::process::stack_inspector::StackInspector<setup::Stack,
setup::Trajectory>;
#ifndef _Physics_StackInspector_StackInspector_h_
#define _Physics_StackInspector_StackInspector_h_
#include <corsika/process/ProcessSequence.h>
namespace corsika::process {
namespace stack_inspector {
class StackInspector {
template <typename Stack, typename Trajectory>
class StackInspector
: public corsika::process::BaseProcess<StackInspector<Stack, Trajectory>> {
typedef typename Stack::ParticleType Particle;
public:
StackInspector();
StackInspector(const bool aReport);
~StackInspector();
void init();
void run();
double GetStepLength();
void Init();
// template <typename Particle, typename Trajectory, typename Stack>
EProcessReturn DoContinuous(Particle&, Trajectory&, Stack& s) const;
// template <typename Particle>
double MinStepLength(Particle&) const;
// template <typename Particle, typename Stack>
void DoDiscrete(Particle&, Stack&) const;
private:
bool fReport;
};
} // namespace stack_inspector
......
(empty...tbd)
set (
SETUP_HEADERS
SetupStack.h
SetupLogger.h
SetupEnvironment.h
SetupTrajectory.h
)
set (
SETUP_NAMESPACE
corsika/setup
)
add_library (CORSIKAsetup INTERFACE)
CORSIKA_COPY_HEADERS_TO_NAMESPACE (CORSIKAsetup ${SETUP_NAMESPACE} ${SETUP_HEADERS})
target_link_libraries (
CORSIKAsetup
INTERFACE
CORSIKAgeometry
SuperStupidStack
)
target_include_directories (
CORSIKAsetup
INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/include>
)
install (
FILES ${SETUP_HEADERS}
DESTINATION include/${SETUP_NAMESPACE}
)
#ifndef _include_corsika_setup_environment_h_
#define _include_corsika_setup_environment_h_
namespace corsika {}
#endif
#ifndef _include_corsika_setup_logger_h_
#define _include_corsika_setup_logger_h_
namespace corsika {}
#endif
#ifndef _corsika_setup_setupstack_h_
#define _corsika_setup_setupstack_h_
#include <corsika/stack/super_stupid/SuperStupidStack.h>
namespace corsika::setup {
typedef corsika::stack::super_stupid::SuperStupidStack Stack;
}
#endif
#ifndef _corsika_setup_setuptrajectory_h_
#define _corsika_setup_setuptrajectory_h_
#include <corsika/geometry/LineTrajectory.h>
namespace corsika::setup {
typedef corsika::geometry::LineTrajectory Trajectory;
}
#endif
/**
* (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_dummystack_h_
#define _include_dummystack_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_superstupidstack_h_
#define _include_superstupidstack_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_superstupidstack_h_
#define _include_superstupidstack_h_
......
#!/usr/bin/python
import os.path
text = """
/**
* (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.
*/\n
"""
excludeDirs = ["ThirdParty", "git"]
excludeFiles = ['PhysicalConstants.h']
extensions = [".cc", ".h", ".test"]
def checkNote(filename):
startNote = -1
endNote = -1
isCopyright = False
lines = []
with open(filename, "r") as file:
for line in file.readlines():
lines.append(line)
file.close()
for iLine in range(len(lines)):
line = lines[iLine]
if "/**" in line and startNote == -1:
startNote = iLine
if "copyright" in line.lower() and startNote>=0 and endNote==-1:
isCopyright = True
if "*/" in line and startNote>=0 and endNote==-1:
endNote = iLine
iLine += 1
#if startNote>=0 and endNote>=0 and isCopyright:
#print filename
#for iLine in range(startNote, endNote+1):
# print lines[iLine]
os.rename(filename, filename+".bak")
with open(filename, "w") as file:
file.write(text)
firstLine = 0
if startNote>=0 and endNote>=0 and isCopyright:
firstLine = endNote + 2
for iLine in range(firstLine, len(lines)):
file.write(lines[iLine])
file.close()
def next_file(x, dir_name, files):
for check in excludeDirs :
if check in dir_name:
return
for check in files :
filename, file_extension = os.path.splitext(check)
for check2 in excludeFiles :
if check2 in check:
return
if file_extension in extensions:
checkNote(dir_name + "/" + check)
os.path.walk("./", next_file, 0)
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