Service to read/write ROOT histograms from/to different DB systems. More...
#include <HistoDB.h>
Public Types | |
enum | EStatus { kGood, kFail } |
Public Member Functions | |
void | AddFileExt (const char *type, const char *ext) |
add file extension More... | |
void | AddOption (const char *type, Option_t *opt, const char *mode="reset") |
add option More... | |
ClassDef (HistoDB, 0) | |
rootcint dictionary More... | |
virtual TH1 * | Get (int i) |
to get histo number i of the current DB More... | |
virtual TH1 * | Get (const char *name) |
to get an histo by its name More... | |
int | GetVerboseLevel () |
HistoDB () | |
virtual bool | IsStatus (HistoDB::EStatus status) |
to get the current status flag for the HistoDB stream More... | |
virtual void | ls (Option_t *opt="cdb") |
to list the current configuration More... | |
void | MakeConverter (const char *classname) const |
Use it if you want to extend the DB types handled. More... | |
virtual HistoConverter * | Open (const char *, const char *) |
to open a new DB service More... | |
virtual HistoDB & | operator<< (const TH1 &) |
to write an histogram in the current Histo DB service More... | |
virtual HistoDB & | operator<< (const TH2 &) |
to write a matrix in the current Histo DB service More... | |
virtual HistoDB & | operator<< (const char *name) |
to change the current DB service More... | |
virtual HistoDB & | operator<< (const THStack &) |
to write several histograms in the current Histo DB service More... | |
virtual HistoDB & | operator>> (TH1 &) |
to read an histogram from the current Histo DB service More... | |
virtual HistoDB & | operator>> (TH2 &) |
to read a matrix from the current Histo DB service More... | |
virtual HistoDB & | operator>> (THStack &) |
to read several histograms from the current Histo DB service More... | |
virtual void | SetCurrent (const char *) |
change the current service. It uses the alias defined in open More... | |
virtual void | SetMode (Option_t *) |
to change the mode (overwrite/version) of the current DB service More... | |
virtual void | SetMode (const char *, Option_t *) |
to change the mode (overwrite/version) of one of the DB service More... | |
virtual void | SetStatus (HistoDB::EStatus status=kGood) |
modify the status flag for the HistoDB stream More... | |
void | SetVerboseLevel (const int) |
virtual bool | Write (const TH1 &) |
to write a TH1 histogram in the current Histo DB service More... | |
virtual bool | Write (const TH2 &) |
to write a TH2 histogram in the current Histo DB service More... | |
virtual | ~HistoDB () |
Protected Attributes | |
int | fStatus |
Service to read/write ROOT histograms from/to different DB systems.
This class is an interface to help reading/writing/converting ROOT histograms from/to other existing or future way to store spectra.
The interface is design as a growing system to help adding new DB types without having to recompile HistoDB. If you want to add your own new format, you will have to write a new class that inherits from HistoConverter. To help you in this task, HistoDB provides the method MakeConverter that built for you the basic and needed structure of the new class. This class inherits from HistoConverter. DO NOT DELETE anything from this file.
Current supported convertion format are:
If you want to add your own format, see RADConverter as a example.
Some way to use this interface (see also DemoHistoDB.C):
TH1F h; HistoDB hdb; hdb.Open("in","gpsi:/where/i/have/my/spectra.s"); hdb.Open("out","rad:/where/i/want/to/convert");
check out that they are both open. hdb.ls("all");
h.SetName("the_name_of_the_specrum_i_want_to_convert"); hdb << "in" >> h << "out" << h; // to read a gpsi spectrum and convert it into a rad format