The DMON's that pursue me

Common Stuff You Need To Know
  1. General DAQ material :
    1. Command line DAQ options for the dmons :
    2. -C
      Turn off the dependence on the state of the run (use it for all online monitoring at the present).
      -G<partition>
      Attach dmon to a global partition (online monitoring).
      -X
      Allows you to read the type of file used for common daq. If you don't use this on a common daq file, you get a stream of messages saying
      etb_findevt - Found next event after skipping 20 bytes.
      
      If you use -X on standalone files, you get
      Segmentation Fault - core dumped.
      
      -DST
      Allows you to read the type of file used for a data summary tape, the ARTE format. That's the theory anyways.
      -F<file name>
      Attach dmon to a file (offline analysis).
      -h
      Call the help routine. I make the information in these.
    3. You must attach a dmon to a valid data stream (file or partition) in order to get anything to work on it - except the help routine. Adding -h overrides any other options.
    4. There are now some general tools useful for looking at and getting the data.
      • Derrick : This program is used to view histograms sent through rhp. The easiest way to use it is to go to the DQM directory and type Derrick from the hbshift account.
      • hbstage_gui : This program is used to retrieve data from tape (/acs/data) and place it on a hard drive (/hb/stage) where the data can be analyzed. To launch this program, execute

        $HBROOT/DATAMGR/dev/l4stgui/hbstage_gui

        where HBROOT=/afs/desy.de/group/hera-b.

    5. Though there is no direct way to run through multiple files with a dmon, Vitaly and I discovered a procedure that let's us do it without taking up more space on the disk. Here are the generic steps to use it.
            mkfifo new_file
            cat file1 file2 [file3 ...] > new_file &
            dmon [-X] -Fnew_file
      
      The new_file is a special fifo file. The file only exists in temporary storage. It is terminated once the entire file is read by the dmon or the connection is broken. This file takes no space on the hard disk. However, if the size of the combined file exceeds the free disk space, cat will abort and leave a mess on your directory filling up all the free disk space with new_file. It can be difficult to remove this file. Because of this problem, I have created kumacs to combine the results from many of the histograms I make.
    6. All dmon processes appear under /OTHER/ in the name directory created by namdir. If you don't exit your dmon process normally, i.e. through the end and halt routines of the dmon process, the dmon name will remain in the name directory. Using Ctrl-C does cause the program to go through the end and halt routines. However, using the exit() function in C in a dmon does not. I do call exit() in some places in my dmons - mostly in error routines.
    7. All dmons have access to the Hera-B online libraries. These libraries include the dmon skeleton, event tool box, remote histogramming package, error logger, message handler, and state machine controller.
  2. Muon specific material :
    1. The top directory for my dmons is currently /hb/muon/daq99/dmons/. I have created a library of commonly used functions in lib/$BINTYPE/libMu.a.
    2. To make the executable program, type make in the program's directory. The executables are made in a sub-directory bin/$BINTYPE. What you're running in the program's directory is a shell script to run these executables. The currently supported bintypes are IRIX_mips4 (the hera-b), Solaris_sparc (the hb-sun's), and Linux_intel (the hb-cr's and hb-af's). To make the executable for a specific bintype, you must compile it on that machine.
    3. Many of my dmons called HBook, HiGZ, and HPlot routines from the CERN libraries. There is a bug on the hera-b that a value of 0 on a 1d-logy plot shows up as infinity. Also, to date, I have not been able to run the CERN libraries on Linux. All programs with the CERN libraries run fully on the hb-sun's. All programs not using the CERN libraries can be run on all platforms.
    4. The present configuration of the muon system can be found in information files in /hb/muon/daq99/info:

      Mu.fedconfig
      maps the crate configuration in the daq. Maps the fed name to the position in the readout, fed id, component id, sharc port, and cluster card. Normally, only the position in the readout or the fed id is needed.
      Mu.config
      maps fed and cable position to cable name.
      Mu.mask
      used to mask out bad channels in the readout. The mask files are usually created by my dmon mu_mask.
      Mu.bad
      used to mask out bad cables in the readout. The real purpose of this file is for use with mu_mask to automatically mask cables we know are bad. However, Mu.bad can be used with any dmon reading Mu.config.
      Mu.tdcconfig
      maps the cables connected to tdc output. It is also used in programs reading the tdc cables. It provides channel masking in the file. It is seperate from Mu.mask and Mu.bad.

      These files should be kept up-to-date. But that means if you want to look at older data, you may need a different configuration file. My programs first look in the current directory for the information files, Mu.fedconfig, Mu.config, and Mu.tdcconfig and then in the directory /hb/muon/daq99/info. You can put a changed configuration file in the local directory. The masking files Mu.mask and Mu.bad will only be used if they are in the local directory. It is not an error if they are not present.

<-------- back to the top -------->

Hits per Event          mu_hpe

  1. What it does :
    This dmon is used for plotting the numbers of hits in a given region that event has. It also contains error checking and filtering out of bad data by event. It uses HBOOK, HIGZ, and HPLOT to save the histogram file, draw the plots on the screen, and save them to a postscript file.
  2. Command line arguments :
    This dmon has a help screen which displays its command line options. I'll reprint the current (01.08.99) help screen here.
       -C -G<partition>  : read data from <partition>
       [-X] -F<filename> : read data from <filename>
     
       -dm       : map crates based on the first read event
       -efilter  : filter out events with bad data
     
       -section Mt3.1 Mp4.2-20+Mp4.2-21 Mt1.4-2 MU3 Mt1.B
                : show the hits per event for all cables matching each
                  string.  'U' and '.' are space wildcards.
                  'T' is for top (1,3,5). 'B' is for bottom (2,4,6).
                  Compares names to the length of the string name.
                  '+' will combine 2 names into one group.
       -layer, -super
                : display hits per event by layer or superlayer
       -occvsbx : display hits per event for certain cables per crate
                  as used in mu_occvsbx
       -side (+x|-x)
                : take only cables from the +x or -x side
     
       -fed 111 222 451
                : show the hits per event for the named crates
       -crate   : display hits per event by crate for all crates
     
       -level 0 : count good(0), connected(1), or all(2) channels
                  (default 0)
     
       -nohis  : don't save the created hpe histograms to file
       -noplot : don't make HIGZ hpe plots on the screen
       -nops   : don't create the hpe postscript file
     
       -zx #   : number of zones on plots in x direction
       -zy #   : number of zones on plots in y direction
       -logy   : make # of events axis logarithmic
    
  3. How to run it :
    1. Go to the directory, /hb/muon/daq98/dmons/hpe.
    2. Type mu_hpe with the appropiate command line arguments.
    3. Note it is possible to mask individual channels with a Mu.mask file which must be located in the local directory. Users should be aware of the contents of this file.
  4. Bugs and others :
    1. Currently the program only fully works on the hb-suns, but you can make histograms on the hera-b.
    2. Using a proper Mu.mask can be essential to get good results from this program.
<-------- back to the top -------->

Channel Occupancy          mu_occ

  1. What it does :
    This dmon is used for plotting channel occupancies. It also contains error checking and filtering out of bad data by FED (the default) or by event. It writes the data errors to screen (the default), a file, or /dev/null. It plots occupancy by fed ("occ by fed") and by position in space ("occ by pos"). It uses HBOOK, HIGZ, and HPLOT to save the histogram file, draw the plots on the screen, and save them to a postscript file.
  2. Command line arguments :
    This dmon has a help screen which displays its command line options. I'll reprint the current (01.08.99) help screen here.
       -C -G<partition>  : read data from <partition>
       [-X] -F<filename> : read data from <filename>
     
       -dm             : map crates based on the first read event
       -eventfilter    : filter out events with bad data
       -nofedfilter    : don't filter out bad FEDs
       -filtermask [#] : don't filter out bad fed ids(1), record ids(2), bx ids(4)
       -tofile         : write data errors to file
       -tonull         : write data errors to /dev/null
     
       -nofedhis  : don't save the created fed histograms to file
       -nofedplot : don't make HIGZ fed plots on the screen
       -nofedps   : don't create the fed postscript file
     
       -noxyzhis  : don't save the created xyz histograms to file
       -noxyzplot : don't make HIGZ xyz plots on the screen
       -noxyzps   : don't create the xyz postscript file
       -layer     : create the xyz layer plots
       -nodqm     : don't create the data quality xyz plots
     
       -raw       : include unconnected chambers (channels) in fed (xyz) output
     
       -nofed     : don't make fed his, plot, or ps
       -noxyz     : don't make xyz his, plot, or ps
       -nohis     : don't save the created histograms to file
       -noplot    : don't make HIGZ plots on the screen
       -nops      : don't create the postscript files
     
    
  3. How to run it :
    1. Go to the directory, /hb/muon/daq98/dmons/occ.
    2. Type mu_occ with the appropiate command line arguments.
    3. Once the histogram file is created, you can also use kumacs in PAW to view the files. The kumacs, create_fed_plots, create_fed_ps, create_fed_rawplots, create_xyz_plots, and create_xyz_ps will create the plots and postscript files I make from the histogram file. Type

        exec [kumac name] [run name]

    4. You can combine the data from multiple runs with 2 kumacs I have created, combine_fed_plots and combine_xyz_plots. Type

        exec combine_(fed/xyz)_plots [run number] [first run] [last run]

      These kumacs read the histogram files. They combine the data into one histogram file, and they create the combined plots and ps files. The kumacs read the muon configuration from another kumac called muon_structure which is made from the standard information files by a program named updatemuon_structure.

    5. You can also use this dmon on a global partition, that is, online. Execute

        mu_occ -C -Geva_muon

      (with any other options you want) and press Ctrl-C after some events are taken.

  4. Bugs and others :
    1. Currently the program only works fully on the hb-suns. You can create the histogram files on the hera-b.
<-------- back to the top -------->

Occupancy vs BX Monitor          mu_occvsbx

  1. What it does :
    This dmon plots occupancy vs physical bx number. It can filter out bad events. It uses HBOOK, HIGZ, and HPLOT to save the histogram file, draw the plots on the screen, and save them to a postscript file. It reads the 2 muon information files. This program was recently changed. It is no longer modeled on Uli Uwer's Occupancy vs BX code for the Outer Tracker.
  2. Command line arguments :
    This dmon's current (20.09.99) help screen is reprinted here.
       -dm       : map crates based on the first read event
       -efilter  : filter out events with bad data
     
       -occvsbx : display hits per event for certain 'good' cables
                  per crate (default choice)
       -section Mt3.1 Mp4.2-20+Mp4.2-21 Mt1.4-2 MU3 Mt1.B
                : show the hits per event for all cables matching each
                  string.  'U' and '.' are space wildcards.
                  'T' is for top (1,3,5). 'B' is for bottom (2,4,6).
                  Compares names to the length of the string name.
                  '+' will combine 2 names into one group.
       -layer, -super
                : display hits per event by layer or superlayer
       -occvsbx : display hits per event for certain cables per crate
                  as used in mu_occvsbx
       -side (+x|-x)
                : take only cables from the +x or -x side
     
       -fed 111 222 451
                : show the hits per event for the named crates
       -crate   : display hits per event by crate for all crates
     
       -level 0 : count good(0), connected(1), or all(2) channels
                  (default 0)
     
       -nohis  : don't save the created bx histograms to file
       -noplot : don't make HIGZ bx plots on the screen
       -nops   : don't create the bx postscript file
     
       -zx #   : number of zones on plots in x direction
       -zy #   : number of zones on plots in y direction
       -zoom [low #] [high #]
               : show closeup of certain range of BX optionally specifying
                 the range (default 190:210)
    
  3. How to run it :
    1. Go to the directory, /hb/muon/daq98/dmons/occvsbx.
    2. Run mu_hpe with the appropiate command line arguments.
    3. Note it is possible to mask individual channels with a Mu.mask file which must be located in the local directory. Users should be aware of the contents of this file.
    4. Results from one run can be combined with the kumac combine_bx.
  4. Bugs and others :
    1. mu_occvsbx needs some small number of events to show the occupancy at a particular BX. If the number of events at a particular BX is less, you will see an occupancy of 0 plotted.
    2. The occupancies are plotted by percent, i.e. 100 means 100% occupancy.
    3. Currently the program runs fully works on the hb-suns and the hera-b.
    4. Using a proper Mu.mask is usually essential to getting good results from this program.
    5. Currently, the program runs quite slowly compared to the other dmons. I am considering changing the way the data is read to speed up the process.
<-------- back to the top -------->

Text-Style Monitor          mu_txtmon

  1. What it does :
    This dmon can currently display channel occupancy information (i.e. the occupancy of each channel in the detector) or hits per event information (i.e. the average number of hits in a certain part of the detector). The configuration of the muon system is read from the 2 muon information files. The output is displayed as text on the screen.
  2. Command line arguments :
    This dmon has a help screen which displays all its command line options. I'll reprint the current (20.09.99) help screen here.
    /====================================================================\
    |                                                                    |
    |                       mu_txtmon command line options               |
    |                                                                    |
    |====================================================================|
    |=========================**  Dmon Options  **=======================|
    |  -C -Geva_muon   : read data from the global partition eva_muon    |
    |  [-X] -Fmuon.dat : read data from the file muon.dat                |
    |=========================**  Help Options  **=======================|
    |  -h(elp) : print help (this display)                               |
    |  -li(st) : list info files (daq and cable configuration)           |
    |                                                                    |
    |===============**  Occupancy per Channel Display   **===============|
    |                                                                    |
    |-----------Choose displayed cables by Sharc, FED, or cable----------|
    |  -sfc  : print the channel occupancy information by giving sharc   |
    |        : connection or fed position and cable range (same as -all) |
    |        -fed 232    : from the crate in FED position 23-2           |
    |                    :      0 means all crates (default)             |
    |        -sh(arc) 2  : from the 3rd FED crate                        |
    |                    :     99 means all crates (default)             |
    |        -from 10    : from cable number 10 (default 0)              |
    |        -to 57      : up to cable number 57 (default 63)            |
    |        -ca(ble) 24 : at cable number 24                            |
    |        -fc 12      : at the 12th cable in FED (cable 11)           |
    |----------------Choose displayed cable by cable name----------------|
    |  -on(ame) Mt1.3 Mp3.1-19B Mt1.T MU4                                |
    |               : print the channel occupany for all cables matching |
    |               : any string. 'U' and '.' are space wildcards.       |
    |               : 'T' is for top (1,3,5). 'B' is for bottom (2,4,6). |
    |               : Compares names to the length of the string name.   |
    |--------------Options for Occupancy per Channel Display-------------|
    |     -no(name) : don't write cable names in readout                 |
    |     -ad(dsfc) : include sharc pos, fedid, and cable # in readout   |
    |     -snc 6.0  : show just noisy cables with which have a channel   |
    |               : with occupancy >= 6.0%  (default 0%)               |
    |                                                                    |
    |===================**  Hits per Event Display  **===================|
    |                                                                    |
    |  -hpe crate   : display the hits per event by (c)rate, (l)ayer,    |
    |               : or (s)uperlayer. (default crate)                   |
    |  -hn(ame) Mt3.1 Mp4.2-20+Mp4.2-21 Mt1.4-2 MU3 Mt1.B                |
    |               : show the hits per event for all cables matching    |
    |               : each string. Same wildcard options as -oname.      |
    |               : Additionally, '+' will combine 2 names into one    |
    |               : group.                                             |
    |  -occ(vsbx)   : show the hits per event for one section per crate  |
    |               : as used in mu_occvsbx. Includes -rate -int options |
    |               : as part of the command.                            |
    |-----------------Option for Hits per Event Display------------------|
    |     -le(vel) 0 : count good(0), connected(1), or all(2) channels   |
    |                : (default 0)                                       |
    |                                                                    |
    |===================**  General Display Options  **==================|
    |     -si(de) -x  : choose the +x or -x side to display              |
    |     -ef(ilter)  : report and filter out bad events                 |
    |     -se(cond) 5 : time in seconds between outputs (default 1)      |
    |     -ev(ent) 10 : number of events between outputs                 |
    |     -r(pt) 10   : set the number of times to update display        |
    |                 : (default 100,000)                                |
    |     -ra(te)     : display values in %                              |
    |     -int        : print integrated values                          |
    |     -em         : explicitly map crate position by position in     |
    |                 : Mu.fedconfig, not by the first read event        |
    \====================================================================/
    
  3. How to run it :
    1. Go to the directory, /hb/muon/daq98/dmons/txtmon.
    2. Type mu_txtmon with the appropiate command line arguments.
      Note : Running mu_txtmon with only the right DAQ options brings up the help screen.
  4. Bugs and others :
    1. Because this program contains no histogram output, it is easier to make it compile correctly. This program runs on all three platforms, hera-b, hb-sun, and linux.
    2. I would look at the current channel occupancies and the STATUS part of info.muonconfig before completely trusting any hits per event display based on "good" channels.
    3. The text monitor is useful for displaying information for plots based on multiple runs. I have a programs mu_dispopc and mu_disphpe that demonstrates how to read information from multiple mu_txtmon outputs and display them in a HIGZ plot and postscript file.
<-------- back to the top -------->

Mark Buchler
Last modified: Thu Oct 21 02:25:28 MET DST 1999