IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 10f92d41 authored by ralfulrich's avatar ralfulrich
Browse files

template parameter naming

parent 06c6a9ac
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,6 @@ namespace corsika::process {
const TParticle& particle) {
return 1. / GetRef().GetInteractionLength(particle);
}
};
} // namespace corsika::process
......@@ -61,9 +61,9 @@ namespace corsika::process {
: A_(in_A)
, B_(in_B) {}
template <typename Particle, typename VTNType>
EProcessReturn DoBoundaryCrossing(Particle& particle, VTNType const& from,
VTNType const& to) {
template <typename TParticle, typename TVTNType>
EProcessReturn DoBoundaryCrossing(TParticle& particle, TVTNType const& from,
TVTNType const& to) {
EProcessReturn ret = EProcessReturn::eOk;
if constexpr (std::is_base_of_v<BoundaryCrossingProcess<TProcess1type>,
......
......@@ -21,6 +21,7 @@
#include <cmath>
#include <limits>
#include <type_traits>
namespace corsika::process {
......@@ -60,6 +61,11 @@ namespace corsika::process {
using TProcess1type = typename std::decay<TProcess1>::type;
using TProcess2type = typename std::decay<TProcess2>::type;
// static_assert(std::is_base_of_v<!StackProcess<TProcess1>, TProcess1type>, "canot
// use StackProcess in SwitchProcessSequence");
// static_assert(std::is_base_of_v<!StackProcess<TProcess2>, TProcess2type>, "canot
// use StackProcess in SwitchProcessSequence");
static bool constexpr t1ProcSeq = is_process_sequence_v<TProcess1type>;
static bool constexpr t2ProcSeq = is_process_sequence_v<TProcess2type>;
......@@ -74,9 +80,9 @@ namespace corsika::process {
, A_(in_A)
, B_(in_B) {}
template <typename Particle, typename VTNType>
EProcessReturn DoBoundaryCrossing(Particle& particle, VTNType const& from,
VTNType const& to) {
template <typename TParticle, typename TVTNType>
EProcessReturn DoBoundaryCrossing(TParticle& particle, TVTNType const& from,
TVTNType const& to) {
switch (select_(particle)) {
case SwitchResult::First: {
......
......@@ -287,8 +287,8 @@ TEST_CASE("Process Sequence", "[Process Sequence]") {
InverseGrammageType const tot_inv = sequence2.GetInverseInteractionLength(particle);
cout << "lambda_tot=" << tot << "; lambda_tot_inv=" << tot_inv << endl;
CHECK(tot/1_g*square(1_cm) == 12);
CHECK(tot_inv*1_g/square(1_cm) == 1./12);
CHECK(tot / 1_g * square(1_cm) == 12);
CHECK(tot_inv * 1_g / square(1_cm) == 1. / 12);
globalCount = 0;
}
......@@ -306,8 +306,8 @@ TEST_CASE("Process Sequence", "[Process Sequence]") {
InverseTimeType const tot_inv = sequence2.GetInverseLifetime(particle);
cout << "lambda_tot=" << tot << "; lambda_tot_inv=" << tot_inv << endl;
CHECK(tot/1_s == 1);
CHECK(tot_inv*1_s == 1.);
CHECK(tot / 1_s == 1);
CHECK(tot_inv * 1_s == 1.);
globalCount = 0;
}
......@@ -315,8 +315,8 @@ TEST_CASE("Process Sequence", "[Process Sequence]") {
globalCount = 0;
ContinuousProcess1 cp1(0); // += 0.933
ContinuousProcess2 cp2(1); // += 0.111
Process2 m2(2); // /= 1.1
Process3 m3(3); // *= 1.01
Process2 m2(2); // /= 1.1
Process3 m3(3); // *= 1.01
auto sequence2 = sequence(cp1, m2, m3, cp2);
......@@ -329,13 +329,11 @@ TEST_CASE("Process Sequence", "[Process Sequence]") {
// validation data
double test_data[nData] = {0};
const int nLoop = 5;
cout << "Running loop with n=" << nLoop << endl;
for (int iLoop = 0; iLoop < nLoop; ++iLoop) {
for (int i=0; i<nData; ++i) {
test_data[i] += 0.933 + 0.111;
}
for (int i = 0; i < nData; ++i) { test_data[i] += 0.933 + 0.111; }
sequence2.DoContinuous(particle, track);
}
for (int i = 0; i < nData; i++) {
......
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