This is a quick summary of the key features of the present bytestream decoding in ATHENA.
This contains the L1Calo "Raw Data Objects" (RDOs) which are implemented as various subclasses of a base class L1CaloRdo. All objects are contained in a store of type L1CaloRdoStore. The decoding from ROD fragments to create the RDOs is done by the (templated) L1CaloBsDecoder class.
These classes are directly copied from the online bytestreamDecoder package with only two changes:
This package contains two different things (which should probably be separated).
We use the simplest bytestream decoding infrastructure. This allows one ROD fragment to be converted to one object of one class and stored in StoreGate. Since we have four (might have been five) different types of ROD fragment, we needed to replicate the infrastructure five times.
For each fragment we have the following:
#include "RecL1CaloXXXXXXByteStreamCnv.h"
DECLARE_CONVERTER_FACTORY(RecL1CaloXXXXXXByteStreamCnv);
DECLARE_FACTORY_ENTRIES(TrigT1CaloTestBeam) {
DECLARE_CONVERTER(RecL1CaloXXXXXXByteStreamCnv);
}
ByteStreamAddressProviderSvc = Service( "ByteStreamAddressProviderSvc" )
ByteStreamAddressProviderSvc.TypeNames += ["L1CaloRdoStoreXXXXXX/L1CaloRawDataXXXXXX"]
ByteStreamCnvSvc = Service( "ByteStreamCnvSvc" )
ByteStreamCnvSvc.InitCnvs += [ "L1CaloRdoStoreXXXXXX" ]
NB in the TypeNames entries the first element in the classname
(eg L1CaloRdoStoreXXXXXX for a particular L1CaloRdoStore subclass)
and the second (eg L1CaloRawDataXXXXXX) is the key to be used
when requesting the object from StoreGate.TrigT1CaloTestBeam/share
directory contains
a suitable jobOptions fragment declaring all five converters.
With all the above infrastructure in place, using the decoders is fairly simple. Just ask StoreGate for the key associated with the data you want. This returns a (smart) pointer to the corresponding L1CaloRdoStore subclass containing the L1CaloRdo objects decoded from the relevant ROD fragment.
// Store Gate active store: in algorithm initialise() method. sc = serviceLocator()->service("ActiveStoreSvc", m_activeStore); if (sc.isFailure()) { // handle error } // Get store of CPM DAQ data from StoreGate const DataHandlemyL1CaloRdoStoreCpmDaq; sc = (*m_activeStore)->retrieve(myL1CaloRdoStoreCpmDaq, "L1CaloRawDataCpmDaq"); if (sc.isFailure()) { // handle error } // Use L1CaloRdoStore API to iterate over CPM DAQ data CpmTowerIter beginCT, endCT; myL1CaloRdoStoreCpmDaq->getCpmTowerIterators( beginCT, endCT ); while ( beginCT != endCT ) { // analyse data }