Re: access to db question

From: Stephen J. Sanders (ssanders@ku.edu)
Date: Wed Oct 24 2001 - 23:12:51 EDT

  • Next message: Djamel Ouerdane: "solution"

    Dear Djamel and Flemming,
    Thanks for the additional info...I was missing the maing Db stuff.
    However.... (running on rcas, I get the same response running at home
    with the brat current as of this afternoon):
    
     ********************************************
     *                                          *
     *       W E L C O M E  to  B R A T         *
     *             Version  2.00/38             *
     *                                          *
     * All Classes preloaded                    *
     * Library, Header and Script paths set     *
     *                                          *
     ********************************************
    
    brat [0] BrMainDb *mainDb = new BrMainDb::Instance()
    Error: Symbol BrMainDb::Instance is not defined in current scope  
    FILE:/tmp/fileudpOe8_cint LINE:1
    Error: type BrMainDb::Instance not defined FILE:/tmp/fileudpOe8_cint LINE:1
    *** Interpreter error recovered ***
    brat [1]
    
    
    Do I need to do something special before creating the BrMainDb instance?
    
    ...steve
    
    Djamel Ouerdane wrote:
    
    >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
    >
    >
    >
    



    This archive was generated by hypermail 2b30 : Wed Oct 24 2001 - 23:14:02 EDT