ResponsibilitesEach major detector or analysis subsystem has a monitoring program dedicated to it. Each program has three responsiblities it is required to address:
Access to HistogramsFor purposes of online monitoring, histograms must be made available for viewing as they are filled. Mechanisms exist for this in both HBOOK (using hlimap()) and ROOT (using TMapFile). Therefore, each program must have an online mode in which histograms are mapped to shared memory for access by another process. This mode should be entered by passing the "-online" option on the command line. For consistency, all online monitoring programs should accept this option, even if they run in online mode by default. The preferred method of providing online histograms is through ROOT. This will make it simpler for shift takers by having a single program for viewing the minimal subset of histograms which indicate all systems are functioning. ROOT uses a memory mapped file. Thus, all programs should create these files in a standard directory with a known name. This may be accomplished using a symbolic link. See the Files section below for more details.Resetting HistogramsAll monitor programs must automatically reset histograms at begin run transitions (i.e. when the run number changes). This is best done by booking the histograms in a brun routine rather than only at init time. Additionally, all monitor programs must reset all histograms when they receive a SIGHUP signal. (Do this by calling signal() when the program starts. See the man page). Adhering to this standard will make it easier to build standard tools for the shift takers.FilesMonitor programs should also create files to archive the histograms for later access. These will need to have names which make it easy to identify the run and system from which the file was created. The suggested naming scheme is:tac_calib00123.root The above example would specify the file came from the tac_calib program and is for run 123 (note the leading zeros for the run number in the file name). The files should also be kept in a standard directory on a clon disk. A directory has been setup specifically for this. It is:/home/primex/online Files in this directory will be periodically uploaded to the tape silo. Monitor programs will be launched from this directory so histogram files should be created in the current working directory. They should NOT specify a full pathname by default for the output file since this could interfere with the archive files should a second instance of a program be launched (say for debugging). |