GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BrowserDB.C
Go to the documentation of this file.
1 
36 void BrowserDB(const char *hname)
37 {
38  TH1 *histo;
39 
40  if ( gSystem->Load("libGWTOOLS.so") < 0 )
41  { cout << "libGWTOOLS.so is needed to display " << hname << endl; return; }
42 
43  Gw::HistoDB hdb; TString t = hname;
44 
45  if (t.EndsWith(".s")) { // here the action for gpsi .. could be changed to THstack
46  t.Prepend("gpsi:"); hdb.Open("tmp",t.Data()); hdb.ls();
47  }
48  if (t.EndsWith(".spe")) { // here the action for radware spectra
49  // open a HistoDB system
50  t = "rad:"; t += gSystem->WorkingDirectory(); hdb.Open("tmp",t.Data());
51 
52  // read the spectrum and display it
53  TH1 *h=new TH1F(); h->SetName(hname); hdb >> (*h); if (h) { h->Draw(); gPad->Update(); }
54  }
55  if (t.EndsWith(".eg")) { // here the action for midas spectra
56  // open a HistoDB system
57  t = "eg:"; t += gSystem->WorkingDirectory(); hdb.Open("tmp",t.Data());
58 
59  // read the spectrum and display it
60  histo = hdb.Get(hname); if (histo) { histo->Draw(); gPad->Update(); }
61  }
62 }
virtual void ls(Option_t *opt="cdb")
to list the current configuration
Definition: HistoDB.cpp:172
void BrowserDB(const char *hname)
Definition: BrowserDB.C:36
virtual HistoConverter * Open(const char *, const char *)
to open a new DB service
Definition: HistoDB.cpp:93
TH1F * histo[MaxValue]
Definition: ReadDaqAlone.C:31
ADF::LogMessage & endl(ADF::LogMessage &log)
Service to read/write ROOT histograms from/to different DB systems.
Definition: HistoDB.h:90
virtual TH1 * Get(int i)
to get histo number i of the current DB
Definition: HistoDB.cpp:213