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
4064b5d5
Commit
4064b5d5
authored
5 years ago
by
Maximilian Reininghaus
Committed by
Maximilian Reininghaus
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug in EnergyLoss binning
parent
101d7274
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Processes/EnergyLoss/EnergyLoss.cc
+8
-7
8 additions, 7 deletions
Processes/EnergyLoss/EnergyLoss.cc
Processes/EnergyLoss/EnergyLoss.h
+13
-18
13 additions, 18 deletions
Processes/EnergyLoss/EnergyLoss.h
with
21 additions
and
25 deletions
Processes/EnergyLoss/EnergyLoss.cc
+
8
−
7
View file @
4064b5d5
...
@@ -147,7 +147,8 @@ namespace corsika::process::energy_loss {
...
@@ -147,7 +147,8 @@ namespace corsika::process::energy_loss {
(
0.5
*
log
(
aux
)
-
beta2
-
Cadj
/
Z
-
delta
/
2
+
barkas
+
bloch
)
*
dX
;
(
0.5
*
log
(
aux
)
-
beta2
-
Cadj
/
Z
-
delta
/
2
+
barkas
+
bloch
)
*
dX
;
}
}
process
::
EProcessReturn
EnergyLoss
::
DoContinuous
(
SetupParticle
&
p
,
SetupTrack
&
t
)
{
process
::
EProcessReturn
EnergyLoss
::
DoContinuous
(
SetupParticle
&
p
,
SetupTrack
const
&
t
)
{
if
(
p
.
GetChargeNumber
()
==
0
)
return
process
::
EProcessReturn
::
eOk
;
if
(
p
.
GetChargeNumber
()
==
0
)
return
process
::
EProcessReturn
::
eOk
;
GrammageType
const
dX
=
GrammageType
const
dX
=
p
.
GetNode
()
->
GetModelProperties
().
IntegratedGrammage
(
t
,
t
.
GetLength
());
p
.
GetNode
()
->
GetModelProperties
().
IntegratedGrammage
(
t
,
t
.
GetLength
());
...
@@ -169,7 +170,7 @@ namespace corsika::process::energy_loss {
...
@@ -169,7 +170,7 @@ namespace corsika::process::energy_loss {
p
.
SetEnergy
(
Enew
);
p
.
SetEnergy
(
Enew
);
MomentumUpdate
(
p
,
Enew
);
MomentumUpdate
(
p
,
Enew
);
fEnergyLossTot
+=
dE
;
fEnergyLossTot
+=
dE
;
GetXbin
(
p
,
dE
);
GetXbin
(
p
,
t
,
dE
);
return
status
;
return
status
;
}
}
...
@@ -199,17 +200,17 @@ namespace corsika::process::energy_loss {
...
@@ -199,17 +200,17 @@ namespace corsika::process::energy_loss {
#include
<corsika/geometry/CoordinateSystem.h>
#include
<corsika/geometry/CoordinateSystem.h>
int
EnergyLoss
::
GetXbin
(
corsika
::
setup
::
Stack
::
ParticleType
&
vP
,
int
EnergyLoss
::
GetXbin
(
SetupParticle
const
&
vP
,
SetupTrack
const
&
vTrack
,
const
HEPEnergyType
dE
)
{
const
HEPEnergyType
dE
)
{
using
namespace
corsika
::
geometry
;
using
namespace
corsika
::
geometry
;
CoordinateSystem
const
&
rootCS
=
CoordinateSystem
const
&
rootCS
=
RootCoordinateSystem
::
GetInstance
().
GetRootCoordinateSystem
();
RootCoordinateSystem
::
GetInstance
().
GetRootCoordinateSystem
();
Point
pos1
(
rootCS
,
0
_m
,
0
_m
,
0
_m
);
Point
const
pos1
(
rootCS
,
0
_m
,
0
_m
,
0
_m
);
Point
pos2
(
rootCS
,
0
_m
,
0
_m
,
v
P
.
GetPosition
().
GetCoordinates
()[
2
]);
Point
const
pos2
(
rootCS
,
0
_m
,
0
_m
,
v
Track
.
GetPosition
(
0
).
GetCoordinates
()[
2
]);
Vector
delta
=
(
pos2
-
pos1
)
/
1
_s
;
auto
const
delta
=
(
pos2
-
pos1
)
/
1
_s
;
Trajectory
t
(
Line
(
pos1
,
delta
),
1
_s
);
Trajectory
const
t
(
Line
(
pos1
,
delta
),
1
_s
);
GrammageType
const
grammage
=
GrammageType
const
grammage
=
vP
.
GetNode
()
->
GetModelProperties
().
IntegratedGrammage
(
t
,
t
.
GetLength
());
vP
.
GetNode
()
->
GetModelProperties
().
IntegratedGrammage
(
t
,
t
.
GetLength
());
...
...
This diff is collapsed.
Click to expand it.
Processes/EnergyLoss/EnergyLoss.h
+
13
−
18
View file @
4064b5d5
...
@@ -25,35 +25,30 @@ namespace corsika::process::energy_loss {
...
@@ -25,35 +25,30 @@ namespace corsika::process::energy_loss {
class
EnergyLoss
:
public
corsika
::
process
::
ContinuousProcess
<
EnergyLoss
>
{
class
EnergyLoss
:
public
corsika
::
process
::
ContinuousProcess
<
EnergyLoss
>
{
using
MeVgcm2
=
decltype
(
1e6
*
units
::
si
::
electronvolt
/
units
::
si
::
gram
*
using
MeVgcm2
=
decltype
(
1e6
*
units
::
si
::
electronvolt
/
units
::
si
::
gram
*
corsika
::
units
::
si
::
square
(
1e-2
*
units
::
si
::
meter
));
units
::
si
::
square
(
1e-2
*
units
::
si
::
meter
));
void
MomentumUpdate
(
corsika
::
setup
::
Stack
::
ParticleType
&
,
void
MomentumUpdate
(
setup
::
Stack
::
ParticleType
&
,
units
::
si
::
HEPEnergyType
Enew
);
corsika
::
units
::
si
::
HEPEnergyType
Enew
);
public:
public:
EnergyLoss
();
EnergyLoss
();
void
Init
()
{}
void
Init
()
{}
process
::
EProcessReturn
DoContinuous
(
setup
::
Stack
::
ParticleType
&
,
setup
::
Trajectory
const
&
);
units
::
si
::
LengthType
MaxStepLength
(
setup
::
Stack
::
ParticleType
const
&
,
setup
::
Trajectory
const
&
)
const
;
corsika
::
process
::
EProcessReturn
DoContinuous
(
corsika
::
setup
::
Stack
::
ParticleType
&
,
units
::
si
::
HEPEnergyType
GetTotal
()
const
{
return
fEnergyLossTot
;
}
corsika
::
setup
::
Trajectory
&
);
corsika
::
units
::
si
::
LengthType
MaxStepLength
(
corsika
::
setup
::
Stack
::
ParticleType
const
&
,
corsika
::
setup
::
Trajectory
const
&
)
const
;
corsika
::
units
::
si
::
HEPEnergyType
GetTotal
()
const
{
return
fEnergyLossTot
;
}
void
PrintProfile
()
const
;
void
PrintProfile
()
const
;
private
:
private
:
static
corsika
::
units
::
si
::
HEPEnergyType
BetheBloch
(
static
units
::
si
::
HEPEnergyType
BetheBloch
(
setup
::
Stack
::
ParticleType
const
&
p
,
corsika
::
setup
::
Stack
::
ParticleType
const
&
p
,
const
units
::
si
::
GrammageType
dX
);
const
corsika
::
units
::
si
::
GrammageType
dX
);
int
GetXbin
(
corsika
::
setup
::
Stack
::
ParticleType
&
p
,
int
GetXbin
(
setup
::
Stack
::
ParticleType
const
&
,
setup
::
Trajectory
const
&
,
units
::
si
::
HEPEnergyType
);
const
corsika
::
units
::
si
::
HEPEnergyType
dE
);
corsika
::
units
::
si
::
HEPEnergyType
fEnergyLossTot
;
units
::
si
::
HEPEnergyType
fEnergyLossTot
;
corsika
::
units
::
si
::
GrammageType
fdX
;
// profile binning
units
::
si
::
GrammageType
fdX
;
// profile binning
std
::
map
<
int
,
double
>
fProfile
;
// longitudinal profile
std
::
map
<
int
,
double
>
fProfile
;
// longitudinal profile
};
};
}
// namespace corsika::process::energy_loss
}
// namespace corsika::process::energy_loss
...
...
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