Project
Loading...
Searching...
No Matches
testGPUGeometry.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#define BOOST_TEST_MODULE Test TPC GPUTPCGeometry
17#define BOOST_TEST_MAIN
18#define BOOST_TEST_DYN_LINK
19#include <boost/test/unit_test.hpp>
21#include "TPCBase/Mapper.h"
24#include "GPUTPCGeometry.h"
25
26using namespace o2::gpu;
27
28namespace o2
29{
30namespace tpc
31{
33BOOST_AUTO_TEST_CASE(GPUTPCGeometry_test1)
34{
35 const Mapper& mapper = Mapper::instance();
36 const GPUTPCGeometry geo;
37 const auto regions = mapper.getMapPadRegionInfo();
38
39 BOOST_CHECK_EQUAL(mapper.getNumberOfPadRegions(), geo.NRegions());
41 BOOST_CHECK_EQUAL(mapper.PADROWS, geo.NROWS);
42
43 auto& detParam = ParameterDetector::Instance();
44 BOOST_CHECK_EQUAL(detParam.TPClength, geo.TPCLength());
45
46 /*for (unsigned int i = 0; i < mapper.NPARTITIONS; i++) {
47 BOOST_CHECK_EQUAL(???, geo.GetSectorFECOffset(i)); // TODO: Get value from mapper and compare!
48 }*/
49
50 for (unsigned int i = 0; i < mapper.getNumberOfPadRegions(); i++) {
51 BOOST_CHECK_EQUAL(mapper.ROWSPERREGION[i], geo.GetRegionRows(i));
52 BOOST_CHECK_EQUAL(mapper.ROWOFFSET[i], geo.GetRegionStart(i));
53 // BOOST_CHECK_EQUAL(???, geo.GetSampaMapping(i)); // TODO: Get value from mapper and compare!
54 // BOOST_CHECK_EQUAL(???, geo.GetChannelOffset(i)); // TODO: Get value from mapper and compare!
55 BOOST_CHECK_EQUAL(regions[i].getPadHeight(), geo.PadHeightByRegion(i));
56 BOOST_CHECK_EQUAL(regions[i].getPadWidth(), geo.PadWidthByRegion(i));
57 }
58
59 for (unsigned int i = 0; i < mapper.PADROWS; i++) {
60 BOOST_CHECK_EQUAL(mapper.REGION[i], geo.GetRegion(i));
61 unsigned int region = mapper.REGION[i];
62 BOOST_CHECK_EQUAL(regions[region].getPadsInRowRegion(mapper.getLocalRowFromGlobalRow(i)), geo.NPads(i));
63 const auto& pos = mapper.padCentre(mapper.getGlobalPadNumber(mapper.getLocalRowFromGlobalRow(i), 0, region));
64 BOOST_CHECK_EQUAL(pos.x(), geo.Row2X(i));
65 }
66}
67} // namespace tpc
68} // namespace o2
int32_t i
Definition of the parameter class for the detector.
uint16_t pos
Definition RawData.h:3
static constexpr uint32_t NROWS
static constexpr uint32_t NSECTORS
static constexpr unsigned int ROWOFFSET[NREGIONS]
offset to calculate local row from global row
Definition Mapper.h:533
const std::array< PadRegionInfo, 10 > & getMapPadRegionInfo() const
Definition Mapper.h:386
static GlobalPadNumber getGlobalPadNumber(const unsigned int lrow, const unsigned int pad, const unsigned int region)
Definition Mapper.h:64
static unsigned int getLocalRowFromGlobalRow(const unsigned int row)
Definition Mapper.h:72
static Mapper & instance(const std::string mappingDir="")
Definition Mapper.h:44
static constexpr unsigned int ROWSPERREGION[NREGIONS]
number of pad rows for region
Definition Mapper.h:532
static constexpr unsigned int NSECTORS
total number of sectors in the TPC
Definition Mapper.h:526
const PadCentre & padCentre(GlobalPadNumber padNumber) const
Definition Mapper.h:51
static constexpr unsigned int PADROWS
total number of pad rows
Definition Mapper.h:528
int getNumberOfPadRegions() const
Definition Mapper.h:387
static constexpr unsigned REGION[PADROWS]
region for global pad row
Definition Mapper.h:537
BOOST_AUTO_TEST_CASE(ClusterHardware_test1)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())