IAP GITLAB

Skip to content
Snippets Groups Projects
Commit cf0b0eb9 authored by ralfulrich's avatar ralfulrich Committed by Ralf Ulrich
Browse files

more docs

parent 1e778920
No related branches found
No related tags found
1 merge request!334readthedocs and better error messages
......@@ -47,10 +47,11 @@ namespace corsika {
static_assert(
has_method_doBoundaryCrossing_v<TProcess1, ProcessReturn, TParticle&>,
// typename TParticle::node_type const&,
// typename TParticle::node_type const&>,
// typename TParticle::node_type const&,
// typename TParticle::node_type const&>,
"TDerived has no method with correct signature \"ProcessReturn "
"doBoundaryCrossing(TParticle&, VolumeNode const&, VolumeNode const&)\" required for "
"doBoundaryCrossing(TParticle&, VolumeNode const&, VolumeNode const&)\" "
"required for "
"BoundaryCrossingProcess<TDerived>. ");
}
......@@ -69,10 +70,11 @@ namespace corsika {
static_assert(
has_method_doBoundaryCrossing_v<TProcess2, ProcessReturn, TParticle&>,
//typename TParticle::node_type const&,
// typename TParticle::node_type const&>,
// typename TParticle::node_type const&,
// typename TParticle::node_type const&>,
"TDerived has no method with correct signature \"ProcessReturn "
"doBoundaryCrossing(TParticle&, VolumeNode const&, VolumeNode const&)\" required for "
"doBoundaryCrossing(TParticle&, VolumeNode const&, VolumeNode const&)\" "
"required for "
"BoundaryCrossingProcess<TDerived>. ");
}
......@@ -98,8 +100,10 @@ namespace corsika {
static_assert(
has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle&, TTrack&> ||
has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle&, TTrack const&> ||
has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle const&, TTrack const&>,
has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle&,
TTrack const&> ||
has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle const&,
TTrack const&>,
"TDerived has no method with correct signature \"ProcessReturn "
"doContinuous(TParticle[const]&,TTrack[const]&,bool)\" required for "
"ContinuousProcess<TDerived>. ");
......@@ -116,8 +120,10 @@ namespace corsika {
// interface checking on TProcess2
static_assert(
has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle&, TTrack&> ||
has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle&, TTrack const&> ||
has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle const&, TTrack const&>,
has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle&,
TTrack const&> ||
has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle const&,
TTrack const&>,
"TDerived has no method with correct signature \"ProcessReturn "
"doContinuous(TParticle [const]&,TTrack[const]&,bool)\" required for "
"ContinuousProcess<TDerived>. ");
......@@ -190,7 +196,8 @@ namespace corsika {
// interface checking on TProcess1
static_assert(
has_method_getMaxStepLength_v<TProcess1, LengthType, TParticle const&, TTrack const&>,
has_method_getMaxStepLength_v<TProcess1, LengthType, TParticle const&,
TTrack const&>,
"TDerived has no method with correct signature \"LengthType "
"getMaxStepLength(TParticle const&, TTrack const&)\" required for "
"ContinuousProcess<TDerived>. ");
......@@ -206,7 +213,8 @@ namespace corsika {
// interface checking on TProcess2
static_assert(
has_method_getMaxStepLength_v<TProcess2, LengthType, TParticle const&, TTrack const&>,
has_method_getMaxStepLength_v<TProcess2, LengthType, TParticle const&,
TTrack const&>,
"TDerived has no method with correct signature \"LengthType "
"getMaxStepLength(TParticle const&, TTrack const&)\" required for "
"ContinuousProcess<TDerived>. ");
......
......@@ -18,8 +18,15 @@ namespace corsika {
@{
* Wrapper around an InteractionProcess that fills histograms of the number
* of calls to DoInteraction() binned in projectile energy (both in
* of calls to `doInteraction()` binned in projectile energy (both in
* lab and center-of-mass frame) and species
*
* Use by wrapping a normal InteractionProcess
* @code{.cpp}
* InteractionProcess collision1;
* InteractionClounter<collision1> counted_collision1;
* @endcode
*
*/
template <class TCountedProcess>
class InteractionCounter
......@@ -28,16 +35,19 @@ namespace corsika {
public:
InteractionCounter(TCountedProcess& process);
//! wrapper around internall process doInteraction
template <typename TSecondaryView>
void doInteraction(TSecondaryView& view);
///! returns internal process getInteractionLength
template <typename TParticle>
GrammageType getInteractionLength(TParticle const& particle) const;
/** returns the filles histograms
@return InteractionHistogram, which contains the histogram data
*/
InteractionHistogram const& getHistogram() const;
void blob(int) {}
private:
TCountedProcess& process_;
InteractionHistogram histogram_;
......
......@@ -25,6 +25,13 @@ namespace corsika {
/** @ingroup Processes
@{
Class that creates and stores histograms of collisions
@f$dN/dE_{lab}@f$, @f$dN/d\sqrt{s}@f$ which is used by class
InteractionCounter
Histograms are of type boost::histogram
*/
class InteractionHistogram {
......@@ -32,6 +39,11 @@ namespace corsika {
static double constexpr lower_edge_lab = 1e3, upper_edge_lab = 1e21; // eV lab
static unsigned int constexpr num_bins_lab = 18 * 10, num_bins_cms = 14 * 10;
/**
hist_type is a boost::histogram with two axes
- a growing PDG id axis
- a fixed logarithmic energy axis as configured by the user
*/
using hist_type =
decltype(detail::hist_factory(num_bins_lab, lower_edge_lab, upper_edge_lab));
......@@ -40,11 +52,20 @@ namespace corsika {
public:
InteractionHistogram();
//! fill both CMS and lab histograms at the same time
/**
fill both CMS and lab histograms at the same time
@param projectile_id corsika::Code of particle
@param lab_energy Energy in lab. frame
@param mass_target Mass of target particle
@param A if projectile_id is corsika::Nucleus : Mass of nucleus
@param Z if projectile_id is corsika::Nucleus : Charge of nucleus
*/
void fill(Code projectile_id, HEPEnergyType lab_energy, HEPEnergyType mass_target,
int A = 0, int Z = 0);
//! return histogram in c.m.s. frame
hist_type const& CMSHist() const { return inthist_cms_; }
/// return histogram in laboratory frame
hist_type const& labHist() const { return inthist_lab_; }
InteractionHistogram& operator+=(InteractionHistogram const& other);
......
......@@ -115,9 +115,8 @@ namespace corsika {
function.
@class ProcessSequence
@ingroup Processes
@{
Definition of a static process list/sequence
......@@ -141,10 +140,10 @@ namespace corsika {
ProcessSequence
@tparam TProcess2 is of type BaseProcess, either a dedicatd process, or a
ProcessSequence
@tparam ProcessIndexOffset to count and index each ContinuousProcess in the entire
process-chain
@tparam IndexOfProcess1
@tparam IndexOfProcess2
@tparam IndexFirstProcess to count and index each Process in the entire
process-chain. The offset is the starting value for this ProcessSequence
@tparam IndexOfProcess1 index of TProcess1 (counting of Process)
@tparam IndexOfProcess2 index of TProcess2 (counting of Process)
*/
template <typename TProcess1, typename TProcess2 = NullModel,
......@@ -228,7 +227,7 @@ namespace corsika {
* The maximum allowed step length is the minimum of the allowed track lenght over all
* ContinuousProcess-es in the ProcessSequence.
*
* \return: ContinuousProcessStepLength which contains the step length itself in
* @return ContinuousProcessStepLength which contains the step length itself in
* LengthType, and a unique identifier of the related ContinuousProcess.
**/
......@@ -277,6 +276,7 @@ namespace corsika {
/**
@fn make_sequence
@ingroup Processes
Factory function to create a ProcessSequence
......@@ -315,6 +315,7 @@ namespace corsika {
/**
@fn make_sequence
@ingroup Processes
Factory function to create ProcessSequence
......@@ -335,6 +336,7 @@ namespace corsika {
/**
@fn make_sequence
@ingroup Processes
Factory function to create ProcessSequence from a single BaseProcess
......@@ -352,6 +354,8 @@ namespace corsika {
}
/**
@struct
@ingroup Processes
traits marker to identify objectas ProcessSequence
@tparam TProcess1 another BaseProcess
......@@ -365,8 +369,6 @@ namespace corsika {
is_process_sequence() {}
};
/** @} */
} // namespace corsika
#include <corsika/detail/framework/process/ProcessSequence.inl>
......@@ -72,10 +72,10 @@ namespace corsika {
@tparam TProcess2 is of type BaseProcess, either a dedicatd process, or a
ProcessSequence
@tparam TSelect selector functor/function
@tparam IndexFirstProcess to count and index each ContinuousProcess in the entire
@tparam IndexFirstProcess to count and index each Process in the entire
process-chain
@tparam IndexOfProcess1 index of TProcess1 (counting of ContinuousProcess)
@tparam IndexOfProcess2 index of TProcess2 (counting of ContinuousProcess)
@tparam IndexOfProcess1 index of TProcess1 (counting of Process)
@tparam IndexOfProcess2 index of TProcess2 (counting of Process)
See also class ProcessSequence.
**/
......
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