Monitoring tools for Fast Monitoring(FM) and Prompt Reconstruction (PR) are available for sub-system users to develop against. DhpMonitor, written by Ed Chen, is an automatic histogram comparison tool. It can do user-defined statistical comparisons and send error output to various places. It is configured with a list of "comparison records", which are used to describe the individual comparisons that should be performed. Ben Brau has provided a tool that reads a user-written text file and converts it into a list of comparison records. This tool and examples are available in the DhpToken package.
Subsystems should provide and maintain the .cri files which describe the comparisons to be performed on the Prompt Reconstruction monitoring histograms. The .cri file is a formatted text file which is read by the DhpToken package into a Distributed Object Tree (DoT) of DhpComparisonRecordTokens, which applications can then convert into DhpComparisonRecords.
The .cri files use a parentheses-delimited keyword-value syntax. An
example .cri file with comments has been provided --- see
DhpToken/ExampleTokenFile.cri. Further
details of valid keywords can be obtained by consulting
DhpToken/DhpComparisonRecordToken.cc.
Ben has also provided a test application to read a .cri file into a
tree --- see
DhpToken/testDhpToken.cc. This can be used
to check the syntax of .cri files under development, and can be run by
>testDhpToken ExampleTokenFile.cri ExampleTokenFile.cri
(the input .cri file is given twice because two separate tests are
perfomed by testDhpToken). The results will be something like:
Struct Filled
(DhpComparisonRecord,
(checkInterval,30)
(title,"Number of EmcDigis per Event")
(path,"EMCHIST")
(TestStatistic,"Chi-Sq")
(useNorm,1)
(logFileResponse,
(min,0)
(max,1)
(msg,"Test 1, stream 2: Number of EmcDigis per Event, CL = ")
(severity,2)
(facility,)
(code,"Test")
)
(streamResponse,
(min,0)
(max,1)
(msg,"Test 1, stream 1: Number of EmcDigis per Event, CL = ")
(stype,1)
(name,"")
)
(RefSpectrum,1DRefHist)
(parameters,0)
(sliceList,)
)
Adding record Number of EmcDigis per Event in directory /
Adding record Number of EmcClusters per Event in directory /
Adding record Number of EmcBumps per Event in directory /
Adding record Energy of EmcDigis in directory /
There are 4 objects in the directory /
The actual comparisons can be tested using the monitoring application DhpMonitorApps/DhpMonApp.cc. This is a
framework application which runs with a Tcl script specifying the .cri
file and the live and reference hbook files. The example Tcl script,
testEMCHIST.tcl below
runs comparisons specified by testEMCHIST.cri using two test hbook files
emchist_6665.hbook and emchist_6666.hbook (to save these to
your workdir using Netscape, click shift+MB1 to download these files
rather than render them as gibberish):
module list
module talk DhpCompModule
execOnEndMon set t
exit
module talk DhpMonBuildEnv
criFileName set testEMCHIST.cri
exit
module disable DhpMonCORBAConfig
module talk DhpMonHbkConfig
setRefInterface set t
setLiveInterface set t
refInterfaceName set emchist_6665.hbook
liveInterfaceName set emchist_6666.hbook
exit
A .cri file can specify three kinds of responses --- streamResponse, logFileResponse and emailResponse --- for each comparison, in the event that the confidence level of the comparison falls in the range specified by values following "min" and "max" keywords. DhpMonApp currently has no ErrLogger, and so logFileResponses will be sent to the screen. emailResponses _will_ be sent to the specified "toList" and "ccList" email addresses each time the comparisons are executed, so pick the right addresses when testing to avoid flooding unwilling recipients with uninteresting email messages.
The two test hbook files --- emchist_6665.hbook and emchist_6666.hbook --- contain only the Prompt Reco monitoring histograms from the EMCHIST subdirectory. They were created using extrsubdir.kumac, which extracts a named subdirectory from one of the merged prompt reco hbook files, and writes all histograms to the same subdirectory in a named output file. Because the access to the hbook file involves copying of the file's contents into Dhp format, testing on entire merged Prompt Reco monitoring hbook files is rather slow, since they contain several ntuples as well as a large number of histograms. Extracting a single subsystem's subdirectory considerably speeds things up. The merged histogram files from runs processed to date can be found at /nfs/farm/babar/qa/ --- see http://www.slac.stanford.edu/~bbrau/psdir/oprMon.html for details of available runs.
DhpMonApp is run as follows:
DhpMonApp
>source testEMCHIST.tcl
>ev begin -nev 1
>exit
Note that if you are running on entire PR monitoring hbook files, the set-up will be very slow, due to the copying of the entire file contents.
The event step will generate rather a lot of DhpTupleManager::findHist and DhpTupleManager::findDir messages; ignore them. These are debug messages from DhpTupleManager, and can be suppressed by adding an ErrLogger to DhpMonApp with minimum severity of "warning" or above.
On exiting, the comparisons are executed, and appropriate responses
will be generated from failed comparisons (all comparisons specified
by testEMCHIST.cri "fail" by definition, since the threshold max is set
at a CL of 1). The responses from testEMCHIST look something like:
DhpCompModule::endJob
In DhpTupleManager::findDir(HepString dir)
leaving DhpTupleManager::findDir(HepString dir)
Test 1, stream 2: Number of EmcDigis per Event, CL = Confidence Level is: 0.0829968
Test 1, stream 1: Number of EmcDigis per Event, CL = Confidence Level is: 0.0829968
In DhpTupleManager::findDir(HepString dir)
leaving DhpTupleManager::findDir(HepString dir)
Test 2 (log): Number of EmcClusters per Event, CL = Confidence Level is: 0.0954346
Test 2 (stream): Number of EmcClusters per Event, CL = Confidence Level is: 0.0954346
In DhpTupleManager::findDir(HepString dir)
leaving DhpTupleManager::findDir(HepString dir)
Test 3 (log): Number of EmcBumps per Event, CL = Confidence Level is: 0.706496
Test 3 (stream): Number of EmcBumps per Event, CL = Confidence Level is: 0.706496
In DhpTupleManager::findDir(HepString dir)
leaving DhpTupleManager::findDir(HepString dir)
Test 4 (log): Energy of EmcDigis, CL = Confidence Level is: 0.00389387
Test 4 (stream): Energy of EmcDigis, CL = Confidence Level is: 0.00389387
DhpCompModule::~DhpCompModule