diff --git a/Framework/Geometry/CMakeLists.txt b/Framework/Geometry/CMakeLists.txt index 4d708ff109e6d259a352e82536cece0f0bc4c53a..bb96c2ea6bf5cf6e228b23fb7471c73c1b282923 100644 --- a/Framework/Geometry/CMakeLists.txt +++ b/Framework/Geometry/CMakeLists.txt @@ -17,7 +17,7 @@ set ( BaseVector.h QuantityVector.h Trajectory.h - # BaseTrajectory.h + FourVector.h ) set ( @@ -57,16 +57,22 @@ install ( PUBLIC_HEADER DESTINATION include/${GEOMETRY_NAMESPACE} ) - # -------------------- # code unit testing add_executable (testGeometry testGeometry.cc) - target_link_libraries ( testGeometry CORSIKAgeometry CORSIKAunits CORSIKAthirdparty # for catch2 ) - CORSIKA_ADD_TEST(testGeometry) + +add_executable (testFourVector testFourVector.cc) +target_link_libraries ( + testFourVector + CORSIKAgeometry + CORSIKAunits + CORSIKAthirdparty # for catch2 + ) +CORSIKA_ADD_TEST(testFourVector) diff --git a/Framework/Geometry/QuantityVector.h b/Framework/Geometry/QuantityVector.h index bb498f086d7f0a20fbfd1aea0682f182c7dcaf80..e0893e52706312ee6ed8b58478ee4b6802ff6cf1 100644 --- a/Framework/Geometry/QuantityVector.h +++ b/Framework/Geometry/QuantityVector.h @@ -29,8 +29,7 @@ namespace corsika::geometry { template <typename dim> class QuantityVector { - protected: - // todo: check if we need to move "quantity" into namespace corsika::units + public: using Quantity = phys::units::quantity<dim, double>; //< the phys::units::quantity // corresponding to the dimension diff --git a/Framework/Geometry/Vector.h b/Framework/Geometry/Vector.h index 94394b90dd859761d4f15d0a2389f173726ee34d..712eece61380c75bd36dea77b17a5650690b79b5 100644 --- a/Framework/Geometry/Vector.h +++ b/Framework/Geometry/Vector.h @@ -31,6 +31,7 @@ namespace corsika::geometry { template <typename dim> class Vector : public BaseVector<dim> { + public: using Quantity = phys::units::quantity<dim, double>; public: diff --git a/Framework/ProcessSequence/ProcessSequence.h b/Framework/ProcessSequence/ProcessSequence.h index 632c57848fc734861cd2dab29325a0c0961206ff..c6a0cb5444c13bd798a56b7c92c3c86eef9df087 100644 --- a/Framework/ProcessSequence/ProcessSequence.h +++ b/Framework/ProcessSequence/ProcessSequence.h @@ -259,39 +259,6 @@ namespace corsika::process { return ProcessSequence<P1, P2>(A.GetRef(), B.GetRef()); } - /* #define OPSEQ(C1, C2) \ */ - /* template < \ */ - /* typename P1, typename P2, \ */ - /* typename std::enable_if<is_process<typename std::decay<P1>::type>::value && - * \ */ - /* is_process<typename - * std::decay<P2>::type>::value>::type...> \ */ - /* inline auto operator+(P1&& A, P2&& B)->ProcessSequence<P1, P2> { \ */ - /* return ProcessSequence<P1, P2>(A.GetRef(), B.GetRef()); \ */ - /* } */ - - /* /\*template <typename T1, typename T2> \ */ - /* inline ProcessSequence<T1, T2> operator%(C1<T1>& A, C2<T2>& B) { \ */ - /* return ProcessSequence<T1, T2>(A.GetRef(), B.GetRef()); \ */ - /* }*\/ */ - - /* OPSEQ(BaseProcess, BaseProcess) */ - /* OPSEQ(BaseProcess, InteractionProcess) */ - /* OPSEQ(BaseProcess, ContinuousProcess) */ - /* OPSEQ(BaseProcess, DecayProcess) */ - /* OPSEQ(ContinuousProcess, BaseProcess) */ - /* OPSEQ(ContinuousProcess, InteractionProcess) */ - /* OPSEQ(ContinuousProcess, ContinuousProcess) */ - /* OPSEQ(ContinuousProcess, DecayProcess) */ - /* OPSEQ(InteractionProcess, BaseProcess) */ - /* OPSEQ(InteractionProcess, InteractionProcess) */ - /* OPSEQ(InteractionProcess, ContinuousProcess) */ - /* OPSEQ(InteractionProcess, DecayProcess) */ - /* OPSEQ(DecayProcess, BaseProcess) */ - /* OPSEQ(DecayProcess, InteractionProcess) */ - /* OPSEQ(DecayProcess, ContinuousProcess) */ - /* OPSEQ(DecayProcess, DecayProcess) */ - /// marker to identify objectas ProcessSequence template <typename A, typename B> struct is_process_sequence<corsika::process::ProcessSequence<A, B> > { diff --git a/Framework/Units/PhysicalUnits.h b/Framework/Units/PhysicalUnits.h index 262e55d1c52070e36add9404f0d2ba67bae347bc..5861f9a45d24aae10bdc6640244e9f0692d5cd18 100644 --- a/Framework/Units/PhysicalUnits.h +++ b/Framework/Units/PhysicalUnits.h @@ -79,20 +79,35 @@ namespace corsika::units::si { /** * @file PhysicalUnits * - * Define _XeV literals, alowing 10_GeV in the code. - * Define _barn literal */ namespace phys { namespace units { namespace literals { + + /** + * Define new _XeV literals, alowing 10_GeV in the code. + * Define new _barn literal + */ + QUANTITY_DEFINE_SCALING_LITERALS(eV, hepenergy_d, 1) QUANTITY_DEFINE_SCALING_LITERALS(barn, corsika::units::si::sigma_d, magnitude(corsika::units::constants::barn)) - // QUANTITY_DEFINE_SCALING_LITERALS(Ns, corsika::units::si::momentum_d, - // magnitude(1_m * 1_kg / 1_s)) + /** + * add additional literals missing in the original library: + * + */ + + QUANTITY_DEFINE_SCALING_LITERALS(gram, mass_d, 1e-3) + + /* + QUANTITY_DEFINE_LITERALS(meter, length_d) + QUANTITY_DEFINE_LITERALS(second, time_interval_d) + QUANTITY_DEFINE_LITERALS(ampere, electric_current_d) + QUANTITY_DEFINE_LITERALS(Kelvin, thermodynamic_temperature_d) + */ } // namespace literals } // namespace units diff --git a/ThirdParty/phys/units/quantity.hpp b/ThirdParty/phys/units/quantity.hpp index 890061b950a0bb84903a271115eed9e89016b3e8..bec55318685ffb0e69bfeeb19260ef20e6d1eed1 100644 --- a/ThirdParty/phys/units/quantity.hpp +++ b/ThirdParty/phys/units/quantity.hpp @@ -438,7 +438,7 @@ namespace phys { typedef dimensions<0, 0, 0, 0, 1, 0, 0, 0> thermodynamic_temperature_d; typedef dimensions<0, 0, 0, 0, 0, 1, 0, 0> amount_of_substance_d; typedef dimensions<0, 0, 0, 0, 0, 0, 1, 0> luminous_intensity_d; - typedef dimensions<0, 0, 0, 0, 0, 0, 0, 1> hepenergy_d; + typedef dimensions<0, 0, 0, 0, 0, 0, 0, 1> hepenergy_d; // this is not an SI unit ! // Addition operators