ATLAS Offline Software
Functions
python.CtbPhotonESpectrumExample Namespace Reference

Functions

def photon_energy_spectrum (v)
 
def build_spectrum (theApp, run_number)
 

Function Documentation

◆ build_spectrum()

def python.CtbPhotonESpectrumExample.build_spectrum (   theApp,
  run_number 
)

Definition at line 46 of file CtbPhotonESpectrumExample.py.

46 def build_spectrum(theApp,run_number):
47  from G4AtlasApps.atlas_utilhisto import HistoAtHistoSvc
48  p_espectrum=HistoAtHistoSvc(repr(run_number))
49  p_espectrum.book_histo(theApp,800,0.,80000.)
50  p_espectrumaxis=p_espectrum.HistoSvcEntry.axis()
51  for i in range(p_espectrumaxis.bins()):
52  x=(p_espectrumaxis.binUpperEdge(i)+p_espectrumaxis.binLowerEdge(i))/2.
53  y = photon_energy_spectrum(0.1*i)
54  print (x,y )
55  p_espectrum.HistoSvcEntry.fill(x,y)
56  return p_espectrum

◆ photon_energy_spectrum()

def python.CtbPhotonESpectrumExample.photon_energy_spectrum (   v)

Definition at line 6 of file CtbPhotonESpectrumExample.py.

7  import math
8  npar=17
9  ndim=1
10  imqfun=2
11  vconst=2.
12  sigvmi=[0.]
13  sigvt=[200.]
14  sigv=[0.1499999966472e-1, 0.2499999850988e-1, 0.7499999552965e-1,
15  0.1949999928474, 0.2249999940395, 0.2549999952316,
16  0.2750000059605, 0.3050000071526, 0.3149999976158,
17  0.3249999880791, 0.3349999785423, 0.000000000000,
18  1.000000000000, 0.1299999952316, 0.1700000017881,
19  0.3799999952316, 0.5199999809265]
20  sigdel=[0.1999999955297e-1, 0.1999999955297e-1, 0.1999999955297e-1,
21  0.1999999955297e-1, 0.1999999955297e-1, 0.1999999955297e-1,
22  0.1999999955297e-1, 0.1999999955297e-1, 0.1999999955297e-1,
23  0.1999999955297e-1, 0.1999999955297e-1, 0.1999999994950e-5,
24  0.1999999994950e-5, 0.3999999910593e-1, 0.3999999910593e-1,
25  0.7999999821186e-1, 0.1599999964237]
26  siga=[-1476.889556520, 764.5997024809, 20.39032204037,
27  13.93251046364, -17.19068470999, -10.30051418087,
28  -23.91052791023, -87.05159048677, 164.6286518027,
29  -286.9730931994, 204.9446308145, 689.8503539772,
30  3.411995820446, 2.781409973380, 11.14755985026,
31  26.68922609713, -7.732407966270]
32  photon=0.
33  for j in range(npar):
34  hqdj=0.
35  for i in range(ndim):
36  vv = (v - sigvmi[i])/sigvt[i]
37  hqdj = hqdj + (vv - sigv[j])*(vv - sigv[j])
38  hqdj = hqdj + sigdel[j] * sigdel[j]
39  hqdj = math.sqrt(hqdj)
40  photon = photon + siga[j] * hqdj
41  if imqfun==2:
42  photon = vconst*math.exp(photon)
43  photon = photon /365664.
44  return photon
45 
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
PyAthena::repr
std::string repr(PyObject *o)
returns the string representation of a python object equivalent of calling repr(o) in python
Definition: PyAthenaUtils.cxx:106
python.CtbPhotonESpectrumExample.photon_energy_spectrum
def photon_energy_spectrum(v)
Definition: CtbPhotonESpectrumExample.py:6
python.CtbPhotonESpectrumExample.build_spectrum
def build_spectrum(theApp, run_number)
Definition: CtbPhotonESpectrumExample.py:46