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
b6a74928
Commit
b6a74928
authored
4 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
make examples run MUCH faster and with less output
parent
7e296a3c
No related branches found
No related tags found
No related merge requests found
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Processes/TrackingLine/TrackingLine.h
+15
-23
15 additions, 23 deletions
Processes/TrackingLine/TrackingLine.h
with
15 additions
and
23 deletions
Processes/TrackingLine/TrackingLine.h
+
15
−
23
View file @
b6a74928
...
...
@@ -14,6 +14,8 @@
#include
<corsika/geometry/Trajectory.h>
#include
<corsika/geometry/Vector.h>
#include
<corsika/units/PhysicalUnits.h>
#include
<corsika/logging/Logging.h>
#include
<optional>
#include
<type_traits>
#include
<utility>
...
...
@@ -38,7 +40,7 @@ namespace corsika::process {
class
TrackingLine
{
public:
TrackingLine
()
{}
;
TrackingLine
()
=
default
;
template
<
typename
Particle
>
// was Stack previously, and argument was
// Stack::StackIterator
...
...
@@ -49,27 +51,23 @@ namespace corsika::process {
p
.
GetMomentum
()
/
p
.
GetEnergy
()
*
corsika
::
units
::
constants
::
c
;
auto
const
currentPosition
=
p
.
GetPosition
();
std
::
cout
<<
"TrackingLine pid: "
<<
p
.
GetPID
()
<<
" , E = "
<<
p
.
GetEnergy
()
/
1
_GeV
<<
" GeV"
<<
std
::
endl
;
std
::
cout
<<
"TrackingLine pos: "
<<
currentPosition
.
GetCoordinates
()
// << " [" << p.GetNode()->GetModelProperties().GetName() << "]"
<<
std
::
endl
;
std
::
cout
<<
"TrackingLine E: "
<<
p
.
GetEnergy
()
/
1
_GeV
<<
" GeV"
<<
std
::
endl
;
std
::
cout
<<
"TrackingLine p: "
<<
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
<<
" GeV "
<<
std
::
endl
;
std
::
cout
<<
"TrackingLine v: "
<<
velocity
.
GetComponents
()
<<
std
::
endl
;
C8LOG_DEBUG
(
"TrackingLine pid: {}"
" , E = {} GeV"
,
p
.
GetPID
(),
p
.
GetEnergy
()
/
1
_GeV
);
C8LOG_DEBUG
(
"TrackingLine pos: {}"
,
currentPosition
.
GetCoordinates
());
C8LOG_DEBUG
(
"TrackingLine E: {} GeV"
,
p
.
GetEnergy
()
/
1
_GeV
);
C8LOG_DEBUG
(
"TrackingLine p: {} GeV"
,
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
);
C8LOG_DEBUG
(
"TrackingLine v: {} "
,
velocity
.
GetComponents
());
// to do: include effect of magnetic field
geometry
::
Line
line
(
currentPosition
,
velocity
);
auto
const
*
currentLogicalVolumeNode
=
p
.
GetNode
();
//~ auto const* currentNumericalVolumeNode =
//~ fEnvironment.GetUniverse()->GetContainingNode(currentPosition);
auto
const
numericallyInside
=
currentLogicalVolumeNode
->
GetVolume
().
Contains
(
currentPosition
);
std
::
cout
<<
"numericallyInside =
"
<<
(
numericallyInside
?
"true"
:
"false"
);
C8LOG_DEBUG
(
"numericallyInside =
{} "
,
numericallyInside
);
auto
const
&
children
=
currentLogicalVolumeNode
->
GetChildNodes
();
auto
const
&
excluded
=
currentLogicalVolumeNode
->
GetExcludedNodes
();
...
...
@@ -85,14 +83,11 @@ namespace corsika::process {
if
(
auto
opt
=
TimeOfIntersection
(
line
,
sphere
);
opt
.
has_value
())
{
auto
const
[
t1
,
t2
]
=
*
opt
;
std
::
cout
<<
"intersection times: "
<<
t1
/
1
_s
<<
"; "
<<
t2
/
1
_s
// << " " << vtn.GetModelProperties().GetName()
<<
std
::
endl
;
C8LOG_DEBUG
(
"intersection times: {} s; {} s"
,
t1
/
1
_s
,
t2
/
1
_s
);
if
(
t1
.
magnitude
()
>
0
)
intersections
.
emplace_back
(
t1
,
&
vtn
);
else
if
(
t2
.
magnitude
()
>
0
)
std
::
cout
<<
"inside other volume"
<<
std
::
endl
;
C8LOG_DEBUG
(
"inside other volume"
)
;
}
};
...
...
@@ -123,10 +118,7 @@ namespace corsika::process {
min
=
minIter
->
first
;
}
std
::
cout
<<
" t-intersect: "
<<
min
// << " " << minIter->second->GetModelProperties().GetName()
<<
std
::
endl
;
C8LOG_DEBUG
(
" t-intersect: {} "
,
min
);
return
std
::
make_tuple
(
geometry
::
Trajectory
<
geometry
::
Line
>
(
line
,
min
),
velocity
.
norm
()
*
min
,
minIter
->
second
);
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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