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
02b8ae75
Commit
02b8ae75
authored
6 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
atmosphere set to 295 K isothermic flat
parent
ff3c78bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!121
Vertical EAS
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Documentation/Examples/vertical_EAS.cc
+23
-29
23 additions, 29 deletions
Documentation/Examples/vertical_EAS.cc
with
23 additions
and
29 deletions
Documentation/Examples/vertical_EAS.cc
+
23
−
29
View file @
02b8ae75
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include
<corsika/setup/SetupTrajectory.h>
#include
<corsika/setup/SetupTrajectory.h>
#include
<corsika/environment/Environment.h>
#include
<corsika/environment/Environment.h>
#include
<corsika/environment/
HomogeneousMedium
.h>
#include
<corsika/environment/
FlatExponential
.h>
#include
<corsika/environment/NuclearComposition.h>
#include
<corsika/environment/NuclearComposition.h>
#include
<corsika/geometry/Sphere.h>
#include
<corsika/geometry/Sphere.h>
...
@@ -84,10 +84,7 @@ public:
...
@@ -84,10 +84,7 @@ public:
}
else
{
}
else
{
// TODO: center-of-mass energy hard coded
// TODO: center-of-mass energy hard coded
const
HEPEnergyType
Ecm
=
sqrt
(
2.
*
p
.
GetEnergy
()
*
0.93827
_GeV
);
const
HEPEnergyType
Ecm
=
sqrt
(
2.
*
p
.
GetEnergy
()
*
0.93827
_GeV
);
if
(
p
.
GetEnergy
()
<
fECut
||
Ecm
<
10
_GeV
)
return
(
p
.
GetEnergy
()
<
fECut
||
Ecm
<
10
_GeV
);
return
true
;
else
return
false
;
}
}
}
}
...
@@ -124,18 +121,13 @@ public:
...
@@ -124,18 +121,13 @@ public:
case
Code
::
NuEBar
:
case
Code
::
NuEBar
:
is_inv
=
true
;
is_inv
=
true
;
break
;
break
;
case
Code
::
NuMu
:
case
Code
::
NuMu
:
is_inv
=
true
;
is_inv
=
true
;
break
;
break
;
case
Code
::
NuMuBar
:
case
Code
::
NuMuBar
:
is_inv
=
true
;
is_inv
=
true
;
break
;
break
;
case
Code
::
MuPlus
:
is_inv
=
true
;
break
;
case
Code
::
MuMinus
:
is_inv
=
true
;
break
;
case
Code
::
Neutron
:
case
Code
::
Neutron
:
is_inv
=
true
;
is_inv
=
true
;
...
@@ -210,7 +202,6 @@ public:
...
@@ -210,7 +202,6 @@ public:
HEPEnergyType
GetEmEnergy
()
const
{
return
fEmEnergy
;
}
HEPEnergyType
GetEmEnergy
()
const
{
return
fEmEnergy
;
}
};
};
//
//
// The example main program for a particle cascade
// The example main program for a particle cascade
//
//
...
@@ -225,19 +216,24 @@ int main() {
...
@@ -225,19 +216,24 @@ int main() {
const
CoordinateSystem
&
rootCS
=
env
.
GetCoordinateSystem
();
const
CoordinateSystem
&
rootCS
=
env
.
GetCoordinateSystem
();
auto
&
universe
=
*
(
env
.
GetUniverse
());
auto
&
universe
=
*
(
env
.
GetUniverse
());
auto
theMedium
=
auto
theMedium
=
EnvType
::
CreateNode
<
Sphere
>
(
EnvType
::
CreateNode
<
Sphere
>
(
Point
{
rootCS
,
0
_m
,
0
_m
,
0
_m
},
Point
{
rootCS
,
0
_m
,
0
_m
,
0
_m
},
1
_km
*
std
::
numeric_limits
<
double
>::
infinity
());
1
_km
*
std
::
numeric_limits
<
double
>::
infinity
());
// fraction of oxygen
auto
constexpr
temperature
=
295
_K
;
// AIRES default temperature for isothermal model
auto
constexpr
lambda
=
-
constants
::
R
*
temperature
/
(
constants
::
g_sub_n
*
28.966
_g
/
mole
);
// 1036 g/cm² taken from AIRES code
auto
constexpr
rho0
=
-
1036
_g
/
square
(
1
_cm
)
/
lambda
;
using
FlatExp
=
environment
::
FlatExponential
<
environment
::
IMediumModel
>
;
using
FlatExp
=
environment
::
FlatExponential
<
environment
::
IMediumModel
>
;
theMedium
->
SetModelProperties
<
FlatExp
>
(
theMedium
->
SetModelProperties
<
FlatExp
>
(
Point
{
rootCS
,
0
_m
,
0
_m
,
},
Point
{
rootCS
,
0
_m
,
0
_m
,
0
_m
},
Vector
<
dimensionless_d
>
{
rootCS
,
{
0.
,
0.
,
1.
}},
rho0
,
lambda
,
environment
::
NuclearComposition
(
environment
::
NuclearComposition
(
std
::
vector
<
particles
::
Code
>
{
particles
::
Code
::
Nitrogen
,
std
::
vector
<
particles
::
Code
>
{
particles
::
Code
::
Nitrogen
,
particles
::
Code
::
Oxygen
,
particles
::
Code
::
Oxygen
},
particles
::
Code
::
Argon
},
std
::
vector
<
float
>
{
std
::
vector
<
float
>
{
0.7847
,
0.2105
,
0.005
}));
// values taken from AIRES manual
0.7847
f
,
1.
f
-
0.7847
f
}));
// values taken from AIRES manual, Ar removed for now
universe
.
AddChild
(
std
::
move
(
theMedium
));
universe
.
AddChild
(
std
::
move
(
theMedium
));
...
@@ -273,11 +269,9 @@ int main() {
...
@@ -273,11 +269,9 @@ int main() {
// setup particle stack, and add primary particle
// setup particle stack, and add primary particle
setup
::
Stack
stack
;
setup
::
Stack
stack
;
stack
.
Clear
();
stack
.
Clear
();
const
Code
beamCode
=
Code
::
Nucleus
;
const
Code
beamCode
=
Code
::
Proton
;
const
int
nuclA
=
4
;
auto
const
mass
=
particles
::
GetMass
(
beamCode
);
const
int
nuclZ
=
int
(
nuclA
/
2.15
+
0.7
);
const
HEPEnergyType
E0
=
10
_TeV
;
const
HEPMassType
mass
=
GetNucleusMass
(
nuclA
,
nuclZ
);
const
HEPEnergyType
E0
=
nuclA
*
10
_TeV
;
double
theta
=
0.
;
double
theta
=
0.
;
double
phi
=
0.
;
double
phi
=
0.
;
...
@@ -298,10 +292,10 @@ int main() {
...
@@ -298,10 +292,10 @@ int main() {
cout
<<
"input momentum: "
<<
plab
.
GetComponents
()
/
1
_GeV
<<
endl
;
cout
<<
"input momentum: "
<<
plab
.
GetComponents
()
/
1
_GeV
<<
endl
;
Point
pos
(
rootCS
,
0
_m
,
0
_m
,
Point
pos
(
rootCS
,
0
_m
,
0
_m
,
112.8
_km
);
// this is the CORSIKA 7 start of atmosphere/universe
112.8
_km
);
// this is the CORSIKA 7 start of atmosphere/universe
stack
.
AddParticle
(
std
::
tuple
<
particles
::
Code
,
units
::
si
::
HEPEnergyType
,
stack
.
AddParticle
(
corsika
::
stack
::
MomentumVector
,
geometry
::
Point
,
std
::
tuple
<
particles
::
Code
,
units
::
si
::
HEPEnergyType
,
units
::
si
::
TimeType
,
unsigned
short
,
unsigned
short
>
{
corsika
::
stack
::
MomentumVector
,
geometry
::
Point
,
units
::
si
::
TimeType
>
{
beamCode
,
E0
,
plab
,
pos
,
0
_ns
,
nuclA
,
nuclZ
});
beamCode
,
E0
,
plab
,
pos
,
0
_ns
});
}
}
// define air shower object, run simulation
// define air shower object, run simulation
...
...
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