Customized Servers for BaBar WIRED

If you just want to look at events from standard BaBar production databases using standard reconstruction, you will not generally need to run your own server. You can just access the production servers as described in the SLAC WIRED Home Page.

But if you want to look at a special database, or you want to run special reconstruction code, or you want to develop the server itself, follow these instructions to run your own BaBar WIRED server.

The instructions should work on any BaBar platform that has the BaBar-recommended TAO CORBA packages. They were specifically tested at SLAC on the Sun machines named shire and tersk and on the linux machines named noric. For these tests the recipe was copied exactly from this page (cutting and pasting into a command window, the only exception being that for the norics the string "SunOS58" was replaced by "Linux24").


Build the Server

These build instructions may appear daunting, but this is only because they cover several different cases. For the most common case, running the "out of the box" server for the new mini data in a recent code release, you need only do the following:

   newrel -t 12.5.2 hes1252
   cd hes1252
   srtpath 12.5.2 SunOS58
   setenv OO_FD_BOOT /nfs/objyboot1/objy/databases/test/boot/opr/V2/BaBar.BOOT
   addpkg workdir
   gmake workdir.setup
   cd workdir
   PARENT/bin/SunOS58/HesMiniApp PARENT/HepRepServer/HesMini_Run2.tcl firstevent '/groups/AllEvents/0002/2600/P11.10.1aV01fb/00022632/cb001/allevents 1'
Then skip to the instructions about the "ior" file.

Now for the more detailed build instructions:

You can build four different versions of the event display server application, depending on your display needs and what parts of the event data are available on disk.

Build the server as follows (making any substitutions that make sense to you, such as changing the database or trying some new reconstruction release):

To use objectivity

To run on an XTC file or the tricklestream

Create a new release as follows:
   newrel -t 13.5.0 hes-13.5.0
   cd hes-13.5.0
   srtpath 13.5.0 Linux24
   ambientboot
   addpkg L1DctData        oi-24Sept03
   addpkg L1DctDataP       ik-27aug03
   addpkg L1DctOep         oi-25Sept03
   addpkg L1DctOnline      gg-030926c
   addpkg L1TFMon          ik-22aug03
   addpkg L1TOepSequences  ik-22aug03
   addpkg PackageList      et-18june03
   addpkg L1SimUtils       et-18june03
   addpkg L1GltData        nb-061003
   addpkg L1DctEnv         oi-19June03
   addpkg L1DctConfig      oi-19June03_2
   addpkg DchL3TrackFinder V00-02-00
   addpkg BdbCondModules   V00-00-03
   addpkg DchDataCes       nb-220903
   addpkg EmcDataCes       nb-061003 
   addpkg TrgDataCes       nb-071003
   addpkg HepRepServer     nb-071003
   addpkg workdir
   gmake workdir.setup
To compile L1DctDataP and L1DctConfig, you need to set up a private federation. To do this,

Then compile and link:

   gmake include
   gmake lib
   gmake HepRepServer.bin

To run on a given XTC file, type (in workdir)

HesXtcApp -f  (your_favorite_xtc_file).xtc ../HepRepServer/HesXtc.tcl
Then skip to the instructions about the "ior" file.

More details

If you want to modify any of the existing HepRep data filler classes, look in the packages:

If you are using release 12.3.0 or later and want to run the standard Mini Server, there is no need to do a gmake. The server application is already included in the BaBar release.

To work in older releases, or if you want to make changes to some of the code, you will need to make the binary. To avoid making all four server binaries, don't do a simple "gmake" but instead do:

   gmake include
   gmake lib
   gmake HepRepServer.HesMiniApp
modifying the last line to specify the appropriate one of the four possible applications.

Don't worry if you see the following error message (it can be ignored):

   The environment variables TAO_ROOT and ACE_ROOT are not defined.
   TAO_IDL may not be able to locate orb.idl.

Run the Server

Set current directory to your workdir, run srtpath and set your OO bootfile, for example:
   cd hesanalysis14/workdir
   srtpath analysis-14 SunOS58
   simuboot

Then run the binary just like any BaBar binary. The first example below shows how to run a mini server right out of the box (for release 12.3.0 or later). The other examples show how to run from binaries that you make yourself.

   PARENT/bin/SunOS58/HesMiniApp PARENT/HepRepServer/HesMini_Run2.tcl
   or
   bin/SunOS58/HesMiniApp ../HepRepServer/HesMini_Run2.tcl
   or
   bin/SunOS58/HesBearApp ../HepRepServer/HesBear.tcl
   or
   bin/SunOS58/HesBetaApp ../HepRepServer/HesBeta.tcl
   or
   bin/SunOS58/HesOepApp ../HepRepServer/HesOep.tcl trickle_host bbr-farm20 trickle_port 10071

You can optionally also specify a default event. Your server will then immediately go to this event and will have this event ready in memory whenever a client first connects to it. To do this, just provide an extra argument to the binary, as follows:

   bin/SunOS58/HesMiniApp ../HepRepServer/HesMini_Run2.tcl firstevent '/groups/AllEvents/0002/2600/P11.10.1aV01fb/00022632/cb001/allevents 1'

To see exactly how the above instructions are executed for the production servers, study the command scripts in the Server Status Page.


The IOR File

When the server is ready, it will leave a small file in your current directory under the name "hepeventserver.ior". The WIRED client will need to read this file to figure out how to connect to your server (the file contains a special CORBA string called a "stringified ior").

You can either copy this file to the local file system of the machine where you will be running WIRED (and be sure to recopy it each time you restart your server), or you can reveal this file to your web server such that WIRED can read the file by a URL.

SLAC users can make the file available to the SLAC web server by making themselves a public_html directory (such as ~my_user_name/public_html), and then making a symbolic link from their public_html space to the hepeventserver.ior file. For example:

   ln -s my_server_directory/workdir/hepeventserver.ior ~my_user_name/public_html/.

Point the WIRED Client at your Server

Start WIRED as usual. Then from the Event Chooser, click on "Specify Server..." and enter either file specification or URL of your server's hepeventserver.ior file. For example:
   http://www.slac.stanford.edu/~perl/hepeventserver.ior
   or
   file://c:/mydirectory/hepeventserver.ior

Alternately, you can feed WIRED the hepeventserver.ior information at startup by using the "-server" option, as in:

   wired -exp babar -server http://www.slac.stanford.edu/~perl/hepeventserver.ior

That's all there is to it.

If you need to run whole pools of HepEventServers similar to the way the production servers are maintained at SLAC, use the JProcMan process management system. The individual server processes are exactly as explained above - JProcMan just takes responsibility for starting then, monitoring their health, telling the client code about them and saving their output.


Back to the SLAC WIRED Home Page

Joseph Perl

5 September 2002