8#include <framework/logging/Logger.h>
9#include <tracking/dataobjects/FullSecID.h>
11#include <gtest/gtest.h>
35 bool subLayerID =
true;
36 unsigned short sectorID = 15;
43 EXPECT_EQ(vxdID, aFullSecID.
getVxdID());
45 EXPECT_EQ(vxdIDInt, aFullSecID.
getUniID());
47 EXPECT_EQ(sectorID, aFullSecID.
getSecID());
57 EXPECT_EQ(vxdID, anotherFullSecID.
getVxdID());
59 EXPECT_EQ(vxdIDInt, anotherFullSecID.
getUniID());
66 std::stringstream aSecIDString;
76 EXPECT_EQ(vxdID, aThirdFullSecID.
getVxdID());
78 EXPECT_EQ(vxdIDInt, aThirdFullSecID.
getUniID());
87 std::stringstream aSecIDString2;
96 EXPECT_EQ(vxdID, aFourthFullSecID.
getVxdID());
98 EXPECT_EQ(vxdIDInt, aFourthFullSecID.
getUniID());
100 EXPECT_EQ(
FullSecID(vxdID,
false, sectorID).getSecID(), aFourthFullSecID.
getSecID());
106 std::vector<FullSecID> testVector;
107 for (
int i = 0; i < 5; ++i) {
108 testVector.push_back(aFullSecID);
110 for (
auto aSecID : testVector) {
111 EXPECT_EQ(aFullSecID, aSecID);
121 bool subLayerID =
true;
122 unsigned short sectorID = 15;
124 std::stringstream aSecIDString;
131 EXPECT_EQ(
static_cast<unsigned int>(aFullSecID), aFullSecID2);
133 EXPECT_EQ(aSecIDString.str(), std::string(aFullSecID2));
135 EXPECT_EQ(aFullSecID, aFullSecID2);
138 std::stringstream aSecIDStream, aSecIDStream2;
139 aSecIDStream << aFullSecID2;
140 aSecIDStream2 << aSecIDString.str();
142 EXPECT_EQ(aSecIDString.str(), aSecIDStream.str());
146 EXPECT_GT(aFullSecID2, aFullSecID3);
148 for (
int l1 = 7; l1 != 0; --l1) {
153 EXPECT_GT(biggerOne, smallerOne);
155 for (
int s1 = 255; s1 != 0; --s1) {
160 EXPECT_GT(biggerOne, smallerOne);
161 int equalOne = smallerOne;
163 EXPECT_EQ(
int(biggerOne), equalOne);
166 EXPECT_GT(
int(aFullSecID2),
int(aFullSecID3));
171 EXPECT_EQ(aFullSecID4, aFullSecID);
178 B2WARNING(
"TODO: FullSecIDTest:bufferOverflowTest should catch cases of bad user input");
Testing everything from FullSecID.
Class to identify a sector inside of the VXD.
std::string getFullSecString() const
returns the FullSecID coded as string compatible to secIDs stored in the xml-sectormaps
VxdID getVxdID() const
returns VxdID of sensor.
unsigned int getFullSecID() const
returns the FullSecID coded as integer for further use (can be reconverted to FullSecID by using Full...
unsigned short int getUniID() const
returns uniID of sensor (basically the same as VxdID (can simply converted to vxdID(uniID)) but a tri...
short int getLayerID() const
returns LayerID compatible with basf2 standards.
bool getSubLayerID() const
returns SubLayerID which tells you whether it is useful to search for compatible sectors in the same ...
short int getSecID() const
returns SecID of current FullSecID (only unique for each sensor).
Class to uniquely identify a any structure of the PXD and SVD.
baseType getLayerNumber() const
Get the layer id.
Abstract base class for different kinds of events.