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
eb14f7fd
Commit
eb14f7fd
authored
4 years ago
by
André Schmidt
Committed by
ralfulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Replace Cascade.h
parent
65119801
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/Cascade/Cascade.h
+29
-24
29 additions, 24 deletions
Framework/Cascade/Cascade.h
with
29 additions
and
24 deletions
Framework/Cascade/Cascade.h
+
29
−
24
View file @
eb14f7fd
...
...
@@ -220,31 +220,36 @@ namespace corsika::cascade {
}
else
{
chargeNumber
=
corsika
::
particles
::
GetChargeNumber
(
vParticle
.
GetPID
());
}
auto
magneticfield
=
corsika
::
geometry
::
Vector
(
fEnvironment
.
GetCoordinateSystem
(),
0
_uT
,
50
_uT
,
0
_uT
);
geometry
::
Vector
<
SpeedType
::
dimension_type
>
const
velocity
=
vParticle
.
GetMomentum
()
/
vParticle
.
GetEnergy
()
*
corsika
::
units
::
constants
::
c
;
geometry
::
Vector
<
SpeedType
::
dimension_type
>
const
velocityVerticalMag
=
velocity
-
magneticfield
*
velocity
.
dot
(
magneticfield
)
/
(
magneticfield
.
GetSquaredNorm
());
geometry
::
Vector
<
dimensionless_d
>
const
directionBefore
=
velocity
/
velocity
.
GetNorm
();
LengthType
const
gyroradius
=
vParticle
.
GetEnergy
()
*
velocityVerticalMag
.
GetNorm
()
*
1
_V
/
(
corsika
::
units
::
constants
::
cSquared
*
abs
(
chargeNumber
)
*
magneticfield
.
GetNorm
()
*
1
_eV
);
LengthType
const
Steplength
=
0.01
*
gyroradius
;
// First Movement
auto
position
=
vParticle
.
GetPosition
()
+
directionBefore
*
Steplength
/
2
;
// Change of direction by magnetic field at position
magneticfield
=
corsika
::
geometry
::
Vector
(
fEnvironment
.
GetCoordinateSystem
(),
0
_uT
,
50
_uT
,
0
_uT
);
geometry
::
Vector
<
dimensionless_d
>
const
directionAfter
=
directionBefore
+
velocity
.
cross
(
magneticfield
)
*
chargeNumber
*
Steplength
*
corsika
::
units
::
constants
::
cSquared
*
1
_eV
/
(
vParticle
.
GetEnergy
()
*
velocity
.
GetSquaredNorm
()
*
1
_V
);
// Second Movement
position
=
position
+
directionAfter
*
Steplength
/
2
;
LengthType
const
magMaxLength
=
(
position
-
vParticle
.
GetPosition
()).
GetNorm
();
geometry
::
Vector
<
dimensionless_d
>
const
direction
=
(
position
-
vParticle
.
GetPosition
())
/
magMaxLength
;
vParticle
.
SetMomentum
(
direction
*
vParticle
.
GetMomentum
().
GetNorm
());
vParticle
.
GetMomentum
()
/
vParticle
.
GetEnergy
()
*
corsika
::
units
::
constants
::
c
;
geometry
::
Vector
<
dimensionless_d
>
const
directionBefore
=
velocity
/
velocity
.
GetNorm
();
auto
magMaxLength
=
1
_m
/
0
;
auto
directionAfter
=
directionBefore
;
if
(
chargeNumber
!=
0
)
{
auto
magneticfield
=
corsika
::
geometry
::
Vector
(
fEnvironment
.
GetCoordinateSystem
(),
0
_uT
,
50
_uT
,
0
_uT
);
geometry
::
Vector
<
SpeedType
::
dimension_type
>
const
velocityVerticalMag
=
velocity
-
magneticfield
*
velocity
.
dot
(
magneticfield
)
/
(
magneticfield
.
GetSquaredNorm
());
LengthType
const
gyroradius
=
vParticle
.
GetEnergy
()
*
velocityVerticalMag
.
GetNorm
()
*
1
_V
/
(
corsika
::
units
::
constants
::
cSquared
*
abs
(
chargeNumber
)
*
magneticfield
.
GetNorm
()
*
1
_eV
);
//steplength depending on how exact it should
LengthType
const
Steplength
=
0.01
*
gyroradius
;
// First Movement
auto
position
=
vParticle
.
GetPosition
()
+
directionBefore
*
Steplength
/
2
;
// Change of direction by magnetic field at position
magneticfield
=
corsika
::
geometry
::
Vector
(
fEnvironment
.
GetCoordinateSystem
(),
0
_uT
,
50
_uT
,
0
_uT
);
directionAfter
=
directionBefore
+
velocity
.
cross
(
magneticfield
)
*
chargeNumber
*
Steplength
*
corsika
::
units
::
constants
::
cSquared
*
1
_eV
/
(
vParticle
.
GetEnergy
()
*
velocity
.
GetSquaredNorm
()
*
1
_V
);
// Second Movement
position
=
position
+
directionAfter
*
Steplength
/
2
;
magMaxLength
=
(
position
-
vParticle
.
GetPosition
()).
GetNorm
();
geometry
::
Vector
<
dimensionless_d
>
const
direction
=
(
position
-
vParticle
.
GetPosition
())
/
magMaxLength
;
vParticle
.
SetMomentum
(
direction
*
vParticle
.
GetMomentum
().
GetNorm
());
std
::
cout
<<
"New direction because of magnetic field: "
<<
direction
.
GetComponents
()
<<
std
::
endl
;
}
// determine geometric tracking
auto
[
step
,
geomMaxLength
,
nextVol
]
=
fTracking
.
GetTrack
(
vParticle
);
...
...
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