Project
Loading...
Searching...
No Matches
testTOFIndex.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
12#define BOOST_TEST_MODULE Test TOFIndex
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <fairlogger/Logger.h> // for FairLogger
16#include "TOFBase/Geo.h"
17#include <TRandom.h>
18#include <TStopwatch.h>
19#include <boost/test/unit_test.hpp>
20#include <iostream>
21
22using namespace o2::tof;
23
25{
26 BOOST_TEST_CHECKPOINT("Starting");
27 Int_t indextof[5] = {0};
28
29 Bool_t ErrorSe = 0;
30 Bool_t ErrorPl = 0;
31 Bool_t ErrorSt = 0;
32 Bool_t ErrorPx = 0;
33 Bool_t ErrorPz = 0;
34
36
37 for (Int_t i = 0; i < Geo::NSECTORS; i++) { // Loop on all Sectors
38 indextof[0] = i;
39 for (Int_t j = 0; j < Geo::NPLATES; j++) { // Loop on all Plates
40 indextof[1] = j;
41 //
42 const Int_t nStrips =
43 j < 2
45 : j > 2 ? Geo::NSTRIPC
46 : Geo::NSTRIPA; // Define the numer of strips of the plate
47 if (j == 2 &&
48 (i == 15 || i == 14 || i == 13)) { // Skip sectors without A plate
49 continue;
50 }
51 //
52 for (Int_t k = 0; k < nStrips; k++) { // Loop on all Strips
53 indextof[2] = k;
54
55 for (Int_t l = 0; l < Geo::NPADZ; l++) { // Loop on all Pads Z
56 indextof[3] = l;
57 for (Int_t m = 0; m < Geo::NPADX; m++) { // Loop on all Pads X
58 indextof[4] = m;
59 Int_t chan = o2::tof::Geo::getIndex(indextof);
60 Int_t indextofTest[5] = {0};
61
62 o2::tof::Geo::getVolumeIndices(chan, indextofTest);
63 BOOST_CHECK_MESSAGE(indextof[0] == indextofTest[0],
64 "Different Sector ==> in:" << indextof[0]
65 << " --> out:"
66 << indextofTest[0]);
67 BOOST_CHECK_MESSAGE(indextof[1] == indextofTest[1],
68 "Different Plate ==> in:" << indextof[1]
69 << " --> out:"
70 << indextofTest[1]);
71 BOOST_CHECK_MESSAGE(indextof[2] == indextofTest[2],
72 "Different Strip ==> in:" << indextof[2]
73 << " --> out:"
74 << indextofTest[2]);
75 BOOST_CHECK_MESSAGE(indextof[3] == indextofTest[3],
76 "Different PadZ ==> in:" << indextof[3]
77 << " --> out:"
78 << indextofTest[3]);
79 BOOST_CHECK_MESSAGE(indextof[4] == indextofTest[4],
80 "Different PadX ==> in:" << indextof[4]
81 << " --> out:"
82 << indextofTest[4]);
83 // if (locError && j == 1 && k == 3) {
84 LOG(info) << "in:" << indextof[0] << ", " << indextof[1] << ", "
85 << indextof[2] << ", " << indextof[3] << ", "
86 << indextof[4] << " --> out:" << indextofTest[0] << ", "
87 << indextofTest[1] << ", " << indextofTest[2] << ", "
88 << indextofTest[3] << ", " << indextofTest[4]
89 << " (ch=" << chan << ")";
90 // }
91 }
92 }
93 }
94 }
95 }
96 BOOST_TEST_CHECKPOINT("Ending");
97}
int32_t i
uint32_t j
Definition RawData.h:0
static constexpr Int_t NSECTORS
Definition Geo.h:120
static constexpr Int_t NPADZ
Definition Geo.h:109
static constexpr Int_t NSTRIPB
Definition Geo.h:113
static constexpr Int_t NSTRIPC
Definition Geo.h:114
static constexpr Int_t NSTRIPA
Definition Geo.h:112
static void getVolumeIndices(Int_t index, Int_t *detId)
Definition Geo.cxx:543
static Int_t getIndex(const Int_t *detId)
Definition Geo.cxx:563
static constexpr Int_t NPLATES
Definition Geo.h:122
static constexpr Int_t NPADX
Definition Geo.h:107
static void InitIndices()
Definition Geo.cxx:401
const GLfloat * m
Definition glcorearb.h:4066
BOOST_AUTO_TEST_CASE(asynch_schedule_test)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"