IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Antonio Augusto Alves Junior
corsika
Commits
6c372dbe
Commit
6c372dbe
authored
6 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
finally compiling again
parent
cce55ccc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/Examples/cascade_example.cc
+26
-12
26 additions, 12 deletions
Documentation/Examples/cascade_example.cc
Environment/NameModel.h
+2
-10
2 additions, 10 deletions
Environment/NameModel.h
with
28 additions
and
22 deletions
Documentation/Examples/cascade_example.cc
+
26
−
12
View file @
6c372dbe
...
...
@@ -223,7 +223,7 @@ struct MyBoundaryCrossingProcess
MyBoundaryCrossingProcess
()
{}
//~ MyBoundaryCrossingProcess(environment::BaseNodeType const& a,
//environment::BaseNodeType const& b) : fA(a), fB(b) {}
//
environment::BaseNodeType const& b) : fA(a), fB(b) {}
template
<
typename
Particle
>
EProcessReturn
DoBoundaryCrossing
(
Particle
&
p
,
...
...
@@ -241,6 +241,19 @@ struct MyBoundaryCrossingProcess
void
Init
()
{}
};
template
<
class
T
>
class
TheNameModel
:
public
T
{
std
::
string
const
fName
;
public:
template
<
typename
...
Args
>
TheNameModel
(
std
::
string
const
&
name
,
Args
&&
...
args
)
:
T
(
std
::
forward
<
Args
>
(
args
)...)
,
fName
(
name
)
{}
std
::
string
const
&
GetName
()
const
override
{
return
fName
;
}
};
//
// The example main program for a particle cascade
//
...
...
@@ -254,24 +267,25 @@ int main() {
EnvType
env
;
auto
&
universe
=
*
(
env
.
GetUniverse
());
auto
outerMedium
=
environment
::
Environment
<
EnvType
>::
CreateNode
<
Sphere
>
(
Point
{
env
.
GetCoordinateSystem
(),
0
_m
,
0
_m
,
0
_m
},
1
_km
*
std
::
numeric_limits
<
double
>::
infinity
());
auto
outerMedium
=
EnvType
::
CreateNode
<
Sphere
>
(
Point
{
env
.
GetCoordinateSystem
(),
0
_m
,
0
_m
,
0
_m
},
1
_km
*
std
::
numeric_limits
<
double
>::
infinity
());
// fraction of oxygen
const
float
fox
=
0.20946
;
using
MyHomogeneousModel
=
environment
::
HomogeneousMedium
<
setup
::
IEnvironmentModel
>
;
outerMedium
->
SetModelProperties
<
setup
::
IEnvironmentModel
>
(
outerMedium
->
SetModelProperties
<
TheNameModel
<
environment
::
HomogeneousMedium
<
setup
::
IEnvironmentModel
>
>>
(
"outer"
,
1
_kg
/
(
1
_m
*
1
_m
*
1
_m
),
environment
::
NuclearComposition
(
std
::
vector
<
particles
::
Code
>
{
particles
::
Code
::
Nitrogen
,
particles
::
Code
::
Oxygen
},
std
::
vector
<
float
>
{(
float
)
1.
-
fox
,
fox
}));
auto
innerMedium
=
environment
::
Environment
<
EnvType
>
::
CreateNode
<
Sphere
>
(
auto
innerMedium
=
EnvType
::
CreateNode
<
Sphere
>
(
Point
{
env
.
GetCoordinateSystem
(),
0
_m
,
0
_m
,
0
_m
},
2000
_m
);
innerMedium
->
SetModelProperties
<
setup
::
IEnvironmentModel
>
(
innerMedium
->
SetModelProperties
<
TheNameModel
<
environment
::
HomogeneousMedium
<
setup
::
IEnvironmentModel
>>>
(
"inner"
,
1
_kg
/
(
1
_m
*
1
_m
*
1
_m
),
environment
::
NuclearComposition
(
std
::
vector
<
particles
::
Code
>
{
particles
::
Code
::
Nitrogen
,
...
...
@@ -285,17 +299,17 @@ int main() {
const
CoordinateSystem
&
rootCS
=
env
.
GetCoordinateSystem
();
// setup processes, decays and interactions
tracking_line
::
TrackingLine
<
setup
::
Stack
,
setup
::
Trajectory
>
tracking
(
env
)
;
tracking_line
::
TrackingLine
tracking
;
stack_inspector
::
StackInspector
<
setup
::
Stack
>
p0
(
true
);
random
::
RNGManager
::
GetInstance
().
RegisterRandomStream
(
"s_rndm"
);
process
::
sibyll
::
Interaction
sibyll
(
env
)
;
process
::
sibyll
::
NuclearInteraction
sibyllNuc
(
env
,
sibyll
);
process
::
sibyll
::
Interaction
sibyll
;
process
::
sibyll
::
NuclearInteraction
sibyllNuc
(
sibyll
);
process
::
sibyll
::
Decay
decay
;
ProcessCut
cut
(
20
_GeV
);
random
::
RNGManager
::
GetInstance
().
RegisterRandomStream
(
"HadronicElasticModel"
);
process
::
HadronicElasticModel
::
HadronicElasticInteraction
hadronicElastic
(
env
)
;
process
::
HadronicElasticModel
::
HadronicElasticInteraction
hadronicElastic
;
process
::
TrackWriter
::
TrackWriter
trackWriter
(
"tracks.dat"
);
...
...
This diff is collapsed.
Click to expand it.
Environment/NameModel.h
+
2
−
10
View file @
6c372dbe
...
...
@@ -18,16 +18,8 @@ namespace corsika::environment {
template
<
typename
T
>
struct
NameModel
:
public
T
{
template
<
typename
...
Args
>
NameModel
(
std
::
string
const
&
name
,
Args
&&
...
args
)
:
T
(
std
::
forward
<
Args
>
(
args
)...),
fName
(
name
)
{}
std
::
string
const
&
GetName
()
const
{
return
fName
;
}
private
:
std
::
string
fName
;
virtual
std
::
string
const
&
GetName
()
const
=
0
;
virtual
~
NameModel
()
=
default
;
};
}
// namespace corsika::environment
...
...
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