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
2ca45c6d
Commit
2ca45c6d
authored
4 years ago
by
André Schmidt
Committed by
ralfulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Replace Cascade.h
parent
97928643
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!278
Magnetic Tracking
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/Cascade/Cascade.h
+27
-1
27 additions, 1 deletion
Framework/Cascade/Cascade.h
with
27 additions
and
1 deletion
Framework/Cascade/Cascade.h
+
27
−
1
View file @
2ca45c6d
...
...
@@ -209,10 +209,23 @@ namespace corsika::cascade {
// convert next_decay from time to length [m]
LengthType
const
distance_decay
=
next_decay
*
vParticle
.
GetMomentum
().
norm
()
/
vParticle
.
GetEnergy
()
*
units
::
constants
::
c
;
// determine geometric tracking
auto
[
step
,
geomMaxLength
,
nextVol
]
=
fTracking
.
GetTrack
(
vParticle
);
[[
maybe_unused
]]
auto
const
&
dummy_nextVol
=
nextVol
;
// convert next_step from grammage to length
LengthType
const
distance_interact
=
currentLogicalNode
->
GetModelProperties
().
ArclengthFromGrammage
(
step
,
next_interact
);
// determine the maximum geometric step length
LengthType
const
distance_max
=
fProcessSequence
.
MaxStepLength
(
vParticle
,
step
);
std
::
cout
<<
"distance_max="
<<
distance_max
<<
std
::
endl
;
// take minimum of geometry, interaction, decay for next step
auto
const
min_distance
=
std
::
min
({
distance_interact
,
distance_decay
,
distance_max
,
geomMaxLength
});
std
::
min
({
distance_interact
,
distance_decay
/*
, distance_max, geomMaxLength
*/
});
C8LOG_DEBUG
(
"transport particle by : {} m"
,
min_distance
/
1
_m
);
...
...
@@ -220,6 +233,19 @@ namespace corsika::cascade {
// std::visit(setup::ParticleUpdate<Particle>{vParticle}, step);
vParticle
.
SetPosition
(
step
.
PositionFromArclength
(
min_distance
));
// .... also update time, momentum, direction, ...
// magneticfield/u have wrong units, not sure if corsika::stack is right
auto
magneticfield
=
corsika
::
stack
::
MomentumVector
(
fEnvironment
.
GetCoordinateSystem
(),
{
0
_eV
,
50e-06
_eV
,
0
_eV
});
geometry
::
Vector
<
SpeedType
::
dimension_type
>
const
velocity
=
vParticle
.
GetMomentum
()
/
vParticle
.
GetEnergy
()
*
corsika
::
units
::
constants
::
c
;
geometry
::
Vector
<
SpeedType
::
dimension_type
>
const
u
=
velocity
*
1
_m
/
(
velocity
.
GetNorm
()
*
1
_s
)
+
velocity
.
cross
(
magneticfield
)
*
corsika
::
particles
::
GetChargeNumber
(
vParticle
.
GetPID
())
*
min_distance
*
corsika
::
units
::
constants
::
cSquared
/
(
vParticle
.
GetEnergy
()
*
velocity
.
GetNorm
()
*
velocity
.
GetNorm
()
*
1
_m
);
vParticle
.
SetMomentum
(
u
*
1
_s
/
1
_m
*
vParticle
.
GetMomentum
().
GetNorm
());
// std::cout << " Test: " << magneticfield.GetComponents() << std::endl;
// std::cout << " Test: " << vParticle.GetMomentum().cross(magneticfield).GetComponents() << std::endl;
vParticle
.
SetTime
(
vParticle
.
GetTime
()
+
min_distance
/
units
::
constants
::
c
);
step
.
LimitEndTo
(
min_distance
);
...
...
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