Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LightSimtastic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
UHHDetLab
SiPM
LightSimtastic
Commits
f69c1122
Commit
f69c1122
authored
2 years ago
by
Jack Christopher Hutchinson Rolph
Browse files
Options
Downloads
Patches
Plain Diff
Update LightSimtastic.py
parent
e6872721
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
LightSimtastic.py
+32
-55
32 additions, 55 deletions
LightSimtastic.py
with
32 additions
and
55 deletions
LightSimtastic.py
+
32
−
55
View file @
f69c1122
...
@@ -336,9 +336,6 @@ class SiPMSimulation:
...
@@ -336,9 +336,6 @@ class SiPMSimulation:
npXT_sum
=
np
.
sum
(
npXT
)
npXT_sum
=
np
.
sum
(
npXT
)
nPG_pXT_sum
=
nPG_sum
+
npXT_sum
pg_l_d
=
np
.
ones
(
nlight_sum
)
pg_l_d
=
np
.
ones
(
nlight_sum
)
pg_l_t
=
np
.
asarray
(
ns
.
dist_ftlight
.
rvs
(
size
=
nlight_sum
))
pg_l_t
=
np
.
asarray
(
ns
.
dist_ftlight
.
rvs
(
size
=
nlight_sum
))
...
@@ -361,9 +358,6 @@ class SiPMSimulation:
...
@@ -361,9 +358,6 @@ class SiPMSimulation:
pg_d
=
[
np
.
concatenate
(
elem
)
for
elem
in
zip
(
pg_l_d
,
pg_dc_d
)]
pg_d
=
[
np
.
concatenate
(
elem
)
for
elem
in
zip
(
pg_l_d
,
pg_dc_d
)]
pg_t
=
[
np
.
concatenate
(
elem
)
for
elem
in
zip
(
pg_l_t
,
pg_dc_t
)]
pg_t
=
[
np
.
concatenate
(
elem
)
for
elem
in
zip
(
pg_l_t
,
pg_dc_t
)]
pg_pXT_d
=
[
np
.
concatenate
(
elem
)
for
elem
in
zip
(
pg_d
,
pXT_n
)]
pg_pXT_t
=
[
np
.
concatenate
(
elem
)
for
elem
in
zip
(
pg_t
,
pg_t
)]
...
@@ -440,17 +434,32 @@ class SiPMSimulation:
...
@@ -440,17 +434,32 @@ class SiPMSimulation:
]
]
ag_d
=
[
np
.
concatenate
(
elem
)
for
elem
in
zip
(
pg_d
,
pXT_d
,
dXT_d
)
]
ag_t
=
[
np
.
concatenate
(
elem
)
for
elem
in
zip
(
pg_t
,
pXT_t
,
dXT_t
)
]
pbar
.
update
(
1
)
pbar
.
update
(
1
)
pbar
.
set_description
(
"
{0}
"
.
format
(
self
.
pb_ag_text
[
4
]))
pbar
.
set_description
(
"
{0}
"
.
format
(
self
.
pb_ag_text
[
4
]))
Ap_d
=
[]
Ap_d
=
[]
Ap_t
=
[]
Ap_t
=
[]
for
list_pg_pXT_d
,
list_pg_pXT_t
in
zip
(
pg_pXT_d
,
pg_pXT_t
):
_Apd_list
=
[]
_Apt_list
=
[]
for
d
,
t
in
zip
(
list_pg_pXT_d
,
list_pg_pXT_t
):
for
list_ag_d
,
list_ag_t
in
zip
(
ag_d
,
ag_t
):
_list_Ap_d
=
[]
_list_Ap_t
=
[]
for
d
,
t
in
zip
(
list_ag_d
,
list_ag_t
):
if
(
d
>
0
):
if
(
d
>
0
):
...
@@ -470,73 +479,41 @@ class SiPMSimulation:
...
@@ -470,73 +479,41 @@ class SiPMSimulation:
_Apd
=
(
1
-
np
.
exp
(
-
_tAp
/
ns
.
tslow
))
*
_nAp
_Apd
=
(
1
-
np
.
exp
(
-
_tAp
/
ns
.
tslow
))
*
_nAp
_Ap
d
t
=
t
+
_tAp
_Apt
=
t
+
_tAp
else
:
else
:
_Apd
=
[]
_Apd
=
[]
_Ap
d
t
=
[]
_Apt
=
[]
else
:
else
:
_Apd
=
[]
_Apd
=
[]
_Ap
d
t
=
[]
_Apt
=
[]
_
Apd_
list
.
extend
(
list
(
_Apd
))
_list
_Ap_d
.
extend
(
list
(
_Apd
))
_
Apt_lis
t
.
extend
(
list
(
_Ap
d
t
))
_
list_Ap_
t
.
extend
(
list
(
_Apt
))
Ap_d
.
append
(
_
Apd_
list
)
Ap_d
.
append
(
_list
_Ap_d
)
Ap_t
.
append
(
_
Apt_lis
t
)
Ap_t
.
append
(
_
list_Ap_
t
)
Ap_d
=
np
.
array
(
Ap_d
)
Ap_d
=
np
.
array
(
Ap_d
)
Ap_t
=
np
.
array
(
Ap_t
)
Ap_t
=
np
.
array
(
Ap_t
)
# Ap_d = [
# np.array(
# list(chain.from_iterable(
# [
# [1-np.exp(-elem_Ap_t/ns.tslow)]*elem_Ap_n
# if(elem_Ap_n > 0 and elem_pg_d >0)
# else []
# for elem_pg_d, elem_pg_t, elem_Ap_n, elem_Ap_t in zip(list_pg_d, list_pg_t, list_Ap_n, list_Ap_t)
# ]
# )
# )
# )
# for list_pg_d, list_pg_t, list_Ap_n, list_Ap_t, in zip(pg_pXT_d, pg_pXT_t, Ap_n, Ap_t)
# ]
# Ap_t = [
# np.array(
# list(chain.from_iterable(
# [
# [elem_pg_t + elem_Ap_t]*elem_Ap_n
# if(elem_Ap_n > 0 and elem_pg_d >0)
# else []
# for elem_pg_d, elem_pg_t, elem_Ap_n, elem_Ap_t in zip(list_pg_d, list_pg_t, list_Ap_n, list_Ap_t)
# ]
# )
# )
# )
# for list_pg_d, list_pg_t, list_Ap_n, list_Ap_t, in zip(pg_pXT_d, pg_pXT_t, Ap_n, Ap_t)
# ]
pbar
.
update
(
1
)
pbar
.
update
(
1
)
pbar
.
set_description
(
"
{0}
"
.
format
(
self
.
pb_ag_text
[
5
]))
pbar
.
set_description
(
"
{0}
"
.
format
(
self
.
pb_ag_text
[
5
]))
ag_d
=
[
ag_d
=
[
np
.
concatenate
(
(
list_pg_d
,
list_pXT_d
,
list_dXT_d
,
list_Ap_d
)
)
np
.
concatenate
(
elem
)
for
list_pg_d
,
list_pXT_d
,
list_dXT_d
,
list_Ap_d
,
in
zip
(
pg_d
,
pXT_d
,
dXT
_d
,
Ap_d
)
for
elem
in
zip
(
ag
_d
,
Ap_d
)
]
]
ag_t
=
[
ag_t
=
[
np
.
concatenate
(
(
list_pg_t
,
list_pXT_t
,
list_dXT_t
,
list_Ap_t
)
)
np
.
concatenate
(
elem
)
for
list_pg_t
,
list_pXT_t
,
list_dXT_t
,
list_Ap_t
,
in
zip
(
pg_t
,
pXT_t
,
dXT
_t
,
Ap_t
)
for
elem
in
zip
(
ag
_t
,
Ap_t
)
]
]
ns
.
ag_d
=
ag_d
ns
.
ag_d
=
ag_d
ns
.
ag_t
=
ag_t
ns
.
ag_t
=
ag_t
...
...
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