TOF calibration

From: Djamel Ouerdane (ouerdane@nbi.dk)
Date: Tue Dec 12 2000 - 19:27:42 EST

  • Next message: Flemming Videbaek: "Re: TOF calibration"

    Dear brahms-dev-listers,
    
    I have spent quite some time in writing a calibration package software for
    the TOF detectors and it's getting quite stable so that I wish to propose
    this package to the collaboration. Before committing anything, here's a
    description of its content and how to use it:
    
    Classes:
    -------
     TOF specific classes:
       BrCalibrationParamsTOF   -> deals with calibration parameters
       BrTOFCalibrationPackage  -> container for calibration modules
       BrTOFPedestalModule      -> module for evaluating pedestals
       BrTOFAdcModule           -> idem for ADC gain
       BrTOFTdcModule           -> idem for TDC gain and slewing correction
    
     Other classes:
       BrDataHandler            -> handles ALL types of data 
                       (raw sequences, root sequences, particular root files)
                                -> handles data files accordingly
    	                    -> initiates the main loop over events
                                -> can contain modules, module containers
        (this class should be renamed and derive from BrMainModule)
    
    Programs:
    --------
     Calibrate                  -> main application to calibrate a run
     ReadDbTOF                  -> read params in database for checking
    
    other stuff
     SortTrigger                -> produces files according to given
                                   triggers
    
     The latter is not necessary but I find it useful
    
    ---------------------------------------------------------------------
    
    The main application Calibrate is very easy to use:
    
    you edit an ascii file with options, e.g options.txt:
    
      -r 2535
      -i ~/Disk6/ekman/Reduced/run002535red_seq0-30.root
      -H test.root
      -p test.par
      -c tdc
      -n 30000
      -l tof1
      -g Rana2535.geo
      -m Rana2535.mag
      -v
    
    and you just type: Calibrate -opt options.txt
    
    To know which options you can use, type Calibrate -h or --help
    Here's the help you have:
    
    Calibrate options:
     -opt <option file>     no default, file with all your options
     -h --help              this help
    
    options to put in option file: 
     -c <calibration type>  no default, should only be pedestal, adc or tdc
     -C                     default is false, commit to database
     -CF                    default is false, commit to DB but from ascii file
                            produced by Calibrate
     -d <data directory>    default is /nfs/hehi/hehi21/hehi/DATA
     -f                     default is false,  calibration from histo file
                            produced by Calibrate
     -g <geo file>          no default
     -H <histo file>        no default, histo file for saving histos
     -i <root file>         no defaultroot input files, can put many "-i file"
     -l <detector list>     no default, detector names. Don't forget quotes if
                            more than one with space inbetween e.g 'tof1 tof2'
     -m <mag file>          no default
     -n <events>            default is 0, number of events to analyze
     -p <parameter file>    no default, parameter file produced or read by
     -r <run number>        default is 0, always give a number!
     -s <SQL server name>   default is hilux12.ni.dk
     -t <trigger>           default is 0
     -u <SQL username>      default is user_test
     -v                     default is false, verbosity
     --dbase <DB base name> default is Brahms
     --raw                  default is false, analyzing raw sequences
     --root                 default is false, analyzing root sequences
    
    
    
    You see that you can choose not to commit directly parameters to the DB.
    You can do it from the ascii file that is always produced with your
    parameters, it means that you can check them before.
    
    You can also perform a new calibration (histo fitting basically) without
    rereading the events since Calibrate always creates a file with histograms
    the first time you read data events. This file is used instead of
    rescanning the data files.
    
    If you put some options that are contradictory with some others, you'll
    have an error message (I've tried to think about the easiest errors
    someone could do). 
    
    Note also that you can specify the SQL server, the SQL user name and the
    DB base name if you work with a special DB on some server of yours.
    ---------------------------------------------------------------------
    
    The program ReadDbTOF has also some some options:
       -s  <SQL server name>   default is hilux12.ni.dk
       -db <DB base name>      default is Brahms
       -u  <SQL username>      default is user_test
       -r  <run numer> 
       -c  <calib type>        can be pedestal, adc, tdc
       -l  <tof list>          any of the 3 tof detectors
       -h                      this help 
    
    It will ouput all parameters already stored in the DB for a given run
    (means that the timestamp of a parameter revision should correspond to the
    starttime of a run, otherwise...well, it depends of the policy of your
    revision, cf. DB documentation
    
     http://www.rhic.bnl.gov/brahms/WWW/private/database/index.html  )
     
    ---------------------------------------------------------------------
    
    I'm writing a HOWTO with a lot more details and results.
    
    
    As I think it is important to have it very soon, I wish to have a reply
    with 24 hours (+ 6 for USA :)
    If you would like to try it (but also reporting bugs or improve it) or if
    you don't reply, then I'll commit into brahms_app under the directory
    do_app/
    
    
    Ciao.
    Djam
    
    
    :o) ****************************************************** )o:
    |ME	: Djamel Ouerdane   EMAIL  : ouerdane@nbi.dk         |
    |OFFICE : Tb1 @ NBI	    PHONE  : +45 353 252 69 (office) |
    |INST   : Niels Bohr Institute,                              | 
    |         Blegdamsvej 17, 2100 København Ø, Danmark          |
    :oD ****************************************************** \o:
    



    This archive was generated by hypermail 2b29 : Tue Dec 12 2000 - 19:28:55 EST