Skip to content
Snippets Groups Projects
Commit b838ebc4 authored by Krishna Krishna Nikhil's avatar Krishna Krishna Nikhil
Browse files

Update 2 files

- /modules/execute.py
- /modules/generator.py
parent 0d0676c8
Branches
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment