X-mode Calibrations and Consumers
last updated 2/8/2001 by Jack Cranshaw (cranshaw@fnal.gov)
Code support by Bill Orejudos (orejudos@fnal.gov)
Definition: X-mode calibrations are calibrations where the data
is collected and analyzed in the crate. The results of the analysis are
then shipped up through the DAQ as a C-bank or set of C-banks constituting
one event which are received by a consumer and written to the database.
The term 'X-mode' is a relic of Run 1 where calibrations were done in a
similar mode and the results were shipped up in banks ending in X.
Data Path: There are two paths which the C-banks can follow and
shown in the DAQ
Data flow and format diagram .
-
Hardware Event Builder: This is the same path used for data taking and
passes along the VRB/EVB/Level3 path. C-bank size is limited to 64k by
the VRB. It outputs normal EDM2/XXX format data.
-
Software Event Builder: This bypasses the VRB, so the C-bank size limit
is removed. It outputs Trybos banks.
The current rule of thumb is that D-mode calibrations use the hardware
event builder while X-mode calibrations use the software event builder.
Both event builder routes feed the data to the consumer-server-logger which
passes them to the consumers.
Bank Access: The consumers access the banks as EDM2 objects.
The input module handles any needed conversions.
Bank Definition: Not all C-banks have been defined. The procedure
is to contact David Dagenhart (wdd@cdfsga.fnal.gov) and give him a Latex
description of the data format and channel identifiers. Helpful information
is at Dave's
4152 page . All new banks will be defined as Storable Banks only. The
Banks package is being phased out. Here is the schedule
of implementation .
CalibConsumer Modules: X-mode consumers are part of the CalibConsumer
package in the Run2 CVS repository. They are responsible for unpacking
the C-banks and putting the information into the calibration database.
No histogramming is done in the consumer. Analysis is done directly on
the database using DBANA. Propagation of error conditions will be done
using the same mechanism as other consumers.
Since this procedure is the same for all X-mode calibrations involving
C-banks, a standardization has been done using an intermediate class. AC++
modules all inherit from AppModule. All CalibConsumer modules inherit from
CalibModule which handles all the tasks which are common to X-mode calibrations.
CalibModule then inherits from AppModule, so that any CalibConsumer module
can be included as a module in an AC++ executable.
As of 5/4/00 there are two X-mode CalibConsumer executables with one
module each.
-
QieCalibConsumer (replaced by QiePed 8/00) (J. Cranshaw, cranshaw@fnal.gov): contains three modules:
-
CalQieMod: handles C-banks from the QIE gain calibration banks for
the calorimeter and CLC. Can accept CEMC,CHAC,WHAC,PEMC,PHAC,CLAC.
-
CalPedMod: handles P-banks from the QIE pedestal banks for the calorimeter.
Can accept CEMP,CHAP,WHAP,PEMP,PHAP.
-
SmxPedMod: handles P-banks from the QIE pedestal banks for the Shower
Max crates. Can accept CESP,CCRP,CPRP,PESP.
-
CttCalibConsumer: (B. Orejudos, orejudos@fnal.gov): contains one module:
-
CalCttMod: Handles C-banks from the front end timing calibrations.
Can accept CTTC. Could also handle similar calibrations for muons.
Writing CalibConsumer Modules: As stated above, the X-mode
consumer code is in the CalibConsumer package in the run2 CVS repository.
It follows the general conventions for package definition. Header files
with class definitions are in the packagename/packagename directory, e.g.
CalibConsumer/CalibConsumer. Code for binaries is in the CalibConsumer/src
directory. The X-mode modules are in the CalibConsumer/mods directory and
they are compiled into a library libCalibConsumer.a. For outdated documentation
look in CalibConsumer/doc. Below is a description of the steps one would
take to create a new CalibConsumer executable. Each consumer should have
a person responsible for committing changes to CVS.
Create a test release and check out the CalibConsumer package. Take
CttCalibConsumer as an example.
-
CalibConsumer/
-
CalibConsumer/
-
mods/
-
src/
-
scripts/
-
CalCttMod.hh is the header file with the class definition. To make
your class you will need to
-
Copy it to a file with the name of your class, e.g. MyCalMod.hh.
-
Change the name of the class, e.g. MyCalMod.
-
Declare the managers for the data that will be written to the database,
e.g. cotctt_mgr.
-
Declare containers for the data, e.g. cotctt.
-
CalCttMod.cc contains the code which implements the methods of CalCttMod.hh.
To make your class you will need to
-
Copy it to a file with the name of your class, e.g. MyCalMod.cc; and change
all the class name occurrences.
-
In the beginRun method, check the managers and clear the containers.
-
Write the code for Process_CBANK which moves the data from the bank into
database containers.
-
In the endRun method, call writedb for the containers which were filled
in Process_CBANK for the corresponding managers.
-
CttCalibConsumer.cc is the AC++ executable code. Create a similar
file with your module in place of CalCttMod. The third argument is the
name of the menu to be accessed in the talk-to. You will need to put the
executable code into the appropriate directory under src.
-
run_ctt_validate.tcl is an example of how to talk-to the executable
when reading a trybos file.