database developments

From: videbaek (videbaek@sgs1.hirg.bnl.gov)
Date: Wed May 10 2000 - 21:30:56 EDT

  • Next message: hagel@comp.tamu.edu: "Proposed change to BRAT LinkDef files"

    The following is an electronic record of Anders's presentation at the Friday Monthly Brahms meeting. I though this could be useful in addition to the other documents that exists i.e. the 'Analysis program structure' by AH and the 'Note by Christian Holm. I am also adding a set of notes on recent considerations and test we have done this week.
    
    
    
    PS not all of this does well on the 'inline e-mail' despite the non-desitability I attach a word document with the text (as well as a figure).
    
    1. BRAHMS DATA BASE
    
    What data to store?
    
    Data representation in DD?
    
    Data validity period?
    
    Data access Methods
    
    MySQL is fine
    
    MySQL C++ API (marginal documentation quality)
    
    MySQL C API (good)
    
    MySQL ROOT API( good, but adds only little)
    
    How to populate DB? Many Ways/Later
    
    Howto use DB? Look at program structure.
    
    Example:
    
    Calibration BB
    
    Stripped down BramReco
    
    2.Calibration BB parameters
    
    A partial set is.
    
          Name
         Value Type
         Stability
         Source
         
          Pedestal
         Float[44]
         Days
         pulser
         
          PedestalWidth
         Float[44]
         Days
         pulser
         
          LabGain
         Float[44]
         Indefinitely
         Lab data
         
          Time Gain
         Float[44}
         Year
         Special runs
         
          Delta time
         Float[44]
         Weeks
         Real data
         
    
    
    
    
    
    3. What calibrations to use
    
    
    
    
    
    There must always be a default.
    
    The must be types for different purposes
    
    It must be possible at any time to reproduce a given analysis
    
    Add new version never delete.
    
    
    
    --------------------------------------------------------------------------------
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    One open question is that of picking validity period;s
    
    Program Structure
    
    Define analysiscontainers
    
    Add modules to containers
    
    Define to session managers what runs to use
    
    Define to DatabaseManager what DBs to use
    
    Define to ParameterManagers parameter origin
    
    Do Init() on all containers.
    
    While(more runs)
    
    Do Begin() on analysis containers
    
    Get Input and outputeventIo's
    
    While(more Events)]
    
    Input->Event(event)
    
    Extract event nodes
    
    Call containers(nodes, nodes out)
    
    End
    
    End of All containers
    
    End
    
    Finish() on all containers.
    
    A bit more detail:
    
    Asp_rdo_global->Begin()
    
    BrModuleBB->Begin()
    
    CalibrateBB->Update()
    
    SessionManager->GetRun()
    
    For all parameters
    
    If !check validity then
    
    ParameterManager->GetParam(.)
    
    End
    
    ParameterModulesà ParameterElements (fv)
    
      a.. Shared by analysi modules
      b.. Stire parameter values
      c.. Store validitaion parameters
      d.. Methods to check and update
      e.. Methods to get individual parameter values.
    
    
    
    
    
    
    
    
    Since last Friday we (i.e. Christian and Flemming) has work to make some of these concepts into actual code:
    
    Session Manager Module ParameterManager ParameterElement
    
    |
    
    |-----------Init()----à |
    
    | |-----Register ParameterElement-à |
    
    | | |----------------new Param(if not there---|
    
    | | | |
    
    | | |ß --------------return pointer-------------
    
    | | ------return pointer to element -----|
    
    
    
    |----------Begin()--à |
    
    | |-------Update()------------------------------------------------------------|--GetDB()
    
    | | | if needed
    
    
    
    What was done to checkout this stuff was since the session manager is not needed to look at the interaction of ParameterElements and the Database. The parameter elements have the cached value of the actual DB. Since the Db classes of Christian in fact have a copy of the stuff in the database we decided that information held by the BrParameterElement is for each table (i.e. pedestal, pedestalwidth,.)
    
      a.. BrDbParameter (description of actual table)
      b.. BrDbRevision (actual data as well as validity , data period etc)
    Note ParameterElement is what AH named ParameterModule.
    
    The parameter element are thus very well suited to retrieve and hold data from the DB and use by analysis. This structure are not good at holding value not in DB and to create before storing (without additional thought). The classes made seem to do quite well in fulfilling most of the requirements setup in the previous section.
    
    The classes were tested together with the BrDb. classes and several problems identified and solved in calling programs as well as BrDb classes. We identified some unclarified issues in usage of validity periods, and decided to take a closer look in the enxt day or so. Remaining tests have to do with choice between different 'version type' e.g. 'standard' vs ' Ians private' etc.
    
    The BrDb classes are available in the CVS depository while the calling (preliminary) code is available for inspection in ~videbaek/root_app/calib
    
    
    Near term issues of which I hope the first two can be done this week.
    
      a.. Reaching consensus on most probable use of validity periods.
      b.. Testing of versioning types.
      c.. Further testing code, and BrParameterElement classes.
      d.. Sample code for usage of filling of calibration entries.
      e.. Definition of Parameter Manager
      f.. Definition of Session Manager
      g.. Establish plan for setting up DB , ensuring backup's, etc
    
    
    ------------------------------
    Flemming Videbaek
    Physics Department
    Brookhaven National Laboratory
    tlf: 631-344-4106
    fax: 631-344-1334 
    videbaek@bnl.gov
     
    
    
    
    
    
    



    This archive was generated by hypermail 2b29 : Wed May 10 2000 - 21:32:32 EDT