For an example that looks a bit more like the code you will see (and
write) in D0, take a look at
test1 class is used to represent
energy objects (e.g. calorimeter cells), which are collected in
the test2 class (e.g. clusters). Cells can be added
to a cluster using the addCell
method. CalcET() returns the Et of a cluster,
NCells() returns the number of cells in a
cluster. Note that cells below a certain energy threshold are
suppressed - since this threshold is a parameter that you might
want to modify from time to time, it is read in from a file
(
test2.rcp) when constructing the class.rcp in t67/example/).test2 to your example package, copy the source
files, the include as well as the rcp file and add
test2 to the COMPONENTS file in the src directory (you should add
this below test1 so that test1 is tested before test2). You will also
have to add the name of the rcp library to your LIBDEPS file: rcp
<d0mino> gmake example.testok.out for test2 to check if the test produced the
expected results:
<d0mino> more
tmp/$BFARCH/example/ctest/test2/ok.out
Testing test2:
total ET 53 (should be 53)
number of cells 2 (should be 2)
Component test returned status 0