CbmRoot
Loading...
Searching...
No Matches
_GTestCbmTrdDetectorId_simple1.cxx
Go to the documentation of this file.
1/* Copyright (C) 2012 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5#include "CbmDetectorList.h"
6#include "CbmTrdDetectorId.h"
7
8#include "gtest/gtest-spi.h"
9#include "gtest/gtest.h"
10
11TEST(CbmTrdDetectorIdTest, CheckDefaultSettings)
12{
13 CbmTrdDetectorId fTrdId;
14
15 int32_t system = 0;
16 int32_t station = 0;
17 int32_t layer = 0;
18 int32_t moduleType = 0;
19 int32_t moduleNr = 0;
20 int32_t sector = 0;
21 int32_t detInfo_array[6] = {system, station, layer, moduleType, moduleNr, sector};
22
23 int32_t retVal = fTrdId.SetDetectorInfo(detInfo_array);
24 EXPECT_EQ(0, retVal);
25
26 detInfo_array[0] = kTRD;
27 detInfo_array[1] = 0;
28 detInfo_array[2] = 0;
29 detInfo_array[3] = 0;
30 detInfo_array[4] = 0;
31 detInfo_array[5] = 0;
32
33 retVal = fTrdId.SetDetectorInfo(detInfo_array);
34 EXPECT_EQ(5, retVal);
35
36 detInfo_array[0] = 0;
37 detInfo_array[1] = 1;
38 detInfo_array[2] = 0;
39 detInfo_array[3] = 0;
40 detInfo_array[4] = 0;
41 detInfo_array[5] = 0;
42
43 retVal = fTrdId.SetDetectorInfo(detInfo_array);
44 EXPECT_EQ(32, retVal);
45
46 detInfo_array[0] = 0;
47 detInfo_array[1] = 0;
48 detInfo_array[2] = 1;
49 detInfo_array[3] = 0;
50 detInfo_array[4] = 0;
51 detInfo_array[5] = 0;
52
53 retVal = fTrdId.SetDetectorInfo(detInfo_array);
54 EXPECT_EQ(512, retVal);
55
56 detInfo_array[0] = 0;
57 detInfo_array[1] = 0;
58 detInfo_array[2] = 0;
59 detInfo_array[3] = 1;
60 detInfo_array[4] = 0;
61 detInfo_array[5] = 0;
62
63 retVal = fTrdId.SetDetectorInfo(detInfo_array);
64 EXPECT_EQ(4096, retVal);
65
66 detInfo_array[0] = 0;
67 detInfo_array[1] = 0;
68 detInfo_array[2] = 0;
69 detInfo_array[3] = 0;
70 detInfo_array[4] = 1;
71 detInfo_array[5] = 0;
72
73 retVal = fTrdId.SetDetectorInfo(detInfo_array);
74 EXPECT_EQ(131072, retVal);
75
76 detInfo_array[0] = 0;
77 detInfo_array[1] = 0;
78 detInfo_array[2] = 0;
79 detInfo_array[3] = 0;
80 detInfo_array[4] = 0;
81 detInfo_array[5] = 1;
82
83 retVal = fTrdId.SetDetectorInfo(detInfo_array);
84 EXPECT_EQ(33554432, retVal);
85
86 detInfo_array[0] = kTRD;
87 detInfo_array[1] = 1;
88 detInfo_array[2] = 1;
89 detInfo_array[3] = 1;
90 detInfo_array[4] = 1;
91 detInfo_array[5] = 1;
92
93 retVal = fTrdId.SetDetectorInfo(detInfo_array);
94 EXPECT_EQ(33690149, retVal);
95
96 detInfo_array[0] = kTRD;
97 detInfo_array[1] = 3;
98 detInfo_array[2] = 3;
99 detInfo_array[3] = 2;
100 detInfo_array[4] = 34;
101 detInfo_array[5] = 3;
102
103 retVal = fTrdId.SetDetectorInfo(detInfo_array);
104 EXPECT_EQ(105129573, retVal);
105
106 detInfo_array[0] = 0;
107 detInfo_array[1] = 0;
108 detInfo_array[2] = 0;
109 detInfo_array[3] = 8;
110 detInfo_array[4] = 0;
111 detInfo_array[5] = 0;
112
113 retVal = fTrdId.SetDetectorInfo(detInfo_array);
114 EXPECT_EQ(32768, retVal);
115
116 detInfo_array[0] = kTRD;
117 detInfo_array[1] = 2;
118 detInfo_array[2] = 3;
119 detInfo_array[3] = 5;
120 detInfo_array[4] = 17;
121 detInfo_array[5] = 2;
122
123 retVal = fTrdId.SetDetectorInfo(detInfo_array);
124 EXPECT_EQ(69359173, retVal);
125}
TEST(CbmTrdDetectorIdTest, CheckDefaultSettings)