Re: access to db question

From: Djamel Ouerdane (ouerdane@nbi.dk)
Date: Wed Oct 24 2001 - 21:32:48 EDT

  • Next message: Stephen J. Sanders: "Re: access to db question"

    Steve,
    
    You need some more stuff than what Flemming told:
    in bratroot session you would do that:
    
    BrMainDb *mainDb= new BrMainDb::Instance()
    mainDb->SetUserName("query")
    mainDb->SetHostName("rcas0005.rcf.bnl.gov")
    mainDb->SetDbName("BrahmsMain");
    
    mainDb->Connect();  // very important!!
    mainDb->ConnectToCalib();
    mainDb->ConnectToRun();
    
    note that these methods return a boolean to check if you really connected 
    to these databases.
    
    then:
    
    
    BrCalibrationManager* calMan = BrCalibrationManager::Instance();
    
    then
    
    BrBbCalibration* bbl = (BrBbCalibration*)calMan->
                            Register("BrBbCalibration", "BBL");
    
    same for BBR
    
    the database makes a difference between BBL and BBR. So don't try to get 
    something with BB.
    
    This will work, I made it many times in a bratroot session this way
    to debug. 
    
    In order to visualize a revision, it's more complicated in a bratroot 
    session. For checking a BB calibration with a not so bad display, 
    use an application I wrote in brahms_app/do_app/db (BbDbBrowser)
    
    its usage is trivial:
    
    BbDbBrowser -r <run> -c <some calibration> -D <detector name>
    
    -c takes: pedestal, deltatdc, adcgain, tdcgain, slewing or all
    -D takes: BBL, BBR (upper or lower case). The default is both.
    
    Ciao
    Djam
    
    
    
    -- 
    Djamel Ouerdane ------------------------------------------o
    |  Niels Bohr Intstitute     |  Home:                     |
    |  Blegdamsvej 17, DK-2100 Ø |  Jagtvej 141 2D,           |
    |  Fax: +45 35 32 50 16      |  DK-2200 Copenhagen N      |
    |  Tel: +45 35 32 52 69      |  +45 35 86 19 74           |
    |                  http://www.nbi.dk/~ouerdane            |
    |                  ouerdane@nbi.dk                        |
    o---------------------------------------------------------o
    



    This archive was generated by hypermail 2b30 : Wed Oct 24 2001 - 21:33:21 EDT