Gaudi and Calibration Infrastructure |
To start (and perhaps forever), will just be providing integration of read services with standard Gaudi facilities. It will be possible for a Gaudi application to create persistent calibration data by invoking services of the calibUtil package, but not by building an object in the TDS (more specifically TCDS, Transient Calibration Data Store), then invoking an (output) converter.
The persistent representation of calibration data will always consist of at least two pieces: the metadata, stored in the MySQL database, and the bulk data. This is not quite in line with the Gaudi behavior of a typical (i.e., event data) TDS object.
Calibration data will be made available for read access according to usual Gaudi practice for TDS data, except that, invisible to the client, any conversions which occur will take two stages, one for the metadata and a second for the bulk data:
For more internals of this process
Q: How does information get back to the data service that the data is now available? A: It's all part of one long call chain, so data will be there, if it exists to be converted, when the original request to the Provider completes.
Initialization |
Back to top |
Probably will need to add a line to job options analagous to the one now in basicOptions.txt concerning event persistence:
EventPersistencySvc.CnvServices = {"EventCnvSvc"};
e.g.
DetectorPersistencySvc.CnvServices = {"CalibCnvSvc"};
See also FluxSvc defaultOptions.txt for a model of job options stuff that may be required.
The Players |
Back to top |
| Item | Notes, description | Status | Relevant Gaudi code |
|---|---|---|---|
| Data Service Provider (CalibDataSvc) |
Satisfies IDataProviderSvc, IDetDataSvc and IInstrumentName (at least). Inherits from DataSvc. Value added includes registering addresses in TCDS at initialize() time. | Draft debugged. | IDataProviderSvc.h IDetDataSvc DetDataSvc.h DetDataSvc.cpp DataSvc.h DataSvc.cpp |
| IInstrumentName | Simple interface, similar to IDetDataSvc except the latter keeps track of event time and this class keeps track of (event) instrument, making it easily accessible to other cooperating classes. | Debugged. | |
| Persistency Service (DetPersistencySvc) |
One per data provider | Provided by Gaudi | IPersistencySvc.h PersistencySvc.h PersistencySvc.cpp DetPersistencySvc.h DetPersistencySvc.cpp IAddressCreator.h |
| Front-line Conversion Service for calibration data (CalibMySQLSvc) | Derived from ConversionSvc, so satisfies IConversionSvc. Also satisfies ICalibMetaCnvSvc interface. This is the conversion service called initially when calibration data must be fetched from its persistent form. It searches the metadata database for the best-match calibration dataset, then uses information in the metadata belonging to the dataset to form a request to another conversion service to read that dataset and use it to create or update the requested TCDS object. with persistent format of either XML or ROOT because in both cases the interaction starts with the MySQL metadata database. Acts as a manager which matches up calibration data types with the appropriate converter. | Draft debugged | IConversionSvc.h ConversionSvc.h ConversionSvc.cpp |
| Metadata-specific Interface (ICalibMetaCnvSvc) |
Abstract analog of additional utilities needed by a metadata conversion service. | Debugged | |
| XML Conversion Service CalibXmlCnvSvc |
Conversion service for calibrations whose bulk data format is XML. Also supplies certain services commonly needed by its converters, such as access to XML parser via ICalibXMLSvc interface. | First draft debugged | Same as for CalibMySQLCnvSvc above. |
| XML-specific Interface (ICalibXmlSvc) |
Abstract analog of additional utilities needed by an XML conversion service. | Draft debugged | |
| ROOT Conversion Service CalibROOTCnvSvc |
Conversion service for calibrations whose bulk data format is ROOT. May also supply certain services commonly needed by its converters. | To be written | Same as for CalibMySQLCnvSvc above. |
| Converter base class(es) (XmlBaseCnv; may have analogous base class for ROOT converters) |
Inherit from Converter. Handle physical format specific parts of conversion. | Draft of XmlBaseCnv debugged | Converter.h Converter.cpp |
| Converters | Need one for each calibration type to be stored in TCDS. Must satisfy IConverter. | Toy XmlTest1Cnv and non-toy XmlBadStripsCnv debugged; no ROOT examples yet. | IConverter.h Converter.h Converter.cpp |
| TCDS base class (CalibBase) |
Implements IValidity and additional methods facilitating updates. | Debugged | See links below for TCDS classes |
TCDS classes
|
Derived from CalibBase, which is in turn derived from DataObject. There will be one TCDS class per calibration type as viewed by recon and analysis applications. For the time being (perhaps forever), there will be one such class for each calibration procedure, so objects in the TCDS will correspond directly to a single calibration data set. | Toy CalibTest1 and approximately realistic BadStrips TCDS classes written and debugged. Plenty more to go. | IValidity.h DataObject.h DataObject.cpp |
| Opaque Address | Satisfies IOpaqueAddress. Need just one such class; let's hope the GaudiKernel-supplied class GenericAddress (which isn't really all that generic) will do. | Using GenericAddress, supplied by Gaudi. | IOpaqueAddress.h GenericAddress.h |
| CalibTime | Have to have something which implements ITime. This is it. Practically all the functionality needed already exists in facilities::Timestamp, but this class can't formally implement ITime because the facilities package can't use any Gaudi packages. CalibTime is derived from both facilities::Timestamp and ITime. | Draft debugged. | ITime.h |
TCDS data |
Back to top |
As in the Event TDS, TCDS data is organized in a hierarchical structure. There are only three levels in the hierarchy. The path for the root node is "/Calib". The next level adds a string which identifies the calibration type, such as "TKR_HotChan", and the last level is flavor ("vanilla" for all standard calibrations). All the information will be in the leaves and there will be no references to be resolved among DataObjects. Proposed organization leads to paths of the form /Calib/subsystem_calibrationType/flavor
Another possibility is to introduce another level for instrument type, but even in the unlikely case that a single job processed data from more than one instrument, the processing would be sequential; it should never be necessary to keep constants for multiple instruments in the TCDS simultaneously.
A "middle" node, like /Calib/TKR_HotChan, has a CalibCLIDNode associated with it, a stunted little thing derived from DataObject which keeps track of the CLID of all its leaf nodes (they all use the same one; flavor does not affect CLID). Not yet clear whether this serves any purpose.
All classes will be derived from CalibBase, itself derived from DataObject. CalibBase implements IValidity, as all calibration objects must. It also implements an additional method, getSerNo, so that clients can determine whether or not the object has been updated.
ROOT will be the format for bulk calibration data consisting largely of floating point numbers. XML will be used for tracker strip status bits, possibly for Cal and ACD status information as well.
The BadStrips class, used for both hot and dead strips, is a relatively complicated beast. It is not simply be a list of strips; this would be very verbose since each strip would have to have additional addressing information (tower, tray, Si plane within tray). Instead it embodies the physical hierarchy to some degree: BadStrips has nested classes defining a bad tower and a bad uniplane. A bad tower is either marked as entirely bad, or contains a collection of bad uniplanes. Each such uniplane is identified by tray, top-or-bottom and degree of badness (e.g., a the calibration procedure might distinguish between barely-hot strips and very hot strips). It may be marked as entirely bad, or may have a collection of bad strips marked as bad. At each level objects are only created if necessary; that is, there is no object to contain bad strips in tower 5 if tower 5 has no bad strips. This is efficient in terms of space and makes it relatively easy to fetch all bad strips within certain physical or logical units, but may make it difficult to use the information directly. Applications can, if they wish, copy it to a local cache in a form convenient for their use.
Currently BadStrips has just a couple query functions. The main, perhaps only, client, the Tracker Service, will use the BadStrips visitor interface to traverse the entire data structure. See page 4 of this set of slides for a diagram of all the collaborating entities.
Calorimeter calibration data should be much more regular (fixed amount of data per crystal, for example) so most the TDS class(es) will be in a form immediately useful to clients.
Package organization |
Back to top |
The TBW classes described above will live in two packages: CalibSvc and CalibData. CalibSvc contains the data service CalibDataSvc, the conversion services CalibMySQLCnv, CalibXMLCnv and CalibROOTCnv as well as related abstract interfaces such as ICalibMetaCnvSvc and the individual converters. CalibData will contain at least some, possibly all, TCDS classes and the model of the TCDS organization.
Done so far |
Back to top |
The first goal is to write, assemble and debug all the remaining pieces needed to exercise the full protocol, approximately
As of 16 Jan. this has all been checked out on both Linux and Windows
(see some output), at least for the
straightforward case involving no heavy-duty error handling.
A few more items have been checked off since:
Reasonable facsimile of hot and dead strips operational as of 30 Jan.
See output of the test program simpletest,
which includes output from algorithm
UseBadStrips
Done as of 6 Feburary.
Done as of 10 Feburary.
Gains and
pedestals implemented as of 27 Feburary.To do |
Back to top |
Additional work for a real functioning system includes
and so forth.
There are several calibration infrastructure policy decisions to be made. I have preferences in some cases, but these are all still open questions.
Depending on decisions made above, will need some or all of the following:
Last modified: