Dhiman Chakraborty, Herbert Greenlee, Jim Kowalkowski,
Qizhong Li, Gordon Watts
This document assumes that the reader is familiar with basic framework concepts, such as hooks and packages. Refer to the Framework User Guide for additional information.
Here are instructions for creating a package class:
static Registry<MyPackage> dummy;where the template parameter is the package class.
The package implementation file containing the global registry variable should be compiled to an object file in the SRT lib area (use gmake variable OBJCPPFILES). Any other package implementation files can be placed into libraries as usual. Use gmake function $(filter-out ...) to remove the global registry file from LIBCPPFILES. For example:
# Top level package file OBJCPPFILES := mypackage.cpp # Other source files LIBCPPFILES := $(filter-out $(OBJCPPFILES), $(wildcard *.cpp)) include SoftRelTools/standard.mk
In order to be selectable at run time, packages must be linked into a framework executable (it may eventually be possible to use a prelinked framework executable and dynamically linked packages). Modules containing package global registry variables should be linked as object files, not from libraries. There is also an object file associated with the framework main program (framework.o) that must be linked in as an object file. Include the libraries required by the framework (-lframework, -lidentifiers, and -lrcp), as well as libraries required by the packages.
The instructions in this section are for how to write a linking rule in your own GNUmakefile, rather than using any of SRT's rules in standard.mk, or other make include files. Here is an example:
# Tell gmake where to find link objects vpath %.o $(libdir) $(BFDIST)/releases/$(BFCURRENT)/lib/$(BFARCH) # Object files objects := framework.o mypackage.o ReadEvent.o LoadDSPACK.o # Libraries needed by framework and packages libs := -lio_packages -lframework -ledm -lrcp -lidentifiers -lstream_ds \ -ld0om_ds -ldspack -lstream -ld0om -lcint-lite -ld0_util -lNameTrans \ -lExceptions -lZMutility -lCLHEP -lftn -lm # Rule to build executable exe := $(bindir)myprogram $(exe): $(objects) @echo "Linking $(exe)" -rm -f $(exe) 2> /dev/null $(CXX) -o $@ $(CXXFLAGS) $(CXXCFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ $(libs) # Standard SRT target bin: $(exe)
Here are some comments on the above makefile fragment.
The framework executable must be invoked with command line parameters to specify the top level framework rcp file. There are two ways of doing this:
myprogram myrcpor
myprogram <name> -rcp myrcp.rcp
In either case, the framework looks for a top level rcp file called myrcp.rcp.
Here is an example of a top level framework RCP file.
string ProcessorPackage = "ProcessGroup" string ProcessorHooks = "builder filter process dump" // List of packages string Packages = "p1 p2" // RCP files for the packages. RCP p1 = <ReadEvent.rcp> RCP p2 = <mypackage.rcp> // only call dump event hooks every this many events int DumpPeriod = 1
The first two lines of the framework rcp file (the ProcessorPackage and ProcessorHooks variables do not normally need to be changed. The variable Packages specifies a list of packages to be instantiated. The names specified in the Packages variable are instance names, which are arbitrary except that they must match the names of the RCP objects immediately following. Packages specified in the Packages variable are instantiated using the corresponding RCP files (the packages must have been linked into the executable).
Currently all required RCP files (the framework RCP file, and the package RCP files) should be copied to the directory from which the framework executable is run. Eventually, an RCP search path may be defined.
Here is the RCP file from the ReadEvent package.
string PackageName = "ReadEvent" string InputFile = "test.ds" string InputFormat = "DSPACK" int NumEvents = 0 // Maximum number of events to read (0 = all). string ApplicationName = "ReadEvent" // String passed to d0om_init.
The main thing to note about this RCP file is that it contains a string variable called PackageName. All package RCP files must contain this variable. The PackageName variable is how the framework finds out what package is to be instantiated. The string specified as the value of PackageName must match the string returned by the package static method package_name().
Here is a list of the currently available hooks.
Here is a list of currently available standard packages.
Getting Started with the DØ Framework
This document was generated using the LaTeX2HTML translator Version 96.1-h (September 30, 1996) Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
The command line arguments were:
latex2html -split 0 getting_started.tex.
The translation was initiated by Herb Greenlee on Fri May 15 12:17:23 CDT 1998