|
//////////////////////////////////////////////////////////// // // BrRunsDb is a Db class which manages BrRun's with information // extracted from the BRAHMS run database. It connects to the // BRAHMS run database via the TSQLServer. There are several // ways for runs to be selected. A single run can be selected // using BrRunsDb::SelectRun(irun) where irun is the run to be // selected. Another way to select a group of runs is to use // BrRunsDb::SelectRuns(time1,time2) where time1,2 are TDatime // objects specifying time intervals for a list of runs to be // selected. // // To get the runs, use BrRunsDb::GetRun(isel) which returns // a BrRun object which was built in the SelectRun or SelectRuns // methods. // // Example: // BrRunsDb *runDb = new BrRunsDb("mysql://pii3.brahms.bnl.gov/RUNDB", // "query","query-only"); // BrDbRun *run = runDb->GetRun("1554"); // // run now contains all of the information in the run DB // extracted from run 1554. // // Alternatively, one can use: // TDatime time1(2000,6,27,0,0,0); // TDatime time2(2000,6,28,0,0,0); // TObjArray *runList = runDb->SelectRuns(Form("StartTime > %d and EndTime < %d",time1.Convert(),time2.Convert())); //select all runs of 6/27/00 // // Then to use them, use: // Int_t numruns = runList->GetEntries(); // for(isel=0;isel<numruns;isel++) { // BrRun *run = (BrRun*)runList->At(isel); // . // . // . // process this run // . // . // . // } // //////////////////////////////////////////////////////////// // $Id: BrRunsDb.cxx,v 1.2 2001/10/08 11:02:42 cholm Exp $ // $Author: cholm $ // $Date: 2001/10/08 11:02:42 $ // $Copyright: 2000 Brahms Collaboration #ifndef __FSTREAM__ #include <fstream> #endif #ifndef ROOT_TDatime #include "TDatime.h" #endif #ifndef BRAT_BrRunsDb #include "BrRunsDb.h" #endif #ifndef BRAT_BrException #include "BrException.h" #endif #ifndef BRAT_BrRdbmRunsDb #include "BrRdbmRunsDb.h" #endif #ifndef __CSTDLIB__ #include <cstdlib> #endif #ifndef __IOSTREAM__ #include <iostream> #endif //____________________________________________________________________ ClassImp(BrRunsDb); //____________________________________________________________________ BrRunsDb* BrRunsDb::fgInstance = 0; //____________________________________________________________________ BrRunsDb::BrRunsDb() { // Normal constructor. Singleton. } //____________________________________________________________________ BrRunsDb::~BrRunsDb() { // Empty DTOR } //____________________________________________________________________ BrRunsDb* BrRunsDb::Instance(void) { if (!fgInstance) fgInstance = new BrRdbmRunsDb("","RUNDB"); return fgInstance; } // EOF |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|