-
Notifications
You must be signed in to change notification settings - Fork 11
/
sec_emission_model_accurate_low_ene.py
113 lines (93 loc) · 3.89 KB
/
sec_emission_model_accurate_low_ene.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#-Begin-preamble-------------------------------------------------------
#
# CERN
#
# European Organization for Nuclear Research
#
#
# This file is part of the code:
#
# PyECLOUD Version 8.7.1
#
#
# Main author: Giovanni IADAROLA
# BE-ABP Group
# CERN
# CH-1211 GENEVA 23
# SWITZERLAND
#
# Contributors: Eleonora Belli
# Philipp Dijkstal
# Lorenzo Giacomel
# Lotta Mether
# Annalisa Romano
# Giovanni Rumolo
# Eric Wulff
#
#
# Copyright CERN, Geneva 2011 - Copyright and any other
# appropriate legal protection of this computer program and
# associated documentation reserved in all countries of the
# world.
#
# Organizations collaborating with CERN may receive this program
# and documentation freely and without charge.
#
# CERN undertakes no obligation for the maintenance of this
# program, nor responsibility for its correctness, and accepts
# no liability whatsoever resulting from its use.
#
# Program and documentation are provided solely for the use of
# the organization to which they are distributed.
#
# This program may not be copied or otherwise distributed
# without permission. This message must be retained on this and
# any other authorized copies.
#
# The material cannot be sold. CERN should be given credit in
# all references.
#
#-End-preamble---------------------------------------------------------
from numpy import sqrt, exp
from numpy.random import rand
from .sec_emission_model_ECLOUD import SEY_model_ECLOUD
def yield_fun3(E, costheta, Emax, del_max, R0, E0):
s = 1.35
del_max_tilde = del_max * exp(0.5 * (1 - costheta))
E_max_tilde = Emax * (1 + 0.7 * (1 - costheta))
x = E / E_max_tilde
del_true_sec = del_max_tilde * (s * x) / (s - 1 + x**s)
del_reflected = R0 * ((sqrt(E) - sqrt(E + E0)) / (sqrt(E) + sqrt(E + E0)))**2
delta = del_true_sec + del_reflected
ref_frac = del_reflected / delta
return del_true_sec, del_reflected, ref_frac
class SEY_model_acc_low_ene(SEY_model_ECLOUD):
def __init__(self, Emax, del_max, R0, E0=150,
E_th=None, sigmafit=None, mufit=None,
switch_no_increase_energy=0, thresh_low_energy=None, secondary_angle_distribution=None,
):
self.E_th = E_th
self.sigmafit = sigmafit
self.mufit = mufit
self.switch_no_increase_energy = switch_no_increase_energy
self.thresh_low_energy = thresh_low_energy
self.secondary_angle_distribution = secondary_angle_distribution
if secondary_angle_distribution is not None:
from . import electron_emission
self.angle_dist_func = electron_emission.get_angle_dist_func(secondary_angle_distribution)
else:
self.angle_dist_func = None
self.Emax = Emax
self.del_max = del_max
self.R0 = R0
self.E0 = E0
def SEY_process(self, nel_impact, E_impact_eV, costheta_impact, i_impact):
del_true_sec, del_reflected, ref_frac = yield_fun3(E_impact_eV, costheta_impact, self.Emax, self.del_max, self.R0, E0=self.E0)
ref_prob = del_reflected
beta_ts = del_true_sec / (1. - del_reflected)
flag_elast = (rand(len(ref_prob)) < ref_prob)
flag_truesec = ~(flag_elast)
nel_emit = nel_impact.copy()
nel_emit[flag_truesec] = nel_impact[flag_truesec] * beta_ts[flag_truesec]
return nel_emit, flag_elast, flag_truesec