16#define BOOST_TEST_MODULE Test TPC DataFormats
17#define BOOST_TEST_MAIN
18#define BOOST_TEST_DYN_LINK
19#include "../include/DataFormatsTPC/CompressedClusters.h"
20#include "../include/DataFormatsTPC/CompressedClustersHelpers.h"
21#include <boost/test/unit_test.hpp>
32template <
typename ContainerType>
36 std::generate(
target.begin(),
target.end(), []() { return rand() % 256; });
40 std::vector<unsigned short>
qTotA;
41 std::vector<unsigned short>
qMaxA;
50 std::vector<unsigned char>
qPtA;
51 std::vector<unsigned char>
rowA;
53 std::vector<unsigned int>
timeA;
54 std::vector<unsigned short>
padA;
56 std::vector<unsigned short>
qTotU;
57 std::vector<unsigned short>
qMaxU;
124 clusters.nSliceRowClusters =
data.nSliceRowClusters.data();
137 BOOST_REQUIRE(restored.
qTotA ==
nullptr);
157 std::string fileName = gSystem->TempDirectory();
158 fileName +=
"/testCompressedClusters.root";
161 std::unique_ptr<TFile> testFile(TFile::Open(fileName.c_str(),
"RECREATE"));
162 std::unique_ptr<TTree> testTree = std::make_unique<TTree>(
"testtree",
"testtree");
164 auto* branch = testTree->Branch(
"compclusters", &
clusters);
167 testTree->SetDirectory(
nullptr);
172 std::unique_ptr<TFile>
file(TFile::Open(fileName.c_str()));
173 BOOST_REQUIRE(
file !=
nullptr);
174 TTree*
tree =
reinterpret_cast<TTree*
>(
file->GetObjectChecked(
"testtree",
"TTree"));
175 BOOST_REQUIRE(
tree !=
nullptr);
176 TBranch* branch =
tree->GetBranch(
"compclusters");
177 BOOST_REQUIRE(branch !=
nullptr);
179 branch->SetAddress(&readback);
181 BOOST_REQUIRE(readback !=
nullptr);
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h configStandalone Internal display display_internal Number of updates the Qt GUI may send ahead of the last one the display has before it waits for the display Opacity of the console background Number of console lines the history is shortened to this when it reaches twice the size Time in seconds an info message fades out after setInfoTime h OpenGL display display Font size Do not use Freetype for font Renderer for event Frontend to use for event ROOT macros used as track filter Console script file
Global TPC definitions and constants.
BOOST_AUTO_TEST_CASE(ClusterHardware_test1)
void fillClusters(CompressedClustersROOT &clusters, ClustersData &data)
void fillRandom(ContainerType &target, size_t size)
std::vector< unsigned short > padResA
[nAttachedClustersReduced]
std::vector< unsigned char > sigmaTimeA
[nAttachedClusters]
std::vector< unsigned int > timeDiffU
[nUnattachedClusters]
std::vector< unsigned char > qPtA
[nAttachedClusters]
std::vector< unsigned char > sliceA
[nTracks]
std::vector< unsigned char > sigmaTimeU
[nUnattachedClusters]
std::vector< unsigned short > padA
[nTracks]
std::vector< unsigned short > qTotA
std::vector< unsigned short > nTrackClusters
[nUnattachedClusters]
std::vector< unsigned char > rowA
[nTracks]
std::vector< unsigned int > timeResA
[nAttachedClustersReduced]
std::vector< unsigned short > padDiffU
[nUnattachedClusters]
std::vector< unsigned char > flagsU
[nUnattachedClusters]
std::vector< unsigned short > qMaxU
[nUnattachedClusters]
std::vector< unsigned char > flagsA
[nAttachedClusters]
std::vector< unsigned char > rowDiffA
[nAttachedClusters]
std::vector< unsigned int > timeA
[nTracks]
std::vector< unsigned char > sigmaPadA
[nAttachedClustersReduced]
std::vector< unsigned int > nSliceRowClusters
[nTracks]
std::vector< unsigned short > qTotU
[nTracks]
std::vector< unsigned char > sigmaPadU
[nUnattachedClusters]
std::vector< unsigned char > sliceLegDiffA
[nAttachedClustersReduced]
std::vector< unsigned short > qMaxA
[nAttachedClusters]
unsigned int nUnattachedClusters
unsigned int nAttachedClusters
static size_t flattenTo(ContainerType &container, CompressedClustersROOT &clusters)
static size_t restoreFrom(ContainerType &container, CompressedClustersROOT &clusters)
Restore the array pointers from the data in the container.
std::vector< Cluster > clusters
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))