Skip to content

Commit

Permalink
Fix: cleaned up CB code
Browse files Browse the repository at this point in the history
Works for mono-energetic sources but fails for flat sources!
  • Loading branch information
josh0-jrg committed Jan 6, 2025
1 parent 08db6b5 commit 02dcd70
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions flamedisx/nest/lxe_blocks/quanta_splitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ def compute_single_energy(args, approx=False):
if self.is_ER:
nel_mean = self.gimme('mean_yield_electron', data_tensor=data_tensor, ptensor=ptensor,
bonus_arg=energy)
#a fix to retain back-compatibiliy, god help me.
nel_mean = nel_mean*tf.transpose(tf.ones_like(nq, fd.float_type()),perm=[1,2,3,0])
nel_mean = tf.transpose(nel_mean,perm=[3,0,1,2])
if self.source.field_map_E is not None:
nel_mean=tf.tensordot(nel_mean,tf.ones_like(nq),0)[:,0,:] #map the mean val to proper shape.
nq_mean = self.gimme('mean_yield_quanta', data_tensor=data_tensor, ptensor=ptensor,
bonus_arg=(energy, nel_mean))
fano = self.gimme('fano_factor', data_tensor=data_tensor, ptensor=ptensor,
Expand Down

0 comments on commit 02dcd70

Please sign in to comment.