D0 Online Calibration Database Browser

Ayodele Onibokun

Bethune-Cookman College

SIST Program

Fermi National Laboratory

Batavia, IL

**August 13, 2004**

Research Supervisor: **Taka Yasuda**

Signature: ..... ..... ......... ........ ......... ........ .......

**Table of Contents**

**1 Introduction** . . . . . . . . . . . . . . . . . . . . . . . . . . 1

**2 Detectors** . . . . . . . . . . . . . . . . . . . . . . . . . . 1

**3 Dø experiment** . . . . . . . . . . . . . . . . . . . . . . . . . .
1

**4 Project Designs** . . . . . . . . . . . . . . . . . . . . . . . . .
. 2

**5 Project Descriptions** . . . . . . . . . . . . . . . . . . . . . . .
. 4

5\. Java . . . . . . . . . . . . . . . . . . . . . . . . 4

> 5.1 Package beans . . . . . . . . . . . . . . . . . . 4
>
> 5.1.1 DrillBean class . . . . . . . . . . . . . . . . 4 5.1.2
> TableBean class . . . . . . . . . . . . . . . . 4
>
> 5.1.3 SelectBean class . . . . . . . . . . . . . . . . 4
>
> 5.1.4 ChartBean class . . . . . . . . . . . . . . . . 4
>
> 5.2 Package calibDbServlets . . . . . . . . . . . . . . . . 5
>
> 5.2.1 ButtonServlet class . . . . . . . . . . . . . . . . 5
>
> 5.2.2 DrillServlet class . . . . . . . . . . . . . . . . 5
>
> 5.2.3 ChartServlet class . . . . . . . . . . . . . . . . 5

5.3 Package calibDbData.states . . . . . . . . . . . . . . . . 6

5.3.1 IServletState Interface . . . . . . . . . . . . . . . . 6

5.4 Package calibDbData . . . . . . . . . . . . . . . . 6 5.4.1
CalibDatasetProducer class . . . . . . . . . . . . . 6 5.4.2
OracleConnector class . . . . . . . . . . . . . 6 5.4.3 DataManager
class . . . . . . . . . . . . . 6

**6 Java Servlet** . . . . . . . . . . . . . . . . . . . . . . . . . 6

**7 Java Server Pages** . . . . . . . . . . . . . . . . . . . . . . . .
7

**8 JFreeChart** . . . . . . . . . . . . . . . . . . . . . . . . . . 8

**9 Result** . . . . . . . . . . . . . . . . . . . . . . . . . . 9

**10 Conclusions** . . . . . . . . . . . . . . . . . . . . . . . . . 10

**11 Acknowledgements** . . . . . . . . . . . . . . . . . . . . . . 13
**References** . . . . . . . . . . . . . . . . . . . . . . . . . . 13

**List of Figures**

1\. Graph generated by JFreeChart . . . . . . . . . . . . . . . 8

2\. Initial version of D0 offline calibration database browser . . . . .
. . . 10

3\. Updated version of D0 offline calibration database browser . . . . .
11

4\. D0 offline calibration browser on a Linux Server . . . . . . . 12

Abstract

The Dø experiment stores calibration constants for detector electronics
into ORACLE databases. The calibration constants are collected
periodically to track changes in the detector electronics. The
calibration database is used to convert electronic data from the
detector into physical quantities. Dø collaboration has developed a
graphical browser for the offline calibration database, written in Java,
JSP and Java Servlet. The purpose of this project is to enhance the
functionality of the Dø calibration database browser. The first
enhancement was to add the calorimeter system to the existing database
browser, which did not exist earlier. The second enhancement was to
create a separate database browser for the online calibration database.
By browsing the calibration database graphically, physicists working on
the Dø experiment can interpret the calibration constants collected over
time better. For example, abnormal detector channels can be easily
identified from a graph.

**Research Category**: Computer Science

School: Bethune-Cookman College

Supervisor's Name: Takahiro Yasuda

Phone: (630)840-6603

Email: <yasuda@fnal.gov>

Presenter: Ayodele Onibokun

Email: <makethemove@hotmail.com>

Web: <http://www4.cookman.edu/ayodele>

**1 Introduction\
**The research goal of Fermi National Accelerator Laboratory is to
advance the understanding of the fundamental nature of matter by
providing leadership and resources for qualified researchers who conduct
basic research at the frontiers of high energy physics and related
disciples. This involves identifying the building blocks of our universe
and to further understand how they interact with each other. "High
Energy" means high particle energy. One of the experiments conducted at
Fermilab is the Dø experiment. There are currently eight sub-detectors
in the d-zero detector: Silicon Microstrip Tracker (SMT), Central Fiber
Tracker (CFT), Central Pre-Shower (CPS), Forward Proton Tracker (FPT),
Calorimeter (CAL), MDT, Muon Scintillator (MSC) and Proportional Drift
Tube (PDT). The primary focus of this report is on these eight
sub-detectors.

Detectors are the instruments that show what new matter has been formed
from particle collisions, regardless of whether the colliding particles
are electrons, protons, positrons or hadrons. They are large, complex
devices with several types of detecting elements (McDunn, 2001). Each
collision seen by the detector is called an event. Two basic types of
detectors observe the particles in an event: tracking detectors and
calorimeters. Tracking detectors record the path of a particle and
calorimeters absorb particles and measure their energy

The Dø experiment consists of a worldwide collaboration of scientists
conducting research on the fundamental nature of matter. This experiment
is located at the world's premier high-energy accelerator, the Tevatron,
which is four-miles circumference of radius of about 1 km. It was
originally named the "Energy Doubler" when it began operation in 1983.
It consists of 1,000 superconducting magnets that are cooled by liquid
helium to -268 degrees Celsius (-450 degrees Fahrenheit). Its low
temperature cooling system was the largest ever built when it was placed
in operation in 1983. The Tevatron accelerates protons and antiprotons
up to 976 GeV. The accelerated protons and antiprotons collide at the
center of the Dø detector. The collision occurs at the center of mass
energy of 1.96 TeV. Once the collision occurs, the detector obtains
various information of the collision as raw data. The Dø group then
performs the numerous data analyses to investigate whether new particles
were formed, the mass of each particle, direction and so forth.

Dø currently operates an initial grid-like system for its data analysis
which is based around a federated database SAM in which the meta-data of
all possible information in the experiment is declared from the
calibration[^1] and the experimental data from the detector to the
analyses samples. Researchers need be able to access the data stored in
the database from wherever they are without having to learn complex
database commands and syntax. Researchers also use computer programs
that query the database for the values and combine it with data recorded
during an actual proton/antiproton collision to recreate what actually
happened in the collision. Several millions of raw data are collected
and processed every month. Special sets of data are collected to
calibrate the detector elements. The results from the data analysis of
this set of data are stored in the online calibration database and are
transferred to an offline database to be used for the offline data
reconstruction. A graphical database browser was designed to examine the
quality of the calibration data. The browser consists of a friendly
user-interface, a component that allows a user to enter any search query
and be able to review the result in an instance. This interface also
lets a user enter search ranges which will only returns results within
the range specified, for example, start of run and end of run. One of
the goals for this year's project is to add queries for the calorimeter
database and deploy the browser for general purpose use. The other goal
is to build a similar browser for the online calibration database. The
difference between the offline and the online calibration database
browser is that the offline has several text fields that allow a user to
enter search parameters: range, luminosity and version while the online
calibration browser needs to be able to query individual sub-detector
database separately. Clicking on any of the sub-detector buttons will
take the user directly to the calibration run table for the sub-detector
and be able to drill down to get more information on the data from
previous tables. This project is written mostly in Java, JavaBeans, Java
Servlets, Java Server Pages and JFreechart -- a plotting library that
was used to plot the values returned by the database.

**5 Project Descriptions**

**Java**

Java is a simple, object-oriented, distributed, interpreted, robust,
secure, architecture neutral, portable, high-performance, multithreaded,
and dynamic language and software platform. Java is a network-oriented
programming language invented by Sun Microsystems that is specifically
designed for writing programs that can be safely downloaded to a
computer through the Internet and immediately run without fear of
viruses or other harm to the computer or files. Using small Java
programs (called \"applets\"), Web pages can include functions such as
animations, specialized calculators, and other programs (Webopedia).

**5.1 Package beans**

Beans are a Java class that contains standard Java bean ancestor methods
for properties. These ancestor methods have the form getX, setX and isX
where X is the property\'s name. The isX method is only used for boolean
values and can be replaced with getX (SourceForge.Net). This package
holds the JavaBeans used in the server-side implementation.

**5.1.1** **DrillBean class**

This bean is responsible for the drilling aspect of the database, in
other words, it determines which state the database is.

**5.1.2 TableBean class**

This bean is an interface to the D0TableModel. It encapsulates the
current data/tables being displayed.

**5.1.3 SelectBean class**

This bean will get the data as soon as any one of the button is clicked.
It also creates the query based on the button clicked.

**5.1.4 ChartBean class**

The ChartBean is responsible for generating queries to be plotted and
designate the labels of x and y axis including the title of the chart.

**5.2 Package calibDbServlets**

This package holds all the servlets that interface with the DataManager.

**5.2.1 ButtonServlet class**

This servlet uses the SelectBean to update the D0TableModel based on
which button is clicked.

**5.2.2 DrillServlet class**

This servlet handles all the drilling aspect of the database using the
DrillBean class.

**5.2.3 ChartServlet class**

This servlet uses the ChartBean to configure the properties of the
chart. It then delegates the creation of the plot to the
displayChart.jsp page.

**5.3 Package calibDbData.states**

This package is configured to get the servlets working with the state
design pattern used in the DataManager class.

**5.3.1 IServletState Interface**

This interface defines the methods and parameters used by the servlets
to determine state information and queries.

**5.4 Package calibDbData**

One of the specifications for JFreeChart is that the data to be plotted
be created by the class that implements the cewolf.DatasetProducer
interface.

**5.4.1 CalibDatasetProducer class**

This class implements the DatasetProducer interface. It acts as the data
source for the displayChart.jsp class.

**5.4.2 OracleConnetor class**

This class is responsible for initiating connection to the database once
the application is started.

**5.4.3 DataManager class**

This class is responsible for confirming the database connection,
getting the table rows and columns and responsible for terminating the
application.

**6 Java Servlet**

A servlet is a small pluggable extension to a server that enhances the
server's functionality. A servlet is a Java class and therefore needs to
be executed in a Java VM by a service we call a servlet engine. The
servlet engine loads the servlet class the first time the servlet is
requested, or optionally already when the servlet engine is started. The
servlet then stays loaded to handle multiple requests until it is
explicitly unloaded or the servlet engine is shut down. Servlets allow
developers to extend and customize any Java-enabled web application
server with a hitherto unknown degree of portability, flexibility, and
ease.

**7** **Java Server Pages**

A [server-side](http://www.pcwebopedia.com/TERM/J/server_side.html)
technology, Java Server Pages are an extension to the Java
[servlet](http://www.pcwebopedia.com/TERM/J/servlet.html) technology
that was developed by Sun. JSPs have dynamic scripting capability that
works in tandem with HTML code, separating the page logic from the
static elements \-- the actual design and display of the page \-- to
help make the HTML more functional. A JSP is translated into Java
servlet before being run; and it processes HTTP requests and generates
responses like any servlet. However, JSP technology provides a more
convenient way to code a servlet. Translation occurs the first time the
application is run. A JSP translator is triggered by the .jsp file name
extension in a URL. JSPs are fully interoperable with servlets. JSPs are
not restricted to any specific platform or server. It was originally
created as an alternative to Microsoft\'s
[ASPs](http://www.pcwebopedia.com/TERM/J/Active_Server_Pages.html) \--
Active Server Pages. Four jsp files were created for this project; three
of them were mostly used for displaying the database tables --
displayTable.jsp is responsible for displaying the database tables based
on the user input i.e. CAL, SMT, or CFT button, displayPlotTable.jsp
displays the corresponding table and set its next state to be ready for
plotting, and displayChart.jsp is the class that does the chart and
plotting. The displayTableChoice.jsp handles the user's table choice
i.e. it displays the table the user wants to view at a particular time.

**8 JFreechart**

The Servlet uses a free java class library for generating the charts
from the values returned by the database. JFreeChart currently supports
pie charts 2D and 3D, bar charts, line and area charts, scatter plots
and bubble charts, combination charts. For more information on
JFreeChart, please visit
[www.jfreechart.org/jfreechart/index.html](http://www.jfreechart.org/jfreechart/index.html)
. Figure 1 shows a sample chart generated by JFreeChart.

![](media/image1.png){width="6.879861111111111in"
height="4.789583333333334in"}

Figure 1 shows a sample page generated by JFreechart.

**9 Results**

This project involved enhancing the offline calibration database browser
and developing an online calibration database browser based on the
source codes from the offline database browser. Enhancements to the
offline database browser includes adding a new database that represents
the data obtained from the calorimeter detector to be able to access the
database by writing a few java classes and modifying some of the older
classes. Through this added feature, users will be able to expand their
view, interact with the data using charts and graphs, and analyze data
thoroughly. This particular database browser has also been tested on a
Linux machine which implies that this project is now a general-purpose
application that supports users of any type. Figures 2a and 2b shows the
initial and the newer version of the offline calibration database
browse. The offline database browser has also been configured to work on
a Linux machine which makes it general purpose. Figure 3 shows the
offline calibration database browser running on a Linux server.

Figure 4 illustrates the new online calibration database browser. Figure
5 illustrates a calorimeter table for the "CAL" detector data. This
table contains over fifty thousand rows of data.

![](media/image2.png){width="6.378472222222222in"
height="4.604166666666667in"}

Figure 2a the initial version of the offline calibration database
without the CALID button active.

![](media/image3.png){width="5.9944444444444445in" height="4.34375in"}

Figure 2b illustrates the new version of the offline calibration browser
with the CALID button inactive.

![](media/image4.png){width="7.125in" height="5.1625in"}

Figure 3 -- illustrates the offline calibration database on a Linux
Server.

**10 Summary**

The ability to query a real time database and plot the results without
having to learn complex SQL commands has been one of the goals of this
project. I have added the calorimeter subsystem to the existing browser.
It is now possible to query the offline calibration database for all the
subsystems. The online calibration database browser has been implemented
based on the same technology.

**11 Acknowledgements**

I would like to thank my supervisor Taka Yasuda for his undivided
assistance during the course of completing this project. Thanks also go
to Cosmore Sylvester who provided me with help when I was having
problems; Geoff Savage, Stu Fess, Elizabeth Gallas for their help during
the absence of my supervisor, and also Henry Barnor for his help from
the beginning of this project till the end. Finally, I would like to
thank Dianne Engram, Dr. McCroy and Dr. Davenport and all the members of
the SIST committee for giving me the opportunity to participate at Fermi
National Laboratory, Summer Internships in Science and Technology.

References:

Hans Bergsten. Java Server Pages. O'Reilly & Associates, Inc.,
Sebastopol, second edition, 2002.

Jason Hunter and William Crawford. Java Servlet Programming. O'Reilly &
Associates, Inc., second edition, 2001.

Elizabeth Castro. HTML For the World Wide Web. Peachpit Press., Fourth
Edition, 2000.

**Figures**

![](media/image5.png){width="6.746527777777778in"
height="5.319444444444445in"}

Figure 4 shows the initial web page of the online calibration database
browser.

![](media/image6.png){width="6.873611111111111in"
height="5.103472222222222in"}

Figure 5 shows a typical calorimeter table for the online database.

[^1]: Calibration is the process of converting electrical signals into
    its physical form.