Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3BUU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
simulation
KM3BUU
Commits
83e57c4f
Commit
83e57c4f
authored
3 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Update PROPOSAL workflow to v7
parent
fb7054c6
No related branches found
No related tags found
1 merge request
!20
Proposal 7
Pipeline
#23566
failed
3 years ago
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3buu/propagation.py
+43
-31
43 additions, 31 deletions
km3buu/propagation.py
with
43 additions
and
31 deletions
km3buu/propagation.py
+
43
−
31
View file @
83e57c4f
...
...
@@ -36,23 +36,33 @@ PROPOSAL_LEPTON_DEFINITIONS = {
-
16
:
pp
.
particle
.
NuTauBarDef
}
PROPOSAL_TARGET
=
pp
.
medium
.
AntaresWater
()
def
_setup_propagator
(
max_distance
,
particle_definition
):
pp
.
InterpolationSettings
.
tables_path
=
Config
().
proposal_itp_tables
crosssection
=
pp
.
crosssection
.
make_std_crosssection
(
particle_def
=
particle_definition
,
target
=
PROPOSAL_TARGET
,
interpolate
=
True
,
cuts
=
pp
.
EnergyCutSettings
(
np
.
inf
,
0.05
,
False
))
collection
=
pp
.
PropagationUtilityCollection
()
collection
.
displacement
=
pp
.
make_displacement
(
crosssection
,
True
)
collection
.
interaction
=
pp
.
make_interaction
(
crosssection
,
True
)
collection
.
decay
=
pp
.
make_decay
(
crosssection
,
True
)
collection
.
time
=
pp
.
make_time
(
crosssection
,
True
)
utility
=
pp
.
PropagationUtility
(
collection
=
collection
)
def
_setup_propagator
(
max_distance
,
lepton_definition
):
sector
=
pp
.
SectorDefinition
()
sector
.
medium
=
pp
.
medium
.
AntaresWater
(
1.0
)
geometry
=
pp
.
geometry
.
Sphere
(
pp
.
Vector3D
(),
max_distance
,
0
)
sector
.
geome
tr
y
=
geometry
sector
.
scattering_model
=
pp
.
scattering
.
ScatteringModel
.
Highland
density_dis
tr
=
pp
.
density_distribution
.
density_homogeneous
(
PROPOSAL_TARGET
.
mass_density
)
cfg
=
Config
()
interpolation
=
pp
.
InterpolationDef
()
interpolation
.
path_to_tables
=
cfg
.
proposal_itp_tables
interpolation
.
path_to_tables_readonly
=
cfg
.
proposal_itp_tables
propagator
=
pp
.
Propagator
(
particle_definition
,
[(
geometry
,
utility
,
density_distr
)])
return
pp
.
Propagator
(
sector_defs
=
[
sector
],
particle_def
=
lepton_definition
,
detector
=
geometry
,
interpolation_def
=
interpolation
)
return
propagator
def
propagate_lepton
(
lepout_data
,
pdgid
):
...
...
@@ -76,28 +86,30 @@ def propagate_lepton(lepout_data, pdgid):
lepout_data
.
lepOut_E
)
/
lepton_info
.
mass
#[cm]
lepton_def
=
PROPOSAL_LEPTON_DEFINITIONS
[
pdgid
]()
lepton
=
pp
.
particle
.
DynamicData
(
lepton_def
.
particle_type
)
propagated_data
=
defaultdict
(
list
)
propagator
=
_setup_propagator
(
10
*
prop_range
,
lepton_def
)
propagated_data
=
defaultdict
(
list
)
for
entry
in
lepout_data
:
lepton
.
energy
=
entry
.
lepOut_E
*
1e3
lepton
.
position
=
pp
.
Vector3D
(
0
,
0
,
0
)
lepton
.
direction
=
pp
.
Vector3D
(
entry
.
lepOut_Px
,
entry
.
lepOut_Py
,
entry
.
lepOut_Pz
)
lepton
.
direction
.
normalize
()
secondaries
=
propagator
.
propagate
(
lepton
,
5
*
prop_range
)
E
=
np
.
array
(
secondaries
.
energy
)
/
1e3
pdgid
=
[
p
.
type
for
p
in
secondaries
.
particles
]
Px
=
[
p
.
direction
.
x
*
p
.
momentum
/
1e3
for
p
in
secondaries
.
particles
]
Py
=
[
p
.
direction
.
y
*
p
.
momentum
/
1e3
for
p
in
secondaries
.
particles
]
Pz
=
[
p
.
direction
.
z
*
p
.
momentum
/
1e3
for
p
in
secondaries
.
particles
]
x
=
[
p
.
position
.
x
/
100
for
p
in
secondaries
.
particles
]
y
=
[
p
.
position
.
y
/
100
for
p
in
secondaries
.
particles
]
z
=
[
p
.
position
.
z
/
100
for
p
in
secondaries
.
particles
]
dt
=
[
p
.
time
for
p
in
secondaries
.
particles
]
init_state
=
pp
.
particle
.
ParticleState
()
init_state
.
energy
=
entry
.
lepOut_E
*
1e3
init_state
.
position
=
pp
.
Cartesian3D
(
0
,
0
,
0
)
init_state
.
direction
=
pp
.
Cartesian3D
(
entry
.
lepOut_Px
,
entry
.
lepOut_Py
,
entry
.
lepOut_Pz
)
init_state
.
direction
.
normalize
()
track
=
propagator
.
propagate
(
init_state
,
5
*
prop_range
)
secondaries
=
track
.
decay_products
()
E
=
[
s
.
energy
/
1e3
for
s
in
secondaries
]
pdgid
=
[
p
.
type
for
p
in
secondaries
]
Px
=
[
p
.
direction
.
x
*
p
.
momentum
/
1e3
for
p
in
secondaries
]
Py
=
[
p
.
direction
.
y
*
p
.
momentum
/
1e3
for
p
in
secondaries
]
Pz
=
[
p
.
direction
.
z
*
p
.
momentum
/
1e3
for
p
in
secondaries
]
x
=
[
p
.
position
.
x
/
100
for
p
in
secondaries
]
y
=
[
p
.
position
.
y
/
100
for
p
in
secondaries
]
z
=
[
p
.
position
.
z
/
100
for
p
in
secondaries
]
dt
=
[
p
.
time
for
p
in
secondaries
]
propagated_data
[
"
E
"
].
append
(
E
)
propagated_data
[
"
Px
"
].
append
(
Px
)
...
...
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