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
ba6d1703
Commit
ba6d1703
authored
6 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
better method names
parent
0a2584c9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Documentation/Examples/cascade_example.cc
+3
-3
3 additions, 3 deletions
Documentation/Examples/cascade_example.cc
Processes/EnergyLoss/EnergyLoss.cc
+13
-9
13 additions, 9 deletions
Processes/EnergyLoss/EnergyLoss.cc
Processes/EnergyLoss/EnergyLoss.h
+3
-2
3 additions, 2 deletions
Processes/EnergyLoss/EnergyLoss.h
with
19 additions
and
14 deletions
Documentation/Examples/cascade_example.cc
+
3
−
3
View file @
ba6d1703
...
@@ -290,7 +290,7 @@ int main() {
...
@@ -290,7 +290,7 @@ int main() {
const
int
nuclA
=
4
;
const
int
nuclA
=
4
;
const
int
nuclZ
=
int
(
nuclA
/
2.15
+
0.7
);
const
int
nuclZ
=
int
(
nuclA
/
2.15
+
0.7
);
const
HEPMassType
mass
=
GetNucleusMass
(
nuclA
,
nuclZ
);
const
HEPMassType
mass
=
GetNucleusMass
(
nuclA
,
nuclZ
);
const
HEPEnergyType
E0
=
nuclA
*
10
0
_G
eV
;
const
HEPEnergyType
E0
=
nuclA
*
10
_T
eV
;
double
theta
=
0.
;
double
theta
=
0.
;
double
phi
=
0.
;
double
phi
=
0.
;
...
@@ -321,7 +321,8 @@ int main() {
...
@@ -321,7 +321,8 @@ int main() {
EAS
.
Init
();
EAS
.
Init
();
EAS
.
Run
();
EAS
.
Run
();
cout
<<
"Result: E0="
<<
E0
/
1
_GeV
<<
endl
;
eLoss
.
PrintProfile
();
// print longitudinal profile
cut
.
ShowResults
();
cut
.
ShowResults
();
const
HEPEnergyType
Efinal
=
const
HEPEnergyType
Efinal
=
cut
.
GetCutEnergy
()
+
cut
.
GetInvEnergy
()
+
cut
.
GetEmEnergy
();
cut
.
GetCutEnergy
()
+
cut
.
GetInvEnergy
()
+
cut
.
GetEmEnergy
();
...
@@ -329,5 +330,4 @@ int main() {
...
@@ -329,5 +330,4 @@ int main() {
<<
"relative difference (%): "
<<
(
Efinal
/
E0
-
1
)
*
100
<<
endl
;
<<
"relative difference (%): "
<<
(
Efinal
/
E0
-
1
)
*
100
<<
endl
;
cout
<<
"total dEdX energy (GeV): "
<<
eLoss
.
GetTotal
()
/
1
_GeV
<<
endl
cout
<<
"total dEdX energy (GeV): "
<<
eLoss
.
GetTotal
()
/
1
_GeV
<<
endl
<<
"relative difference (%): "
<<
eLoss
.
GetTotal
()
/
E0
*
100
<<
endl
;
<<
"relative difference (%): "
<<
eLoss
.
GetTotal
()
/
E0
*
100
<<
endl
;
eLoss
.
SaveSave
();
}
}
This diff is collapsed.
Click to expand it.
Processes/EnergyLoss/EnergyLoss.cc
+
13
−
9
View file @
ba6d1703
...
@@ -35,7 +35,9 @@ namespace corsika::process::EnergyLoss {
...
@@ -35,7 +35,9 @@ namespace corsika::process::EnergyLoss {
};
};
EnergyLoss
::
EnergyLoss
()
EnergyLoss
::
EnergyLoss
()
:
fEnergyLossTot
(
0
_GeV
)
{}
:
fEnergyLossTot
(
0
_GeV
)
,
fdX
(
10
_g
/
square
(
1
_cm
))
// profile binning
{}
/**
/**
* PDG2018, passage of particles through matter
* PDG2018, passage of particles through matter
...
@@ -190,8 +192,6 @@ namespace corsika::process::EnergyLoss {
...
@@ -190,8 +192,6 @@ namespace corsika::process::EnergyLoss {
using
namespace
corsika
::
geometry
;
using
namespace
corsika
::
geometry
;
const
GrammageType
deltaX
=
10
_g
/
square
(
1
_cm
);
// binning
CoordinateSystem
const
&
rootCS
=
CoordinateSystem
const
&
rootCS
=
RootCoordinateSystem
::
GetInstance
().
GetRootCoordinateSystem
();
RootCoordinateSystem
::
GetInstance
().
GetRootCoordinateSystem
();
Point
pos1
(
rootCS
,
0
_m
,
0
_m
,
0
_m
);
Point
pos1
(
rootCS
,
0
_m
,
0
_m
,
0
_m
);
...
@@ -202,17 +202,21 @@ namespace corsika::process::EnergyLoss {
...
@@ -202,17 +202,21 @@ namespace corsika::process::EnergyLoss {
GrammageType
const
grammage
=
GrammageType
const
grammage
=
p
.
GetNode
()
->
GetModelProperties
().
IntegratedGrammage
(
t
,
t
.
GetLength
());
p
.
GetNode
()
->
GetModelProperties
().
IntegratedGrammage
(
t
,
t
.
GetLength
());
const
int
bin
=
grammage
/
d
elta
X
;
const
int
bin
=
grammage
/
f
dX
;
if
(
!
fSave
.
count
(
bin
))
{
cout
<<
"EnergyLoss new x bin "
<<
bin
<<
endl
;
}
// fill longitudinal profile
fSave
[
bin
]
+=
-
dE
/
1
_GeV
;
if
(
!
fProfile
.
count
(
bin
))
{
cout
<<
"EnergyLoss new x bin "
<<
bin
<<
endl
;
}
fProfile
[
bin
]
+=
-
dE
/
1
_GeV
;
return
bin
;
return
bin
;
}
}
void
EnergyLoss
::
SaveSave
()
{
void
EnergyLoss
::
PrintProfile
()
const
{
cout
<<
"EnergyLoss Save "
<<
endl
;
cout
<<
"EnergyLoss PrintProfile X-bin [g/cm2] dE/dX [GeV/g/cm2] "
<<
endl
;
for
(
auto
v
:
fSave
)
{
cout
<<
v
.
first
<<
" "
<<
v
.
second
<<
endl
;
}
double
const
deltaX
=
fdX
/
1
_g
*
square
(
1
_cm
);
for
(
auto
v
:
fProfile
)
{
cout
<<
v
.
first
*
deltaX
<<
" "
<<
v
.
second
/
deltaX
<<
endl
;
}
}
}
}
// namespace corsika::process::EnergyLoss
}
// namespace corsika::process::EnergyLoss
This diff is collapsed.
Click to expand it.
Processes/EnergyLoss/EnergyLoss.h
+
3
−
2
View file @
ba6d1703
...
@@ -41,7 +41,7 @@ namespace corsika::process::EnergyLoss {
...
@@ -41,7 +41,7 @@ namespace corsika::process::EnergyLoss {
corsika
::
setup
::
Trajectory
&
);
corsika
::
setup
::
Trajectory
&
);
corsika
::
units
::
si
::
HEPEnergyType
GetTotal
()
const
{
return
fEnergyLossTot
;
}
corsika
::
units
::
si
::
HEPEnergyType
GetTotal
()
const
{
return
fEnergyLossTot
;
}
void
SaveSave
()
;
void
PrintProfile
()
const
;
private
:
private
:
corsika
::
units
::
si
::
HEPEnergyType
BetheBloch
(
corsika
::
units
::
si
::
HEPEnergyType
BetheBloch
(
...
@@ -52,7 +52,8 @@ namespace corsika::process::EnergyLoss {
...
@@ -52,7 +52,8 @@ namespace corsika::process::EnergyLoss {
const
corsika
::
units
::
si
::
HEPEnergyType
dE
);
const
corsika
::
units
::
si
::
HEPEnergyType
dE
);
corsika
::
units
::
si
::
HEPEnergyType
fEnergyLossTot
;
corsika
::
units
::
si
::
HEPEnergyType
fEnergyLossTot
;
std
::
map
<
int
,
double
>
fSave
;
corsika
::
units
::
si
::
GrammageType
fdX
;
// profile binning
std
::
map
<
int
,
double
>
fProfile
;
// longitudinal profile
};
};
}
// namespace corsika::process::EnergyLoss
}
// namespace corsika::process::EnergyLoss
...
...
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