IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Air Shower Physics
corsika
Commits
cad98a2c
Commit
cad98a2c
authored
5 years ago
by
Hans Dembinski
Browse files
Options
Downloads
Patches
Plain Diff
restored SelectProcess and added static_assert on input types
parent
05644c69
No related branches found
No related tags found
1 merge request
!158
WIP: simplified process sequence based on std::tuple
Pipeline
#924
failed
5 years ago
Stage: config
Stage: build_test
Stage: optional
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/ProcessSequence/ProcessSequence.h
+18
-36
18 additions, 36 deletions
Framework/ProcessSequence/ProcessSequence.h
with
18 additions
and
36 deletions
Framework/ProcessSequence/ProcessSequence.h
+
18
−
36
View file @
cad98a2c
...
...
@@ -68,7 +68,10 @@ namespace corsika::process {
public:
template
<
class
...
Us
>
ProcessSequence
(
Us
&&
...
us
)
:
storage_t
(
std
::
forward
<
Us
>
(
us
)...)
{}
:
storage_t
(
std
::
forward
<
Us
>
(
us
)...)
{
static_assert
((...
&&
is_process_v
<
std
::
decay_t
<
Us
>>
),
"all arguments must be processes"
);
}
// example for a trait-based call:
// void Hello() const { detail::CallHello<T1,T2>::Call(A, B); }
...
...
@@ -229,43 +232,22 @@ namespace corsika::process {
EProcessReturn
SelectDecay
(
TParticle
&
vP
,
TSecondaries
&
vS
,
corsika
::
units
::
si
::
InverseTimeType
decay_select
,
corsika
::
units
::
si
::
InverseTimeType
&
decay_inv_count
)
{
boost
::
ignore_unused
(
vP
,
vS
,
decay_select
,
decay_inv_count
);
// if constexpr (t1ProcSeq) {
// // if A is a process sequence --> check inside
// const EProcessReturn ret = A.SelectDecay(vP, vS, decay_select,
// decay_inv_count);
// // if A did succeed, stop routine
// if (ret != EProcessReturn::eOk) { return ret; }
// } else if constexpr (std::is_base_of_v<DecayProcess<T1type>, T1type>) {
// // if this is not a ContinuousProcess --> evaluate probability
// decay_inv_count += A.GetInverseLifetime(vP);
// // check if we should execute THIS process and then EXIT
// if (decay_select < decay_inv_count) { // more pedagogical: rndm_select <
// // decay_inv_count / decay_inv_tot
// A.DoDecay(vS);
// return EProcessReturn::eDecayed;
// }
// } // end branch A
//
// if constexpr (t2ProcSeq) {
// // if A is a process sequence --> check inside
// const EProcessReturn ret = B.SelectDecay(vP, vS, decay_select,
// decay_inv_count);
// // if A did succeed, stop routine
// if (ret != EProcessReturn::eOk) { return ret; }
// } else if constexpr (std::is_base_of_v<DecayProcess<T2type>, T2type>) {
// // if this is not a ContinuousProcess --> evaluate probability
// decay_inv_count += B.GetInverseLifetime(vP);
// // check if we should execute THIS process and then EXIT
// if (decay_select < decay_inv_count) {
// B.DoDecay(vS);
// return EProcessReturn::eDecayed;
// }
// } // end branch B
return
EProcessReturn
::
eOk
;
EProcessReturn
ret
=
EProcessReturn
::
eOk
;
apply
<
DecayProcess
>
([
&
](
auto
&&
proc
)
{
if
(
ret
==
EProcessReturn
::
eOk
)
{
// if this is not a ContinuousProcess --> evaluate probability
decay_inv_count
+=
proc
.
GetInverseLifetime
(
vP
);
// check if we should execute THIS process and then EXIT
if
(
decay_select
<
decay_inv_count
)
{
proc
.
DoDecay
(
vS
);
ret
=
EProcessReturn
::
eDecayed
;
}
}
});
return
ret
;
}
// TODO: this should be removed along with all Init() functions of the processes
void
Init
()
{
boost
::
mp11
::
tuple_for_each
(
static_cast
<
storage_t
&>
(
*
this
),
[](
auto
&&
proc
)
{
proc
.
Init
();
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment