4 ATLAS Beam Spot web page. This is the root page that sets up the tree of beam spot
5 web pages. This is intended to be run by CherryPy through Apache's mod_python, but
6 you can test it locally using `python index.py`.
8 Sample Apache configuration:
11 PythonPath "sys.path+['/home/jb/atl/InDetBeamSpotExample/www']"
12 SetHandler python-program
13 PythonHandler cherrypy._cpmodpy::handler
14 PythonOption cherrypy.setup index::setup_server
19 __author__ =
'Juerg Beringer'
20 __version__ =
'index.py atlas/athena'
25 from BeamSpotWebPage
import BeamSpotWebPage, DummyPage
26 from BeamSpotSummary
import BeamSpotSummary
27 from JobBrowser
import JobBrowser
28 from JobDetails
import JobDetails
29 from FileBrowser
import FileBrowser
30 from PlotServer
import PlotServer
31 from MyPlots
import MyPlots
32 from WebPlots
import WebPlots
33 from DebugPage
import DebugPage
37 currentDir = os.path.dirname(os.path.abspath(__file__))
39 '/': {
'tools.staticdir.root': currentDir},
40 '/css': {
'tools.staticdir.on':
True,
41 'tools.staticdir.dir':
'css'},
42 '/js': {
'tools.staticdir.on':
True,
43 'tools.staticdir.dir':
'js'},
44 '/images': {
'tools.staticdir.on':
True,
45 'tools.staticdir.dir':
'images'},
46 '/tmp': {
'tools.staticdir.on':
True,
47 'tools.staticdir.dir':
'tmp'}
53 root.globalConfig.baseUrl =
'/webapp'
55 root.globalConfig[
'jobDir'] = os.environ.get(
'JOBDIR',
'/afs/cern.ch/user/a/atlidbs/jobs')
56 root.globalConfig[
'taskDb'] = os.environ.get(
'TASKDB',
'auth_file:/afs/cern.ch/user/a/atlidbs/private/beamspotdbinfo_r.dat')
57 root.globalConfig[
'wwwDir'] = os.environ.get(
'WWWDIR',
'/var/vhost/atlas-beamspot/secure/InDetBeamSpotExample/www')
58 root.globalConfig[
'ntDir'] = os.environ.get(
'NTDIR',
'/afs/cern.ch/user/a/atlidbs/nt')
59 root.globalConfig[
'periodDir'] = os.environ.get(
'PERIODDIR',
'/afs/cern.ch/user/a/atlidbs/nt/DataPeriods')
60 root.globalConfig[
'webPlotDir'] = os.environ.get(
'WEBPLOTDIR',
'/afs/cern.ch/user/a/atlidbs/nt/webplots')
73 root.addPage(
'bcidSummary',
BeamSpotSummary(), query=
'?type=BCID&limit=0')
74 root.addPage(
'reprocSummary',
BeamSpotSummary(), query=
'?type=REPR&limit=0')
78 root.addPage(
'myplots',
MyPlots())
86 cherrypy.config.update({
'environment':
'production',
88 'server.socket_host':
'127.0.0.1',
89 'log.error_file':
'/tmp/site.log',
90 'show_tracebacks':
False})
91 cherrypy.tree.mount(root, root.globalConfig.baseUrl, config=beamSpotConfig)
95 if __name__ ==
'__main__':
107 cherrypy.quickstart(root, root.globalConfig.baseUrl, config=beamSpotConfig)