Files
geant4/examples/extended/E02
2016-06-08 15:09:25 +02:00
..
2016-06-08 15:09:25 +02:00
2016-06-08 15:09:25 +02:00
2016-06-08 15:09:25 +02:00
2016-06-01 15:25:35 +02:00
2016-06-01 15:25:35 +02:00
2016-06-08 15:09:25 +02:00
2016-06-08 15:09:25 +02:00
2016-06-08 15:09:25 +02:00
2016-06-08 15:09:25 +02:00

$Id: README,v 1.2 1999/04/29 09:04:55 morita Exp $
-------------------------------------------------------------------

     =========================================================
     Geant4 - an Object-Oriented Toolkit for Simulation in HEP
     =========================================================

                           Example E02
                           -----------

This program demonstrates how user can use object database using 
HepODBMS interface.  Please contact your local system manager for
the avaiability of HepODBMS and Objectivity/DB.

To use HepODBMS and underlying Objectivity/DB package, user needs
a deep knowledge of the object database and environmental set
procedures.  The code is provided here to give just a brief idea
of using the persistency in Geant4.

How to build:

- Setup:

In addition to the standard Geant4 setup, additional setup for
HepODBMS, Objectivity/DB and federated database should be defined.

For CERN AFS users, an example setup script "g4odbms_setup.csh" is
provided in this directory.  Put a line such as

source ${G4INSTALL}/examples/extended/E02/g4odbms_setup.csh

in your .cshrc file, where ${G4INSTALL} is the actual location of
the Geant4 package.

- Objectivity/DB boot file and lock server

Boot file is a set of configuration file and baseline federated database 
file which contain database schema information of some basic
HepODBMS and Objectivity/DB classes.  Each time you compile your
own persistent-capable class, a schema is compiled into your 
local copy of federeated database.

When creating a persistency library of Geant4, Geant4-specific persistent
classes will be compiled into your local copy of the boot file.

Default location of the Geant4 boot file is $HOME/G4EXAMPLE.
You may want to change the definition of this temporary boot
file in your .cshrc.

example: 
  setenv G4EXAMPLE_BOOT_DIR   ${HOME}/tmp/G4EXAMPLE
  setenv G4EXAMPLE_BOOT       ${G4EXAMPLE_BOOT_DIR}/G4EXAMPLE

For each boot file, you must have unique federated database ID (FDID).
This number can be obtained from your local manager of Objectivity
lock server.  Define G4EXAMPLE_FDID in your .cshrc.

example:
  setenv G4EXAMPLE_FDID 501

To compile the schema and to build the library, you also need an
access to Objectivity/DB lock server.  For the CERN AFS users, see 
the notes below, for other systems, contact your local system manager 
for the lock server configuration.

Then type,

  gmake cleandb

to create your local copy of Geant4 boot file.
___________________________________________________________________________
Note: On CERN AFS, contact your group system administrator to obtain access
      to your group lock server.  If you want to run this example on your 
      own, you must run your own lock server process on the same machine as
      you run the executable program, due to a technical limitation on AFS
      and Objectivity.

      To start your own lock server process,

         oocheckls -notitle `hostname` || \
           oolockserver -notitle -noauto `hostname`::${G4EXAMPLE_BOOT}

      Then check the process with

         ps -ef | grep ools
         ....
         <user>  60156      1   0 06:36:40 pts/15  0:00 ools -OO_NO_AUTOREC
         ....

      When you finish running this example, don't forget to kill
      the lock server process by yourself.

         ookillls
      or
         kill -9 <pid_of_ools>

      You must have AFS ACL access to HepODBMS and Objectivity/DB
      directories.

      At CERN, the FDID allocation table is given in this URL:

      http://wwwinfo.cern.ch/asd/rd45/white-papers/9804/FDIDAllocation.html
___________________________________________________________________________

- libG4persistency.a

Persistency in Geant4 is provided as a separate sub category.
Geant4 installer must explictly go to ${G4INSTALL}/source/persistency
directory and type

  cd ...where Geant4 is installed...
  cd source/persistency
  gmake cleandb
  gmake 
  gmake global

to create libG4persistency.a.  This process will also produce a base
schema file in the directory $(G4INSTALL)/schema/.

- exampleE02 executable

exampleE02 executable can be made by simply typing "gmake" in this directory.

Current example of Geant4 persistency requires the executable to be
run as the same directory as your local federated database.
Use exampleE02run csh-script for simple test.

example:
   gmake cleandb    # see above
   gmake            # creates exampleE02 executable
   exampleE02run        # run exampleE02

- Persistent output

When exampleE02 is run correctly, following database files will be created
in your federated database directory.

Events.G4EXAMPLE.DB    G4EXAMPLE.FDDB         System.G4EXAMPLE.DB
G4EXAMPLE              Geometry.G4EXAMPLE.DB

To browse the contents, use "ootoolmgr".

  cd ...your federated database directory...
  setenv DISPLAY <your_x_terminal>:0.0
  ootoolmgr -notitle G4EXAMPLE &

Make sure to terminate ootoolmgr when you finish browsing.
Otherwise lockserver will remember the browsing by ootoolmgr as 
a "transaction", and the further updates to the database will be blocked.

--