Introduction
To extract detector components from Oracle
Details:
Accessing detector components in Oracle
Accesing detector components in ROOT files
TPhDetCompHandler - general access class
Initialization of the user environment
Setting the run number information
Deciding on the type of the source
Deciding on the mode of access
Unavailability of some methods to handle detector components
Current availability of detector components in Oracle
Current availability of detector components in ROOT files
The order in construction of the TPhDetector component objects
-----------------------------------------------------------------------
Detector components are objects describing the detector setup and its current properties. Depending on the type of processing performed in Phat, one or several of them needs first to be initialized before processing can be started.
Currently the following detector components exist:
The pointers to detector component objects are stored inside the singleton TPhDetector object. Using them is the primary way to access these objects from any place in Phat. After the component objects has been created they are stored permanently on a disk for future reference. In Phobos it has been decided to store detector structure and properties information in the remote Oracle database. As a backup secondary storage, ROOT files can be created to allow making calculations in Phat on computers without network connection or in case the Oracle database is down.
The following detector components can be found in the Oracle database.
Reading/writing of detector components to ROOT files can be done with a
help of functions that can be found in the TPhDetector class. The set of functions is
comprehensive enough to allow separate loading and saving of different components of the
detector. If no file paths are given, files will be read from/written to $PHATHOME/init
directory under some standard names and with standard key names.
In addition to the specific interfaces, a class named TPhDetCompHandler has been developed to make it easier for a user to collect all information of various detector components from different places according to the user defined environment stored in a single definition file.
In the following I will describe use of the TPhDetCompHandler interface functions. In the future, calls to this class may be isolated into a separate initialization module.
First element used by this class is a central environment setting macro. It is stored
in $PHATHOME/init directory in file called Phat_env.C. In this macro some global
variables, like "PHATHOME", "ORACLE_HOME", remote Oracle server name
("phdb"), global name of the remote directory where root files will be stored,
("RemoteRootFileDirectory") can be (re)defined as well as the names and paths of
all the specific detector component elements. If they are not defined in this file then
some defaults are used. The defaults are also described in the Phat_env.C file provided
together with Phat distribution. When the object of this class is created, the Phat_env.C
is executed and user environment is setup. It is possible later to change some or all of
the settings by calling one more time the initialization function with a different file
name, like:
det_comp->InitPhatEnvironment("envfilepath");
Before program can look for the run specific components, the run number must be set in the
TPhDetCompHandler object:There are three places where the detector components can be handled using this class:
Parallel to the three different places, there are three types of functions used to access information. For example to readin electronic map of sensor pad connections one can call:
Similarly there are three types of functions that store information on detector components into three different places.
In addition to functions accessing info in specific way, there is also a set of general functions, one for each type of the detector component, that allows to read from the currently available source, as defined in the Phat_env.C file and according to the way the additonal switch called SearchMode is set in the class.
The later two modes behave according to their name meaning. The first, auto-switch mode, detects status of the availability of Oracle in Phat and goes either to Oracle or to the ROOT files directory for the detector component information, with the preference to Oracle. In the future it is planned that failure to access Oracle database will also result in switching to ROOT file source.
Use of these general functions is simple. First one sets the mode, by calling:
This could be done once, at the beginning of the macro. Later calls
to read/write detector information can be issued for the given run number. After changing
run number, detector components for a new run will be retrieved.
There are interfaces in Phat that make it possible to write/read to/from both types of storage, however Oracle database can now provide only the map of electronics connections to sensor pads, pedestals, and gain calibration. In TPhDetCompHandler all function are implemented for future compatibility, however those that have no underlying Oracle implementation will return a warning instead of the object info. These methods are:
As of 11/29/99:
As of 11/29/99:
Some of the components can not be installed before some others has not been constructed yet. Also checking the compatibility between some components is not yet in a final shape and may work better if the correct order of initialization is kept. The recommended way to build detector components is to:
In your macro, or at Phat prompt you may include a call to a detector initializing macro.
andrzej.olszewski@ifj.edu.pl