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
8e630180
Commit
8e630180
authored
4 years ago
by
Maximilian Reininghaus
Committed by
ralfulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
first test
parent
c2216f0a
No related branches found
No related tags found
2 merge requests
!234
WIP: Initial example of python as script language from C++
,
!232
Conex EM
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Processes/CONEXSourceCut/testCONEXSourceCut.cc
+79
-0
79 additions, 0 deletions
Processes/CONEXSourceCut/testCONEXSourceCut.cc
with
79 additions
and
0 deletions
Processes/CONEXSourceCut/testCONEXSourceCut.cc
0 → 100644
+
79
−
0
View file @
8e630180
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#include
<corsika/process/conex_source_cut/CONEXSourceCut.h>
#include
<corsika/random/RNGManager.h>
#include
<corsika/particles/ParticleProperties.h>
#include
<corsika/geometry/Point.h>
#include
<corsika/geometry/RootCoordinateSystem.h>
#include
<corsika/geometry/Vector.h>
#include
<corsika/units/PhysicalUnits.h>
#include
<corsika/utl/CorsikaFenv.h>
#include
<corsika/environment/Environment.h>
#include
<corsika/environment/LayeredSphericalAtmosphereBuilder.h>
#include
<catch2/catch.hpp>
using
namespace
corsika
;
using
namespace
corsika
::
environment
;
using
namespace
corsika
::
geometry
;
using
namespace
corsika
::
units
::
si
;
TEST_CASE
(
"CONEXSourceCut"
)
{
// setup environment, geometry
using
EnvType
=
Environment
<
setup
::
IEnvironmentModel
>
;
EnvType
env
;
const
CoordinateSystem
&
rootCS
=
env
.
GetCoordinateSystem
();
Point
const
center
{
rootCS
,
0
_m
,
0
_m
,
0
_m
};
environment
::
LayeredSphericalAtmosphereBuilder
builder
{
center
};
builder
.
setNuclearComposition
(
{{
particles
::
Code
::
Nitrogen
,
particles
::
Code
::
Oxygen
},
{
0.7847
f
,
1.
f
-
0.7847
f
}});
// values taken from AIRES manual, Ar removed for now
builder
.
addExponentialLayer
(
1222.6562
_g
/
(
1
_cm
*
1
_cm
),
994186.38
_cm
,
4
_km
);
builder
.
addExponentialLayer
(
1144.9069
_g
/
(
1
_cm
*
1
_cm
),
878153.55
_cm
,
10
_km
);
builder
.
addExponentialLayer
(
1305.5948
_g
/
(
1
_cm
*
1
_cm
),
636143.04
_cm
,
40
_km
);
builder
.
addExponentialLayer
(
540.1778
_g
/
(
1
_cm
*
1
_cm
),
772170.16
_cm
,
100
_km
);
builder
.
addLinearLayer
(
1e9
_cm
,
112.8
_km
);
builder
.
assemble
(
env
);
const
HEPEnergyType
mass
=
particles
::
GetMass
(
particles
::
Code
::
Proton
);
const
HEPEnergyType
E0
=
1
_PeV
;
double
thetaDeg
=
0.
;
auto
const
thetaRad
=
thetaDeg
/
180.
*
M_PI
;
auto
elab2plab
=
[](
HEPEnergyType
Elab
,
HEPMassType
m
)
{
return
sqrt
((
Elab
-
m
)
*
(
Elab
+
m
));
};
HEPMomentumType
P0
=
elab2plab
(
E0
,
mass
);
auto
momentumComponents
=
[](
double
thetaRad
,
HEPMomentumType
ptot
)
{
return
std
::
make_tuple
(
ptot
*
sin
(
thetaRad
),
0
_eV
,
-
ptot
*
cos
(
thetaRad
));
};
auto
const
[
px
,
py
,
pz
]
=
momentumComponents
(
thetaRad
,
P0
);
auto
plab
=
corsika
::
stack
::
MomentumVector
(
rootCS
,
{
px
,
py
,
pz
});
auto
const
observationHeight
=
1.4
_km
+
builder
.
earthRadius
;
auto
const
injectionHeight
=
112.75
_km
+
builder
.
earthRadius
;
auto
const
t
=
-
observationHeight
*
cos
(
thetaRad
)
+
sqrt
(
-
units
::
si
::
detail
::
static_pow
<
2
>
(
sin
(
thetaRad
)
*
observationHeight
)
+
units
::
si
::
detail
::
static_pow
<
2
>
(
injectionHeight
));
Point
const
showerCore
{
rootCS
,
0
_m
,
0
_m
,
observationHeight
};
Point
const
injectionPos
=
showerCore
+
Vector
<
dimensionless_d
>
{
rootCS
,
{
-
sin
(
thetaRad
),
0
,
cos
(
thetaRad
)}}
*
t
;
environment
::
ShowerAxis
const
showerAxis
{
injectionPos
,
(
showerCore
-
injectionPos
)
*
1.02
,
env
};
corsika
::
process
::
conex_source_cut
::
CONEXSourceCut
(
center
,
showerAxis
,
(
showerCore
-
injectionPos
).
norm
(),
E0
,
particles
::
GetPDG
(
particles
::
Code
::
Proton
));
}
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