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
c177275b
Commit
c177275b
authored
6 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
"no-op" boundary crossing process
parent
ceaadbd8
No related branches found
No related tags found
2 merge requests
!91
Resolve "define further classes of processes (MaintenanceProcess?)"
,
!76
Resolve "Handling of boundary crossings in geometry tree"
Pipeline
#336
failed
6 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Documentation/Examples/cascade_example.cc
+33
-11
33 additions, 11 deletions
Documentation/Examples/cascade_example.cc
with
33 additions
and
11 deletions
Documentation/Examples/cascade_example.cc
+
33
−
11
View file @
c177275b
...
...
@@ -214,6 +214,18 @@ public:
HEPEnergyType
GetEmEnergy
()
const
{
return
fEmEnergy
;
}
};
struct
MyBoundaryCrossingProcess
:
public
BoundaryCrossingProcess
<
MyBoundaryCrossingProcess
>
{
template
<
typename
Particle
>
EProcessReturn
DoBoundaryCrossing
(
Particle
&
,
environment
::
BaseNodeType
const
&
from
,
environment
::
BaseNodeType
const
&
to
)
{
std
::
cout
<<
"boundary crossing! from:"
<<
&
from
<<
"; to: "
<<
&
to
<<
std
::
endl
;
return
EProcessReturn
::
eOk
;
}
void
Init
()
{}
};
//
// The example main program for a particle cascade
//
...
...
@@ -226,21 +238,33 @@ int main() {
environment
::
Environment
env
;
auto
&
universe
=
*
(
env
.
GetUniverse
());
auto
the
Medium
=
environment
::
Environment
::
CreateNode
<
Sphere
>
(
auto
outer
Medium
=
environment
::
Environment
::
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
<
environment
::
IMediumModel
>
;
the
Medium
->
SetModelProperties
<
MyHomogeneousModel
>
(
outer
Medium
->
SetModelProperties
<
MyHomogeneousModel
>
(
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
}));
universe
.
AddChild
(
std
::
move
(
theMedium
));
auto
innerMedium
=
environment
::
Environment
::
CreateNode
<
Sphere
>
(
Point
{
env
.
GetCoordinateSystem
(),
0
_m
,
0
_m
,
0
_m
},
10
_m
);
innerMedium
->
SetModelProperties
<
MyHomogeneousModel
>
(
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
}));
outerMedium
->
AddChild
(
std
::
move
(
innerMedium
));
universe
.
AddChild
(
std
::
move
(
outerMedium
));
const
CoordinateSystem
&
rootCS
=
env
.
GetCoordinateSystem
();
...
...
@@ -254,15 +278,15 @@ int main() {
process
::
sibyll
::
Decay
decay
;
ProcessCut
cut
(
20
_GeV
);
// random::RNGManager::GetInstance().RegisterRandomStream("HadronicElasticModel");
// process::HadronicElasticModel::HadronicElasticInteraction
// hadronicElastic(env);
random
::
RNGManager
::
GetInstance
().
RegisterRandomStream
(
"HadronicElasticModel"
);
process
::
HadronicElasticModel
::
HadronicElasticInteraction
hadronicElastic
(
env
);
process
::
TrackWriter
::
TrackWriter
trackWriter
(
"tracks.dat"
);
// assemble all processes into an ordered process list
// auto sequence = p0 << sibyll << decay << hadronicElastic << cut << trackWriter;
auto
sequence
=
p0
<<
sibyll
<<
sibyllNuc
<<
decay
<<
cut
<<
trackWriter
;
auto
sequence
=
p0
<<
sibyll
<<
sibyllNuc
<<
decay
<<
cut
<<
MyBoundaryCrossingProcess
()
<<
trackWriter
;
// setup particle stack, and add primary particle
setup
::
Stack
stack
;
...
...
@@ -272,10 +296,8 @@ int main() {
const
int
nuclZ
=
int
(
nuclA
/
2.15
+
0.7
);
const
HEPMassType
mass
=
particles
::
Proton
::
GetMass
()
*
nuclZ
+
(
nuclA
-
nuclZ
)
*
particles
::
Neutron
::
GetMass
();
const
HEPEnergyType
E0
=
nuclA
*
100
_GeV
;
// 1_PeV crashes with bad COMboost in second interaction (crash later)
double
theta
=
0.
;
const
HEPEnergyType
E0
=
nuclA
*
100
_GeV
;
double
theta
=
27.234
;
double
phi
=
0.
;
{
...
...
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