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
b7e89fe8
Commit
b7e89fe8
authored
4 years ago
by
Nikos Karastathis
Browse files
Options
Downloads
Patches
Plain Diff
small fixes to examples
parent
e8be8b52
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!329
Radio interface
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
corsika/modules/radio/propagators/StraightPropagator.hpp
+2
-0
2 additions, 0 deletions
corsika/modules/radio/propagators/StraightPropagator.hpp
examples/radio_shower.cpp
+1
-1
1 addition, 1 deletion
examples/radio_shower.cpp
examples/radio_shower2.cpp
+14
-20
14 additions, 20 deletions
examples/radio_shower2.cpp
with
17 additions
and
21 deletions
corsika/modules/radio/propagators/StraightPropagator.hpp
+
2
−
0
View file @
b7e89fe8
...
@@ -87,6 +87,7 @@ namespace corsika {
...
@@ -87,6 +87,7 @@ namespace corsika {
// get the associated refractivity at 'point'
// get the associated refractivity at 'point'
auto
const
refractive_index
{
node
->
getModelProperties
().
getRefractiveIndex
(
point
)};
auto
const
refractive_index
{
node
->
getModelProperties
().
getRefractiveIndex
(
point
)};
// auto const refractive_index{1.000327};
rindex
.
push_back
(
refractive_index
);
rindex
.
push_back
(
refractive_index
);
// add this 'point' to our deque collection
// add this 'point' to our deque collection
...
@@ -96,6 +97,7 @@ namespace corsika {
...
@@ -96,6 +97,7 @@ namespace corsika {
//add the refractive index of last point 'destination' and store it
//add the refractive index of last point 'destination' and store it
auto
const
*
node
{
universe
->
getContainingNode
(
destination
)};
auto
const
*
node
{
universe
->
getContainingNode
(
destination
)};
auto
const
refractive_index
{
node
->
getModelProperties
().
getRefractiveIndex
(
destination
)};
auto
const
refractive_index
{
node
->
getModelProperties
().
getRefractiveIndex
(
destination
)};
// auto const refractive_index{1.000327};
rindex
.
push_back
(
refractive_index
);
rindex
.
push_back
(
refractive_index
);
points
.
push_back
(
destination
);
points
.
push_back
(
destination
);
...
...
This diff is collapsed.
Click to expand it.
examples/radio_shower.cpp
+
1
−
1
View file @
b7e89fe8
...
@@ -109,7 +109,7 @@ int main(int argc, char** argv) {
...
@@ -109,7 +109,7 @@ int main(int argc, char** argv) {
corsika_logger
->
set_pattern
(
"[%n:%^%-8l%$] %s:%#: %v"
);
corsika_logger
->
set_pattern
(
"[%n:%^%-8l%$] %s:%#: %v"
);
logging
::
set_level
(
logging
::
level
::
info
);
logging
::
set_level
(
logging
::
level
::
info
);
CORSIKA_LOG_INFO
(
"
v
ertical
_EAS
"
);
CORSIKA_LOG_INFO
(
"
V
ertical
Radio Shower
"
);
if
(
argc
<
4
)
{
if
(
argc
<
4
)
{
std
::
cerr
<<
"usage: vertical_EAS <A> <Z> <energy/GeV> [seed]"
<<
std
::
endl
;
std
::
cerr
<<
"usage: vertical_EAS <A> <Z> <energy/GeV> [seed]"
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
examples/radio_shower2.cpp
+
14
−
20
View file @
b7e89fe8
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include
<corsika/media/ShowerAxis.hpp>
#include
<corsika/media/ShowerAxis.hpp>
#include
<corsika/media/MediumPropertyModel.hpp>
#include
<corsika/media/MediumPropertyModel.hpp>
#include
<corsika/media/UniformMagneticField.hpp>
#include
<corsika/media/UniformMagneticField.hpp>
#include
<corsika/media/UniformRefractiveIndex.hpp>
#include
<corsika/setup/SetupEnvironment.hpp>
#include
<corsika/setup/SetupEnvironment.hpp>
#include
<corsika/setup/SetupStack.hpp>
#include
<corsika/setup/SetupStack.hpp>
...
@@ -103,25 +104,24 @@ int main() {
...
@@ -103,25 +104,24 @@ int main() {
auto
world
=
EnvType
::
createNode
<
Sphere
>
(
Point
{
rootCS
,
0
_m
,
0
_m
,
0
_m
},
150
_km
);
auto
world
=
EnvType
::
createNode
<
Sphere
>
(
Point
{
rootCS
,
0
_m
,
0
_m
,
0
_m
},
150
_km
);
using
MyHomogeneousModel
=
MediumPropertyModel
<
using
MyHomogeneousModel
=
UniformRefractiveIndex
<
MediumPropertyModel
<
UniformMagneticField
<
HomogeneousMedium
<
setup
::
EnvironmentInterface
>>>
;
UniformMagneticField
<
HomogeneousMedium
<
setup
::
EnvironmentInterface
>>>
>
;
world
->
setModelProperties
<
MyHomogeneousModel
>
(
world
->
setModelProperties
<
MyHomogeneousModel
>
(
1.000327
,
Medium
::
AirDry1Atm
,
MagneticFieldVector
(
rootCS
,
0
_T
,
0
_T
,
1
_T
),
Medium
::
AirDry1Atm
,
MagneticFieldVector
(
rootCS
,
0
_T
,
0
_T
,
1
_T
),
1
_kg
/
(
1
_m
*
1
_m
*
1
_m
),
1
_kg
/
(
1
_m
*
1
_m
*
1
_m
),
NuclearComposition
(
std
::
vector
<
Code
>
{
Code
::
Hydrogen
},
NuclearComposition
(
std
::
vector
<
Code
>
{
Code
::
Hydrogen
},
std
::
vector
<
float
>
{(
float
)
1.
}));
std
::
vector
<
float
>
{(
float
)
1.
}));
universe
.
addChild
(
std
::
move
(
world
));
universe
.
addChild
(
std
::
move
(
world
));
// 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
::
Electron
;
const
Code
beamCode
=
Code
::
Electron
;
const
HEPMassType
mass
=
Electron
::
mass
;
const
HEPMassType
mass
=
Electron
::
mass
;
const
HEPEnergyType
E0
=
1000
_GeV
;
const
HEPEnergyType
E0
=
1000
_GeV
;
double
theta
=
0.
;
double
phi
=
0.
;
Point
injectionPos
(
rootCS
,
0
_m
,
0
_m
,
0
_m
);
Point
injectionPos
(
rootCS
,
0
_m
,
0
_m
,
0
_m
);
{
{
...
@@ -129,22 +129,16 @@ int main() {
...
@@ -129,22 +129,16 @@ int main() {
return
sqrt
(
Elab
*
Elab
-
m
*
m
);
return
sqrt
(
Elab
*
Elab
-
m
*
m
);
};
};
HEPMomentumType
P0
=
elab2plab
(
E0
,
mass
);
HEPMomentumType
P0
=
elab2plab
(
E0
,
mass
);
auto
momentumComponents
=
[](
double
theta
,
double
phi
,
HEPMomentumType
ptot
)
{
return
std
::
make_tuple
(
ptot
*
sin
(
theta
)
*
cos
(
phi
),
ptot
*
sin
(
theta
)
*
sin
(
phi
),
auto
plab
=
MomentumVector
(
rootCS
,
{
0
,
P0
,
0
});
-
ptot
*
cos
(
theta
));
};
auto
const
[
px
,
py
,
pz
]
=
momentumComponents
(
theta
/
180.
*
M_PI
,
phi
/
180.
*
M_PI
,
P0
);
auto
plab
=
MomentumVector
(
rootCS
,
{
px
,
py
,
pz
});
cout
<<
"input particle: "
<<
beamCode
<<
endl
;
cout
<<
"input particle: "
<<
beamCode
<<
endl
;
cout
<<
"input angles: theta="
<<
theta
<<
" phi="
<<
phi
<<
endl
;
cout
<<
"input momentum: "
<<
plab
.
getComponents
()
/
1
_GeV
<<
endl
;
cout
<<
"input momentum: "
<<
plab
.
getComponents
()
/
1
_GeV
<<
endl
;
stack
.
addParticle
(
std
::
make_tuple
(
beamCode
,
E0
,
plab
,
injectionPos
,
0
_ns
));
stack
.
addParticle
(
std
::
make_tuple
(
beamCode
,
E0
,
plab
,
injectionPos
,
0
_ns
));
}
}
// setup processes, decays and interactions
// setup processes, decays and interactions
setup
::
Tracking
tracking
;
setup
::
Tracking
tracking
;
StackInspector
<
setup
::
Stack
>
stackInspect
(
1
,
true
,
E0
);
//
StackInspector<setup::Stack> stackInspect(1, true, E0);
// put radio process here
// put radio process here
RadioProcess
<
decltype
(
detector
),
CoREAS
<
decltype
(
detector
),
RadioProcess
<
decltype
(
detector
),
CoREAS
<
decltype
(
detector
),
...
@@ -153,10 +147,10 @@ int main() {
...
@@ -153,10 +147,10 @@ int main() {
TrackWriter
trackWriter
(
"tracks.dat"
);
TrackWriter
trackWriter
(
"tracks.dat"
);
ShowerAxis
const
showerAxis
{
injectionPos
,
Vector
{
rootCS
,
0
_m
,
0
_m
,
-
100
_km
},
env
};
//
ShowerAxis const showerAxis{injectionPos, Vector{rootCS, 0_m, 0_m, -100_km}, env};
// assemble all processes into an ordered process list
// assemble all processes into an ordered process list
auto
sequence
=
make_sequence
(
coreas
,
trackWriter
,
stackInspect
);
auto
sequence
=
make_sequence
(
coreas
,
trackWriter
);
// define air shower object, run simulation
// define air shower object, run simulation
Cascade
EAS
(
env
,
tracking
,
sequence
,
stack
);
Cascade
EAS
(
env
,
tracking
,
sequence
,
stack
);
...
...
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