IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Pranav Sampathkumar
corsika
Commits
bb1a2819
Commit
bb1a2819
authored
4 years ago
by
Felix Riehn
Committed by
ralfulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ObservationPlane
parent
41d1439c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
corsika/detail/modules/ObservationPlane.inl
+60
-9
60 additions, 9 deletions
corsika/detail/modules/ObservationPlane.inl
with
60 additions
and
9 deletions
corsika/detail/modules/ObservationPlane.inl
+
60
−
9
View file @
bb1a2819
...
@@ -59,15 +59,66 @@ namespace corsika {
...
@@ -59,15 +59,66 @@ namespace corsika {
corsika
::
setup
::
Stack
::
particle_type
const
&
particle
,
corsika
::
setup
::
Stack
::
particle_type
const
&
particle
,
corsika
::
setup
::
Trajectory
const
&
trajectory
)
{
corsika
::
setup
::
Trajectory
const
&
trajectory
)
{
auto
const
&
volumeNode
=
particle
.
getNode
();
int
chargeNumber
;
if
(
is_nucleus
(
vParticle
.
getPID
()))
{
typedef
typename
std
::
remove_const_t
<
chargeNumber
=
vParticle
.
getNuclearZ
();
std
::
remove_reference_t
<
decltype
(
volumeNode
->
getModelProperties
())
>>
}
else
{
medium_type
;
chargeNumber
=
get_charge_number
(
vParticle
.
getPID
());
}
Intersections
const
intersection
=
auto
const
*
currentLogicalVolumeNode
=
vParticle
.
getNode
();
setup
::
Tracking
::
intersect
<
corsika
::
setup
::
Stack
::
particle_type
,
medium_type
>
(
auto
magneticfield
=
currentLogicalVolumeNode
->
getModelProperties
().
getMagneticField
(
particle
,
plane_
,
volumeNode
->
getModelProperties
());
vParticle
.
getPosition
());
auto
direction
=
trajectory
.
getVelocity
(
0
).
normalized
();
if
(
chargeNumber
!=
0
&&
abs
(
plane_
.
getNormal
().
dot
(
trajectory
.
getLine
().
getVelocity
().
cross
(
magneticfield
)))
*
1
_s
/
1
_m
/
1
_T
>
1e-6
)
{
auto
const
*
currentLogicalVolumeNode
=
vParticle
.
getNode
();
auto
magneticfield
=
currentLogicalVolumeNode
->
getModelProperties
().
getMagneticField
(
vParticle
.
getPosition
());
auto
k
=
chargeNumber
*
constants
::
c
*
1
_eV
/
(
vParticle
.
getMomentum
().
getNorm
()
*
1
_V
);
if
(
direction
.
dot
(
plane_
.
getNormal
())
*
direction
.
dot
(
plane_
.
getNormal
())
-
(
plane_
.
getNormal
().
dot
(
trajectory
.
getPosition
(
0
)
-
plane_
.
getCenter
())
*
plane_
.
getNormal
().
dot
(
direction
.
cross
(
magneticfield
))
*
2
*
k
)
<
0
)
{
return
std
::
numeric_limits
<
double
>::
infinity
()
*
1
_m
;
}
LengthType
MaxStepLength1
=
(
sqrt
(
direction
.
dot
(
plane_
.
getNormal
())
*
direction
.
dot
(
plane_
.
getNormal
())
-
(
plane_
.
getNormal
().
dot
(
trajectory
.
getPosition
(
0
)
-
plane_
.
getCenter
())
*
plane_
.
getNormal
().
dot
(
direction
.
cross
(
magneticfield
))
*
2
*
k
))
-
direction
.
dot
(
plane_
.
getNormal
())
/
direction
.
getNorm
())
/
(
plane_
.
getNormal
().
dot
(
direction
.
cross
(
magneticfield
))
*
k
);
LengthType
MaxStepLength2
=
(
-
sqrt
(
direction
.
dot
(
plane_
.
getNormal
())
*
direction
.
dot
(
plane_
.
getNormal
())
-
(
plane_
.
getNormal
().
dot
(
trajectory
.
getPosition
(
0
)
-
plane_
.
getCenter
())
*
plane_
.
getNormal
().
dot
(
direction
.
cross
(
magneticfield
))
*
2
*
k
))
-
direction
.
dot
(
plane_
.
getNormal
())
/
direction
.
getNorm
())
/
(
plane_
.
getNormal
().
dot
(
direction
.
cross
(
magneticfield
))
*
k
);
if
(
MaxStepLength1
<=
0
_m
&&
MaxStepLength2
<=
0
_m
)
{
return
std
::
numeric_limits
<
double
>::
infinity
()
*
1
_m
;
}
else
if
(
MaxStepLength1
<=
0
_m
||
MaxStepLength2
<
MaxStepLength1
)
{
CORSIKA_LOG_DEBUG
(
"steplength to obs plane 2: {} "
,
MaxStepLength2
);
return
MaxStepLength2
*
(
direction
+
direction
.
cross
(
magneticfield
)
*
MaxStepLength2
*
k
/
2
)
.
getNorm
()
*
1.001
;
}
else
if
(
MaxStepLength2
<=
0
_m
||
MaxStepLength1
<
MaxStepLength2
)
{
CORSIKA_LOG_DEBUG
(
"steplength to obs plane 1: {}"
,
MaxStepLength1
);
return
MaxStepLength1
*
(
direction
+
direction
.
cross
(
magneticfield
)
*
MaxStepLength2
*
k
/
2
)
.
getNorm
()
*
1.001
;
}
}
TimeType
const
timeOfIntersection
=
intersection
.
getEntry
();
TimeType
const
timeOfIntersection
=
intersection
.
getEntry
();
...
...
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