Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
brew update
brew install \
cmake \
coreutils \
Expand Down
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ set( Boost_USE_STATIC_RUNTIME OFF )

set( CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard whose features are requested to build this target" )
mark_as_advanced( FORCE CMAKE_CXX_STANDARD )

# ROOT may force a newer C++ standard
# Using the same C++ standard as ROOT is recommended in https://root.cern/manual/integrate_root_into_my_cmake_project/ .
# Older ROOT releases don't export ROOT_CXX_STANDARD at all, so only override our default when it's actually set.
find_package(ROOT QUIET)
if(ROOT_FOUND AND KASPER_USE_ROOT AND ROOT_CXX_STANDARD)
set( CMAKE_CXX_STANDARD ${ROOT_CXX_STANDARD} CACHE STRING "The C++ standard, as requested by the ROOT library. Can't be changed." FORCE)
endif()

set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS ON )
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
Expand Down Expand Up @@ -187,7 +196,7 @@ mark_as_advanced( CLEAR CMAKE_VERBOSE_MAKEFILE )
#option( KASPER_USE_BOOST "Build Boost dependent modules" ${Boost_FOUND} )
set(KASPER_USE_BOOST ON)

find_package(ROOT QUIET)
#ROOT was already searched at the beginning for the C++ standard
if(ROOT_FOUND AND NOT DEFINED KASPER_USE_ROOT)
message("ROOT was found and enabled automatically. Set KASPER_USE_ROOT=OFF to change this.")
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void KGExtrudedSurfaceMesher::DiscretizeSegment(const KGExtrudedObject::Arc* arc
double n1[3] = {};
n1[2] = 0;

double p0[3];
double p0[3] = {};
p0[2] = fExtrudedObject->GetZMin();

double xy_len = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ void KGPortHousingSurfaceMesher::VisitWrappedSurface(KGWrappedSurface<KGPortHous
double x_loc[3];
double y_loc[3];
double z_loc[3];
double x_min;
double x_max;
double x_min = 0.;
double x_max = 0.;

KGCoordinateTransform* coordTransform = nullptr;

Expand Down
12 changes: 6 additions & 6 deletions Kassiopeia/Trajectories/Source/KSTrajTermPropagation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ KSTrajTermPropagation::~KSTrajTermPropagation() = default;
void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajExactParticle& aParticle,
KSTrajExactDerivative& aDerivative) const
{
KThreeVector tVelocity = fDirection * aParticle.GetVelocity();
KThreeVector tVelocity = (+fDirection) * aParticle.GetVelocity();
KThreeVector tForce =
aParticle.GetCharge() * (aParticle.GetElectricField() + tVelocity.Cross(aParticle.GetMagneticField()));

Expand All @@ -39,7 +39,7 @@ void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajExactSpi
{
double TempSN = std::sqrt(aParticle.GetSpin().MagnitudeSquared() - aParticle.GetSpin0() * aParticle.GetSpin0());

KThreeVector tVelocity = fDirection * aParticle.GetVelocity();
KThreeVector tVelocity = (+fDirection) * aParticle.GetVelocity();

KThreeVector MagneticMoment = aParticle.GetGyromagneticRatio() * aParticle.GetSpin() /
aParticle.GetSpin().Magnitude() * aParticle.GetSpinMagnitude() *
Expand Down Expand Up @@ -157,7 +157,7 @@ void KSTrajTermPropagation::Differentiate(double aTime, const KSTrajExactTrapped
void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajAdiabaticParticle& aParticle,
KSTrajAdiabaticDerivative& aDerivative) const
{
double tLongVelocity = fDirection * aParticle.GetLongVelocity();
double tLongVelocity = (+fDirection) * aParticle.GetLongVelocity();
double tLongitudinalMomentum = aParticle.GetLongMomentum();
double tTransverseMomentum = aParticle.GetTransMomentum();
double tLorentzFactor = aParticle.GetLorentzFactor();
Expand Down Expand Up @@ -219,7 +219,7 @@ void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajAdiabati
GradE1 / E1.Magnitude() - KThreeMatrix::OuterProduct(E1, GradE1Magnitude) / E1.Magnitude() / E1.Magnitude();
KThreeVector A = Grade1 * e2;

KThreeVector tVelocity = fDirection * aParticle.GetVelocity();
KThreeVector tVelocity = (+fDirection) * aParticle.GetVelocity();
KThreeVector tForce =
aParticle.GetCharge() * (aParticle.GetElectricField() + tVelocity.Cross(aParticle.GetMagneticField())) +
aParticle.GetGyromagneticRatio() * aParticle.GetSpinMagnitude() * katrin::KConst::Hbar() *
Expand All @@ -244,7 +244,7 @@ void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajAdiabati
void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajMagneticParticle& aParticle,
KSTrajMagneticDerivative& aDerivative) const
{
KThreeVector tVelocity = fDirection * aParticle.GetMagneticField().Unit();
KThreeVector tVelocity = (+fDirection) * aParticle.GetMagneticField().Unit();

aDerivative.AddToVelocity(tVelocity);

Expand All @@ -254,7 +254,7 @@ void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajMagnetic
void KSTrajTermPropagation::Differentiate(double /*aTime*/, const KSTrajElectricParticle& aParticle,
KSTrajElectricDerivative& aDerivative) const
{
KThreeVector tVelocity = fDirection * aParticle.GetElectricField().Unit();
KThreeVector tVelocity = (+fDirection) * aParticle.GetElectricField().Unit();

aDerivative.AddToVelocity(tVelocity);

Expand Down
1 change: 0 additions & 1 deletion Kommon/Base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ set(KOMMON_BASE_HEADER_FILES
Utility/Gnuplot.hpp

Utility/KUtilityMessage.h
Utility/KAlgorithm.h
Utility/KException.h
Utility/KCast.h
Utility/KConst_2006.h
Expand Down
53 changes: 0 additions & 53 deletions Kommon/Base/Utility/KAlgorithm.h

This file was deleted.

4 changes: 2 additions & 2 deletions Kommon/Math/include/KMathIntegrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ template<class XIntegrandType>
inline XFloatT KMathIntegrator<XFloatT, XSamplingPolicy>::QAGS(XIntegrandType&& integrand)
{
/*Use gsl implementation for integral int_a^b. Implementation is experimental. */
const uint ws_size = 100;
const size_t ws_size = 100;
gsl_integration_workspace* workspace = gsl_integration_workspace_alloc(ws_size);
FType proxy = integrand;
gsl_function F=GSLFunction(proxy);
Expand Down Expand Up @@ -561,7 +561,7 @@ template<class XIntegrandType>
inline XFloatT KMathIntegrator<XFloatT, XSamplingPolicy>::QAGIU(XIntegrandType&& integrand)
{
/*Use gsl implementation for integral int_xmin^infty. Use case is the krypton spectrum. Implementation is experimental. */
const uint ws_size = 100;
const size_t ws_size = 100;
gsl_integration_workspace* workspace = gsl_integration_workspace_alloc(ws_size);
FType proxy = integrand;
gsl_function F=GSLFunction(proxy);
Expand Down
Loading