Project
Loading...
Searching...
No Matches
testTriggerTRUDCS.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 EMCAL Calib
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
17
18#include <algorithm>
19
20namespace o2
21{
22
23namespace emcal
24{
25
31{
32 testobject.setSELPF(7711);
33 testobject.setL0SEL(1);
34 testobject.setL0COSM(100);
35 testobject.setGTHRL0(132);
36 testobject.setMaskReg(1024, 0);
37 testobject.setMaskReg(0, 1);
38 testobject.setMaskReg(512, 2);
39 testobject.setMaskReg(31985, 3);
40 testobject.setMaskReg(0, 4);
41 testobject.setMaskReg(0, 5);
42 testobject.setRLBKSTU(0);
43 testobject.setFw(0x21);
44}
45
46BOOST_AUTO_TEST_CASE(TriggerTRUDCS_test)
47{
48
50 TriggerTRUDCS testobject;
51 ConfigureReference(testobject);
52
53 uint64_t SELPF = 7711;
54 uint64_t L0SEL = 1;
55 uint64_t L0COSM = 100;
56 uint64_t GTHRL0 = 132;
57 std::array<uint32_t, 6> MaskReg = {1024, 0, 512, 31985, 0, 0};
58 uint64_t RLBKSTU = 0;
59 uint64_t Fw = 0x21;
60
61 BOOST_CHECK_EQUAL(testobject.getSELPF(), SELPF);
62 BOOST_CHECK_EQUAL(testobject.getL0SEL(), L0SEL);
63 BOOST_CHECK_EQUAL(testobject.getL0COSM(), L0COSM);
64 BOOST_CHECK_EQUAL(testobject.getGTHRL0(), GTHRL0);
65 BOOST_CHECK_EQUAL(testobject.getRLBKSTU(), RLBKSTU);
66
67 for (int ireg = 0; ireg < 6; ireg++) {
68 BOOST_CHECK_EQUAL(testobject.getMaskReg(ireg), MaskReg[ireg]);
69 }
70
71 BOOST_CHECK_EQUAL(testobject.getFw(), Fw);
72
76 BOOST_CHECK_EQUAL(testobject == testobject, true);
77
81 TriggerTRUDCS test1, test2;
82 ConfigureReference(test1);
84 BOOST_CHECK_EQUAL(test1 == test2, true);
85
87 TriggerTRUDCS test3(test1);
88 BOOST_CHECK_EQUAL(test3 == test1, true);
89
91 TriggerTRUDCS test4 = test1;
92 BOOST_CHECK_EQUAL(test4 == test1, true);
93
101 ref.setSELPF(7000);
102 BOOST_CHECK_EQUAL(ref == testobject, false);
103 ref.setL0SEL(2);
104 ref.setL0COSM(1000);
105 ref.setGTHRL0(184);
106 ref.setRLBKSTU(1);
107 ref.setFw(0x11);
108 ref.setMaskReg(768, 0);
109 ref.setMaskReg(15, 1);
110 ref.setMaskReg(37632, 2);
111 ref.setMaskReg(63, 3);
112 ref.setMaskReg(0, 4);
113 ref.setMaskReg(208, 5);
114 BOOST_CHECK_EQUAL(ref == testobject, false);
115
120 std::string reference = std::string("SELPF: 0x1e1f, L0SEL: 0x1, L0COSM: 0x64, GTHRL0: 0x84, RLBKSTU: 0x0, FW: 0x21\n") + std::string("Reg0: b'00000000000000000000010000000000 (1024)\nReg1: b'00000000000000000000000000000000 (0)\n") + std::string("Reg2: b'00000000000000000000001000000000 (512)\nReg3: b'00000000000000000111110011110001 (31985)\n") + std::string("Reg4: b'00000000000000000000000000000000 (0)\nReg5: b'00000000000000000000000000000000 (0)\n");
121
124 std::stringstream testmaker;
125 testmaker << test;
126 BOOST_CHECK_EQUAL(testmaker.str() == reference, true);
127}
128
129} // namespace emcal
130
131} // namespace o2
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
CCDB container for TRU DCS data in EMCAL.
void setL0SEL(uint64_t la)
uint64_t getSELPF() const
uint64_t getGTHRL0() const
uint64_t getRLBKSTU() const
uint64_t getL0COSM() const
void setL0COSM(uint64_t lc)
void setGTHRL0(uint64_t lg)
uint32_t getMaskReg(int pos) const
void setFw(uint64_t fw)
void setSELPF(uint64_t pf)
void setRLBKSTU(uint64_t rb)
uint64_t getL0SEL() const
uint64_t getFw() const
void setMaskReg(uint32_t msk, int pos)
GLint reference
Definition glcorearb.h:5487
GLint ref
Definition glcorearb.h:291
BOOST_AUTO_TEST_CASE(asynch_schedule_test)
void ConfigureReference(TriggerSTUDCS &testobject)
Apply reference configuration Reference configuration taken from pp 2016.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
FIXME: do not use data model tables.
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())