Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Calo Opt_Nikhil
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Krishna Nikhil
Calo Opt_Nikhil
Commits
b838ebc4
Commit
b838ebc4
authored
9 months ago
by
Krishna Krishna Nikhil
Browse files
Options
Downloads
Patches
Plain Diff
Update 2 files
- /modules/execute.py - /modules/generator.py
parent
0d0676c8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/execute.py
+1
-1
1 addition, 1 deletion
modules/execute.py
modules/generator.py
+5
-17
5 additions, 17 deletions
modules/generator.py
with
6 additions
and
18 deletions
modules/execute.py
+
1
−
1
View file @
b838ebc4
...
...
@@ -113,7 +113,7 @@ if __name__ == "__main__":
types
=
ToP
,
n_vars
=
40
,
n_events_per_var
=
400
//
divide
,
particles
=
[
'
gamma
'
,
0.22
,
'
pi+
'
,
2.11
])
particles
=
[
[
'
gamma
'
,
0.22
],[
'
pi+
'
,
2.11
]
]
)
# reconstruction
...
...
This diff is collapsed.
Click to expand it.
modules/generator.py
+
5
−
17
View file @
b838ebc4
...
...
@@ -117,18 +117,6 @@ class Parameters(object):
else
:
cw
.
addLayer
(
senth
,
Cheap
[
'
Scintillator
'
][
0
],
True
,
1
)
# MaxIndex = max(parameters['material_choice_1'],parameters['material_choice_2'])#parameters['material_choice'].index(max(parameters['material_choice']))
# if(MaxIndex == parameters['material_choice_1']):
# cw.addLayer(senth, "G4_POLYSTYRENE",True,1)
# elif(MaxIndex == parameters['material_choice_2']):
# cw.addLayer(senth, "G4_PbWO4",True,1)
#if i==3:
# cw.addLayer(senth, "G4_PbWO4",True,1)
#else:
# cw.addLayer(senth, "G4_POLYSTYRENE",True,1) #DEBUG
#cw.addLayer(senth, "G4_POLYSTYRENE",True,1) #DEBUG
return
cw
...
...
@@ -420,7 +408,7 @@ class Generator(object):
if
single
==
False
:
n_todo
=
self
.
n_vars
while
n_todo
>
0
:
while
n_todo
>
0
:
# If running on Cluster(or predetermined number of CPU cores) please comment lines 411-416 for better performance.
if
n_todo
>
n_core
:
done_after
=
jobs
(
results
,
n_core
)
done1
.
extend
(
done_after
)
...
...
@@ -471,12 +459,12 @@ class Generator(object):
p
=
self
.
particles
df
=
G4System
.
run_batch
(
int
(
self
.
n_events_per_var
*
gammapi_ratio
),
p
[
0
],
1.
,
20
)
df
=
df
.
assign
(
true_pid
=
np
.
array
(
len
(
df
)
*
[
p
[
1
]],
dtype
=
'
float32
'
))
df
=
G4System
.
run_batch
(
int
(
self
.
n_events_per_var
*
gammapi_ratio
),
p
[
0
]
[
0
]
,
1.
,
20
)
df
=
df
.
assign
(
true_pid
=
np
.
array
(
len
(
df
)
*
[
p
[
0
][
1
]],
dtype
=
'
float32
'
))
dfs
.
append
(
df
)
df
=
G4System
.
run_batch
(
int
(
self
.
n_events_per_var
*
(
1
-
gammapi_ratio
)),
p
[
2
],
1.
,
20
)
df
=
df
.
assign
(
true_pid
=
np
.
array
(
len
(
df
)
*
[
p
[
3
]],
dtype
=
'
float32
'
))
df
=
G4System
.
run_batch
(
int
(
self
.
n_events_per_var
*
(
1
-
gammapi_ratio
)),
p
[
1
][
0
],
1.
,
20
)
df
=
df
.
assign
(
true_pid
=
np
.
array
(
len
(
df
)
*
[
p
[
1
][
1
]],
dtype
=
'
float32
'
))
dfs
.
append
(
df
)
df
=
pd
.
concat
(
dfs
)
...
...
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