ATLAS Offline Software
CtbPhotonESpectrumExample.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 
4 
6  import math
7  npar=17
8  ndim=1
9  imqfun=2
10  vconst=2.
11  sigvmi=[0.]
12  sigvt=[200.]
13  sigv=[0.1499999966472e-1, 0.2499999850988e-1, 0.7499999552965e-1,
14  0.1949999928474, 0.2249999940395, 0.2549999952316,
15  0.2750000059605, 0.3050000071526, 0.3149999976158,
16  0.3249999880791, 0.3349999785423, 0.000000000000,
17  1.000000000000, 0.1299999952316, 0.1700000017881,
18  0.3799999952316, 0.5199999809265]
19  sigdel=[0.1999999955297e-1, 0.1999999955297e-1, 0.1999999955297e-1,
20  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.1999999994950e-5,
23  0.1999999994950e-5, 0.3999999910593e-1, 0.3999999910593e-1,
24  0.7999999821186e-1, 0.1599999964237]
25  siga=[-1476.889556520, 764.5997024809, 20.39032204037,
26  13.93251046364, -17.19068470999, -10.30051418087,
27  -23.91052791023, -87.05159048677, 164.6286518027,
28  -286.9730931994, 204.9446308145, 689.8503539772,
29  3.411995820446, 2.781409973380, 11.14755985026,
30  26.68922609713, -7.732407966270]
31  photon=0.
32  for j in range(npar):
33  hqdj=0.
34  for i in range(ndim):
35  vv = (v - sigvmi[i])/sigvt[i]
36  hqdj = hqdj + (vv - sigv[j])*(vv - sigv[j])
37  hqdj = hqdj + sigdel[j] * sigdel[j]
38  hqdj = math.sqrt(hqdj)
39  photon = photon + siga[j] * hqdj
40  if imqfun==2:
41  photon = vconst*math.exp(photon)
42  photon = photon /365664.
43  return photon
44 
45 def build_spectrum(theApp,run_number):
46  from G4AtlasApps.atlas_utilhisto import HistoAtHistoSvc
47  p_espectrum=HistoAtHistoSvc(repr(run_number))
48  p_espectrum.book_histo(theApp,800,0.,80000.)
49  p_espectrumaxis=p_espectrum.HistoSvcEntry.axis()
50  for i in range(p_espectrumaxis.bins()):
51  x=(p_espectrumaxis.binUpperEdge(i)+p_espectrumaxis.binLowerEdge(i))/2.
52  y = photon_energy_spectrum(0.1*i)
53  print (x,y )
54  p_espectrum.HistoSvcEntry.fill(x,y)
55  return p_espectrum
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
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:5
python.CtbPhotonESpectrumExample.build_spectrum
def build_spectrum(theApp, run_number)
Definition: CtbPhotonESpectrumExample.py:45