IAP GITLAB
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
corsika
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
André Schmidt
corsika
Commits
974b0364
Commit
974b0364
authored
Aug 08, 2020
by
Andre Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Intersection
parent
0e397e07
Pipeline
#2014
failed with stages
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
72 deletions
+133
-72
Documentation/Examples/vertical_EAS.cc
Documentation/Examples/vertical_EAS.cc
+2
-2
Framework/Cascade/Cascade.h
Framework/Cascade/Cascade.h
+10
-12
Processes/TrackingLine/TrackingLine.h
Processes/TrackingLine/TrackingLine.h
+114
-58
Processes/TrackingLine/TrackingLine_interpolation.h
Processes/TrackingLine/TrackingLine_interpolation.h
+7
-0
No files found.
Documentation/Examples/vertical_EAS.cc
View file @
974b0364
...
@@ -97,7 +97,7 @@ int main(int argc, char** argv) {
...
@@ -97,7 +97,7 @@ int main(int argc, char** argv) {
node1
->
SetModelProperties
<
UniformMagneticField
<
HomogeneousMedium
<
IEnvModel
>>>
(
node1
->
SetModelProperties
<
UniformMagneticField
<
HomogeneousMedium
<
IEnvModel
>>>
(
B
,
1
_g
/
(
1
_cm
*
1
_cm
*
1e9
_cm
),
composition
);
B
,
1
_g
/
(
1
_cm
*
1
_cm
*
1e9
_cm
),
composition
);
auto
node2
=
std
::
make_unique
<
VolumeTreeNode
<
IEnvModel
>>
(
/*
auto node2 = std::make_unique<VolumeTreeNode<IEnvModel>>(
std::make_unique<geometry::Sphere>(center, seaLevel + 100.0_km));
std::make_unique<geometry::Sphere>(center, seaLevel + 100.0_km));
node2->SetModelProperties<UniformMagneticField<SlidingPlanarExponential<IEnvModel>>>(
node2->SetModelProperties<UniformMagneticField<SlidingPlanarExponential<IEnvModel>>>(
B, center, 540.1778_g / (1_cm * 1_cm) / 772170.16_cm, -772170.16_cm, composition,
B, center, 540.1778_g / (1_cm * 1_cm) / 772170.16_cm, -772170.16_cm, composition,
...
@@ -124,7 +124,7 @@ int main(int argc, char** argv) {
...
@@ -124,7 +124,7 @@ int main(int argc, char** argv) {
node4->AddChild(std::move(node5));
node4->AddChild(std::move(node5));
node3->AddChild(std::move(node4));
node3->AddChild(std::move(node4));
node2->AddChild(std::move(node3));
node2->AddChild(std::move(node3));
node1
->
AddChild
(
std
::
move
(
node2
));
node1->AddChild(std::move(node2));
*/
env
.
GetUniverse
()
->
AddChild
(
std
::
move
(
node1
));
env
.
GetUniverse
()
->
AddChild
(
std
::
move
(
node1
));
// setup particle stack, and add primary particle
// setup particle stack, and add primary particle
...
...
Framework/Cascade/Cascade.h
View file @
974b0364
...
@@ -229,26 +229,24 @@ namespace corsika::cascade {
...
@@ -229,26 +229,24 @@ namespace corsika::cascade {
geometry
::
Vector
<
dimensionless_d
>
const
directionBefore
=
velocity
.
normalized
();
geometry
::
Vector
<
dimensionless_d
>
const
directionBefore
=
velocity
.
normalized
();
auto
k
=
chargeNumber
*
corsika
::
units
::
constants
::
cSquared
*
1
_eV
/
auto
k
=
chargeNumber
*
corsika
::
units
::
constants
::
cSquared
*
1
_eV
/
(
velocity
.
GetNorm
()
*
vParticle
.
GetEnergy
()
*
1
_V
);
(
velocity
.
GetNorm
()
*
vParticle
.
GetEnergy
()
*
1
_V
);
LengthType
const
steplength
=
min_distance
/
(
directionBefore
+
directionBefore
.
cross
(
magneticfield
)
*
k
/
2
).
GetNorm
();
// First Movement
// First Movement
//assuming magnetic field does not change during movement
//assuming magnetic field does not change during movement
auto
position
=
vParticle
.
GetPosition
()
+
directionBefore
*
Steplength
/
2
;
auto
position
=
vParticle
.
GetPosition
()
+
directionBefore
*
min_distance
/
2
;
// Change of direction by magnetic field
// Change of direction by magnetic field
geometry
::
Vector
<
dimensionless_d
>
const
directionAfter
=
directionBefore
+
directionBefore
.
cross
(
magneticfield
)
*
geometry
::
Vector
<
dimensionless_d
>
const
directionAfter
=
directionBefore
+
directionBefore
.
cross
(
magneticfield
)
*
Steplength
*
k
;
min_distance
*
k
;
// Second Movement
// Second Movement
position
=
position
+
directionAfter
*
Steplength
/
2
;
position
=
position
+
directionAfter
*
min_distance
/
2
;
geometry
::
Vector
<
dimensionless_d
>
const
direction
=
(
position
-
vParticle
.
GetPosition
())
/
// here the particle is actually moved along the trajectory to new position:
(
position
-
vParticle
.
GetPosition
()).
GetNorm
();
// std::visit(setup::ParticleUpdate<Particle>{vParticle}, step);
vParticle
.
SetMomentum
(
direction
*
vParticle
.
GetMomentum
().
GetNorm
());
vParticle
.
SetMomentum
(
directionAfter
.
normalized
()
*
vParticle
.
GetMomentum
().
GetNorm
());
vParticle
.
SetPosition
(
position
);
}
else
{
vParticle
.
SetPosition
(
step
.
PositionFromArclength
(
min_distance
));
}
}
// here the particle is actually moved along the trajectory to new position:
// std::visit(setup::ParticleUpdate<Particle>{vParticle}, step);
vParticle
.
SetPosition
(
step
.
PositionFromArclength
(
min_distance
));
// .... also update time, momentum, direction, ...
// .... also update time, momentum, direction, ...
vParticle
.
SetTime
(
vParticle
.
GetTime
()
+
min_distance
/
units
::
constants
::
c
);
vParticle
.
SetTime
(
vParticle
.
GetTime
()
+
min_distance
/
units
::
constants
::
c
);
std
::
cout
<<
"New Position: "
<<
vParticle
.
GetPosition
().
GetCoordinates
()
<<
std
::
endl
;
step
.
LimitEndTo
(
min_distance
);
step
.
LimitEndTo
(
min_distance
);
...
...
Processes/TrackingLine/TrackingLine.h
View file @
974b0364
This diff is collapsed.
Click to expand it.
Processes/TrackingLine/TrackingLine_interpolation.h
View file @
974b0364
...
@@ -115,6 +115,11 @@ namespace corsika::process {
...
@@ -115,6 +115,11 @@ namespace corsika::process {
std
::
cout
<<
"TrackingLine p: "
<<
(
direction
*
p
.
GetMomentum
().
GetNorm
()).
GetComponents
()
/
1
_GeV
std
::
cout
<<
"TrackingLine p: "
<<
(
direction
*
p
.
GetMomentum
().
GetNorm
()).
GetComponents
()
/
1
_GeV
<<
" GeV "
<<
std
::
endl
;
<<
" GeV "
<<
std
::
endl
;
auto
k
=
chargeNumber
*
corsika
::
units
::
constants
::
cSquared
*
1
_eV
/
(
velocity
.
GetNorm
()
*
p
.
GetEnergy
()
*
1
_V
);
geometry
::
Vector
<
dimensionless_d
>
const
directionBefore
=
velocity
.
normalized
();
double
test
=
((
directionBefore
.
cross
(
magneticfield
)).
dot
(
position
-
currentPosition
)
*
k
+
1
)
/
(
1
_m
*
1
_m
*
(
directionBefore
.
cross
(
magneticfield
)).
GetSquaredNorm
()
*
k
*
k
);
std
::
cout
<<
"Test: "
<<
test
<<
k
<<
std
::
endl
;
}
else
{
}
else
{
std
::
cout
<<
"TrackingLine p: "
<<
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
std
::
cout
<<
"TrackingLine p: "
<<
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
<<
" GeV "
<<
std
::
endl
;
<<
" GeV "
<<
std
::
endl
;
...
@@ -143,6 +148,8 @@ namespace corsika::process {
...
@@ -143,6 +148,8 @@ namespace corsika::process {
auto
const
&
sphere
=
dynamic_cast
<
geometry
::
Sphere
const
&>
(
auto
const
&
sphere
=
dynamic_cast
<
geometry
::
Sphere
const
&>
(
volume
);
// for the moment we are a bit bold here and assume
volume
);
// for the moment we are a bit bold here and assume
// everything is a sphere, crashes with exception if not
// everything is a sphere, crashes with exception if not
std
::
cout
<<
"Mittelpunkt: "
<<
sphere
.
GetCenter
().
GetCoordinates
()
<<
std
::
endl
;
if
(
auto
opt
=
TimeOfIntersection
(
line
,
sphere
);
opt
.
has_value
())
{
if
(
auto
opt
=
TimeOfIntersection
(
line
,
sphere
);
opt
.
has_value
())
{
auto
const
[
t1
,
t2
]
=
*
opt
;
auto
const
[
t1
,
t2
]
=
*
opt
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment