The DM itself is a pure interface, meaning it is unable to do anything by itself. Functionality is added through DM plugins (at runtime). The basic mode of operation, from the ROOT prompt, is the following :
// One must load the relevant plugin(s) gSystem->Load("libemcOMpg.so"); // The single entry point to DM world : the DM singleton emcDataManage* dm = emcDataManager::GetInstance(); // The object you want to read/write from/to a data source // It has to derive from emcManageable class. Object o; // Select the data source o.SetSource(emcManageable::kDB_Pg); // The object might be time-dependent, // so we choose a time to fetch it // (should be a runnumber, really) PHTimeStamp now; // Now gently ask the DM to retrieve it... bool ok = dm->Read(o,now); // ...or to store it o.SetDestination(emcManageable::kDB_Pg); ok = dm->Write(); // // See the list of available plugins dm->ls();
In the above code, the DM is just a "triage" center : it will decide, based upon the actual type of the object and its data source, which one of its plugins is able to handle it, and will forward the request (read or write) to that plugin. If no plugin is available, DM will fail.
Currently, the plugins are available in two separated librairies :
offline/package/emc-calib/DataManager
, while the plugins are in offline/packages/emc-calib/DataManager_plugins
Modules | |
DM ASCII Files Format | |
The functions involved in reading/writing objects from/to ASCII files using the datamanager. | |
DataManager Plugins | |
The DataManager plugins, for various objects and various data sources. | |
Classes | |
class | emcDataManager |
(Singleton) Handles read/write of EMCAL objects to/from DB/ASCII files. More... | |
class | emcManageable |
(ABC) Object that can be passed to the emcDataManager to be read/written from/to files/database(s). More... | |
class | emcObjectManager |
(ABC) An object manager is an emcDataManager plug-in. More... | |
class | emcObjectManagerRegister |
(Singleton) Registry to keep track of all the DataManager plug-ins. More... |