Re: BrRun object

From: Konstantin Olchanski (olchansk@ux1.phy.bnl.gov)
Date: Wed Aug 16 2000 - 13:32:11 EDT

  • Next message: Trine Tveter: "Vertexing"

    On Wed, Aug 16, 2000 at 08:47:39AM -0500, hagel@comp.tamu.edu wrote:
    > Ahhh, But this is what I mentioned in the wonderful DB framework Christian
    > came up with and I mentioned in a reply to Anders in which things are
    > transparent.  There is really no KO world and BrDb world.  At least to the
    > user, these are unified.
    > 
    > To answer your question.  One connects to the BrahmsMain db and there is an
    > entry in there which points to the RUNDB.  That is how all the BRAHMS Db's
    > even in the "BrDb world"  Then when one does mainDb->ConnectToRun(passwd) is
    > the real SQL connection made to RUNDB on pii3 (or wherever we decide to move
    > it)  So the data in BrRun come directly from RUNDB
    
    
    This sounds reasonable.
    
    
    K.O.
    
    
    > 
    > Kris
    > 
    > Konstantin Olchanski wrote:
    > 
    > > On Tue, Aug 15, 2000 at 05:35:03PM -0500, hagel@comp.tamu.edu wrote:
    > > > Hello,
    > > > The BrRun object has been enhanced to conform to the BRAHMS DB
    > > > convention (almost).  Externally, there is no change to BrRun.  It is
    > > > still basically a data structure which contains all of the information
    > > > about a given run which is extracted from the BRAHMS RUNDB.
    > >
    > > I must be missing something- presumably you extract the run information
    > > from the RUNDB database created by the DAQ, but in the example below
    > > you connect to the BrahmsMain database? So where do you get the run data
    > > from?
    > >
    > > K.O.
    > >
    > > > The interface to extract this information has changed slightly and is
    > > > now consistent with other BRAHMS Db access in BRAT.  Here are
    > > > instructions for accessing a run.  Also see ROOT HTML documentation in
    > > > the code.
    > > >
    > > > //First, connect to the db and then to the rundb using following two
    > > > lines:
    > > > BrMainDb *mainDb = new BrMainDb("query", passwd,"pii3...","BrahmsMain")
    > > > BrRunsDb *runDb = mainDb->ConnectToDB(passwd);
    > > >
    > > > //Then get an instance of a BrRun for a single run (ie run 1554) using
    > > > eg
    > > > BrRun *run = runDb->GetRun("RunNo = 1554");
    > > >
    > > > //Or, get a list of runs in a time range
    > > > Char_t query[64];
    > > > TDatime time1(2000,6,27,0,0,0);
    > > > TDatime time2(2000,6,28,0,0,0);
    > > > sprintf(query,"StartTime > %d and EndTime <
    > > > %d",time1.Convert(),time2.Convert());
    > > > TObjArray *runList = runDb->GetXRun(query);
    > > > //Then dig the runs out of runList in the typical way of digging things
    > > > out of TObjArray's
    > > >
    > > > Of course, direct any comments to me.
    > > >
    > > > Enjoy.
    > > >
    > > > Kris
    > > >
    > > >
    > > >
    > >
    > > --
    > > Konstantin Olchanski
    > > Physics Department, Brookhaven National Laboratory, Long Island, New York
    > > olchansk@bnl.gov
    > 
    
    -- 
    Konstantin Olchanski
    Physics Department, Brookhaven National Laboratory, Long Island, New York
    olchansk@bnl.gov
    



    This archive was generated by hypermail 2b29 : Wed Aug 16 2000 - 13:33:50 EDT