![]() |
Project
|
Class to convert a list of input buffers containing TPC clusters of type ClusterHardware to type ClusterNative. More...
#include <HardwareClusterDecoder.h>
Public Types | |
using | OutputAllocator = std::function< char *(size_t)> |
Allocator function object to provide the output buffer. | |
Public Member Functions | |
HardwareClusterDecoder ()=default | |
~HardwareClusterDecoder ()=default | |
int | decodeClusters (std::vector< std::pair< const o2::tpc::ClusterHardwareContainer *, std::size_t > > &inputClusters, OutputAllocator outputAllocator, const std::vector< o2::dataformats::ConstMCTruthContainerView< o2::MCCompLabel > > *inMCLabels=nullptr, o2::dataformats::MCTruthContainer< o2::MCCompLabel > *outMCLabels=nullptr) |
Decode clusters provided in raw pages The function uses an allocator object to request a raw char buffer of needed size. Inside this buffer, flat structures of type ClusterNativeBuffer are initialized, each block starting with a property header containing also the number of clusters immediately following the the property header. | |
Static Public Member Functions | |
static void | sortClustersAndMC (ClusterNative *clusters, size_t nClusters, o2::dataformats::MCTruthContainer< o2::MCCompLabel > &mcTruth) |
Sort clusters and MC labels in place ClusterNative defines the smaller-than relation used in the sorting, with time being the more significant condition in the comparison. | |
Class to convert a list of input buffers containing TPC clusters of type ClusterHardware to type ClusterNative.
This class transforms the hardware cluster raw format to the native cluster format. The output is organized in blocks per sector-padrow, the sequence of cluster blocks is stored in a flat structure. Cluster blocks consist of the property header ClusterGroupHeader with members sector, globalPadrow and nClusters, and the clusters following.
An allocator needs to be provided to allocate a char buffer of specified size from the decoding, function the cluster blocks are initialized inside the provided binary buffer.
Usage:
HardwareClusterDecoder decoder; std::vector<char> outputBuffer; auto outputAllocator = [&outputBuffer](size_t size) -> char* { outputBuffer.resize(size); return outputBuffer.data(); } decoder( {pointer, n}, outputAllocator, &mcIn, &mcOut);
FIXME: The class should be in principle stateless, but right now it has an instance of the integrator for the digittal currents.
Definition at line 62 of file HardwareClusterDecoder.h.
using o2::tpc::HardwareClusterDecoder::OutputAllocator = std::function<char*(size_t)> |
Allocator function object to provide the output buffer.
Definition at line 69 of file HardwareClusterDecoder.h.
|
default |
|
default |
int HardwareClusterDecoder::decodeClusters | ( | std::vector< std::pair< const o2::tpc::ClusterHardwareContainer *, std::size_t > > & | inputClusters, |
OutputAllocator | outputAllocator, | ||
const std::vector< o2::dataformats::ConstMCTruthContainerView< o2::MCCompLabel > > * | inMCLabels = nullptr , |
||
o2::dataformats::MCTruthContainer< o2::MCCompLabel > * | outMCLabels = nullptr |
||
) |
Decode clusters provided in raw pages The function uses an allocator object to request a raw char buffer of needed size. Inside this buffer, flat structures of type ClusterNativeBuffer are initialized, each block starting with a property header containing also the number of clusters immediately following the the property header.
inputClusters | list of input pages, each entry a pair of pointer to first page and number of pages |
outputAllocator | allocator object to provide the output buffer of specified size |
inMCLabels | optional pointer to MC label container |
outMCLabels | optional pointer to MC output container |
Definition at line 36 of file HardwareClusterDecoder.cxx.
|
static |
Sort clusters and MC labels in place ClusterNative defines the smaller-than relation used in the sorting, with time being the more significant condition in the comparison.
Definition at line 173 of file HardwareClusterDecoder.cxx.