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
1177d0d2
Commit
1177d0d2
authored
6 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
simplified a bit. have to complify later.
parent
75e23181
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!83
Resolve "Add energy loss process"
Pipeline
#391
passed
6 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/Examples/cascade_example.cc
+2
-2
2 additions, 2 deletions
Documentation/Examples/cascade_example.cc
Processes/EnergyLoss/EnergyLoss.cc
+12
-9
12 additions, 9 deletions
Processes/EnergyLoss/EnergyLoss.cc
with
14 additions
and
11 deletions
Documentation/Examples/cascade_example.cc
+
2
−
2
View file @
1177d0d2
...
@@ -268,8 +268,8 @@ int main() {
...
@@ -268,8 +268,8 @@ int main() {
// assemble all processes into an ordered process list
// assemble all processes into an ordered process list
// auto sequence = stackInspect << sibyll << decay << hadronicElastic << cut << trackWriter;
// auto sequence = stackInspect << sibyll << decay << hadronicElastic << cut << trackWriter;
// auto sequence = stackInspect << sibyll << sibyllNuc << decay << eLoss << cut << trackWriter;
// auto sequence = stackInspect << sibyll << sibyllNuc << decay << eLoss << cut << trackWriter;
auto
sequence
=
sibyll
<<
sibyllNuc
<<
decay
<<
eLoss
<<
cut
;
//
auto sequence = sibyll << sibyllNuc << decay << eLoss << cut;
//
auto sequence = stackInspect << sibyll << sibyllNuc << decay <<
cut << trackWriter
;
auto
sequence
=
stackInspect
<<
sibyll
<<
sibyllNuc
<<
decay
<<
eLoss
<<
cut
;
// cout << "decltype(sequence)=" << type_id_with_cvr<decltype(sequence)>().pretty_name()
// cout << "decltype(sequence)=" << type_id_with_cvr<decltype(sequence)>().pretty_name()
// << "\n";
// << "\n";
...
...
This diff is collapsed.
Click to expand it.
Processes/EnergyLoss/EnergyLoss.cc
+
12
−
9
View file @
1177d0d2
...
@@ -58,7 +58,7 @@ namespace corsika::process::EnergyLoss {
...
@@ -58,7 +58,7 @@ namespace corsika::process::EnergyLoss {
// right now: values for nitrogen_D
// right now: values for nitrogen_D
// 7 nitrogen_gas 82.0 0.49976 D E 0.0011653 0.0 1.7378 4.1323 0.15349 3.2125 10.54
// 7 nitrogen_gas 82.0 0.49976 D E 0.0011653 0.0 1.7378 4.1323 0.15349 3.2125 10.54
auto
Ieff
=
82.0
_eV
;
auto
Ieff
=
82.0
_eV
;
auto
Zmat
=
7
;
[[
maybe_unused
]]
auto
Zmat
=
7
;
auto
ZoverA
=
0.49976
_mol
/
1
_g
;
auto
ZoverA
=
0.49976
_mol
/
1
_g
;
const
double
x0
=
1.7378
;
const
double
x0
=
1.7378
;
const
double
x1
=
4.1323
;
const
double
x1
=
4.1323
;
...
@@ -84,7 +84,7 @@ namespace corsika::process::EnergyLoss {
...
@@ -84,7 +84,7 @@ namespace corsika::process::EnergyLoss {
double
const
beta2
=
(
gamma2
-
1
)
/
gamma2
;
// 1-1/gamma2 (1-1/gamma)*(1+1/gamma); (gamma_2-1)/gamma_2 = (1-1/gamma2);
double
const
beta2
=
(
gamma2
-
1
)
/
gamma2
;
// 1-1/gamma2 (1-1/gamma)*(1+1/gamma); (gamma_2-1)/gamma_2 = (1-1/gamma2);
double
const
c2
=
1
;
// HEP convention here c=c2=1
double
const
c2
=
1
;
// HEP convention here c=c2=1
cout
<<
"BetheBloch beta2="
<<
beta2
<<
" gamma2="
<<
gamma2
<<
endl
;
cout
<<
"BetheBloch beta2="
<<
beta2
<<
" gamma2="
<<
gamma2
<<
endl
;
double
const
eta2
=
beta2
/
(
1
-
beta2
);
[[
maybe_unused
]]
double
const
eta2
=
beta2
/
(
1
-
beta2
);
HEPMassType
const
Wmax
=
2
*
me
*
c2
*
beta2
*
gamma2
/
(
1
+
2
*
gamma
*
me
/
m
+
me2
/
m2
);
HEPMassType
const
Wmax
=
2
*
me
*
c2
*
beta2
*
gamma2
/
(
1
+
2
*
gamma
*
me
/
m
+
me2
/
m2
);
// approx, but <<1% HEPMassType const Wmax = 2*me*c2*beta2*gamma2; for HEAVY PARTICLES
// approx, but <<1% HEPMassType const Wmax = 2*me*c2*beta2*gamma2; for HEAVY PARTICLES
// Wmax ~ 2me v2 for non-relativistic particles
// Wmax ~ 2me v2 for non-relativistic particles
...
@@ -99,7 +99,7 @@ namespace corsika::process::EnergyLoss {
...
@@ -99,7 +99,7 @@ namespace corsika::process::EnergyLoss {
delta
=
2
*
(
log
(
10
))
*
x
-
Cbar
;
delta
=
2
*
(
log
(
10
))
*
x
-
Cbar
;
}
else
if
(
x
<
x1
&&
x
>=
x0
)
{
}
else
if
(
x
<
x1
&&
x
>=
x0
)
{
delta
=
2
*
(
log
(
10
))
*
x
-
Cbar
+
aa
*
pow
((
x1
-
x
),
sk
);
delta
=
2
*
(
log
(
10
))
*
x
-
Cbar
+
aa
*
pow
((
x1
-
x
),
sk
);
}
else
if
(
x
<
x0
)
{
//
AND
IF
CONDUCTOR
(otherwise, this is 0)
}
else
if
(
x
<
x0
)
{
//
and
IF
conductor
(otherwise, this is 0)
delta
=
delta0
*
pow
(
100
,
2
*
(
x
-
x0
));
delta
=
delta0
*
pow
(
100
,
2
*
(
x
-
x0
));
}
}
cout
<<
"BetheBloch delta="
<<
delta
<<
endl
;
cout
<<
"BetheBloch delta="
<<
delta
<<
endl
;
...
@@ -123,19 +123,22 @@ namespace corsika::process::EnergyLoss {
...
@@ -123,19 +123,22 @@ namespace corsika::process::EnergyLoss {
double
A
=
1
;
double
A
=
1
;
if
(
p
.
GetPID
()
==
particles
::
Code
::
Nucleus
)
if
(
p
.
GetPID
()
==
particles
::
Code
::
Nucleus
)
A
=
p
.
GetNuclearA
();
A
=
p
.
GetNuclearA
();
double
const
Erel
=
p
.
GetEnergy
()
/
A
/
1
_keV
;
//double const Erel = (p.GetEnergy()-p.GetMass()) / A / 1_keV;
double
const
Llow
=
0.01
*
Erel
;
//double const Llow = 0.01 * Erel;
double
const
Lhigh
=
1.5
/
pow
(
Erel
,
0.4
)
+
45000
/
Zmat
*
pow
(
Erel
,
1.6
);
//double const Lhigh = 1.5/pow(Erel, 0.4) + 45000./Zmat * pow(Erel, 1.6);
double
const
barkas
=
Z
*
Llow
*
Lhigh
/
(
Llow
+
Lhigh
);
// RU, I think the Z was missing...
//double const barkas = Z * Llow*Lhigh/(Llow+Lhigh); // RU, I think the Z was missing...
double
const
barkas
=
1
;
// does not work yet
// Bloch correction for O(Z4) higher-order Born approximation
// Bloch correction for O(Z4) higher-order Born approximation
// see Appl. Phys. 85 (1999) 1249
// see Appl. Phys. 85 (1999) 1249
const
double
alpha
=
1.
/
137.035999173
;
const
double
alpha
=
1.
/
137.035999173
;
double
const
y2
=
Z
*
Z
*
alpha
*
alpha
/
beta2
;
double
const
y2
=
Z
*
Z
*
alpha
*
alpha
/
beta2
;
double
const
bloch
=
-
y2
*
(
1.202
-
y2
*
(
1.042
-
0.855
*
y2
+
0.343
*
y2
*
y2
)
);
double
const
bloch
=
-
y2
*
(
1.202
-
y2
*
(
1.042
-
0.855
*
y2
+
0.343
*
y2
*
y2
)
);
// cout << "BetheBloch Erel=" << Erel << " barkas=" << barkas << " bloch=" << bloch << endl;
double
const
aux
=
2
*
me
*
c2
*
beta2
*
gamma2
*
Wmax
/
(
Ieff
*
Ieff
);
double
const
aux
=
2
*
me
*
c2
*
beta2
*
gamma2
*
Wmax
/
(
Ieff
*
Ieff
);
return
K
*
Z2
*
ZoverA
/
beta2
*
(
0.5
*
log
(
aux
)
-
beta2
-
Cadj
/
Z
-
delta
/
2
+
barkas
+
bloch
)
*
dX
;
return
-
K
*
Z2
*
ZoverA
/
beta2
*
(
0.5
*
log
(
aux
)
-
beta2
-
Cadj
/
Z
-
delta
/
2
+
barkas
+
bloch
)
*
dX
;
}
}
process
::
EProcessReturn
EnergyLoss
::
DoContinuous
(
Particle
&
p
,
Track
&
t
,
Stack
&
)
{
process
::
EProcessReturn
EnergyLoss
::
DoContinuous
(
Particle
&
p
,
Track
&
t
,
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