20 return StatusCode::SUCCESS;
25 ATH_MSG_DEBUG(
"Preparing input test vector from " << inputFile);
28 if (inputFile.find(
".txt") == std::string::npos && inputFile.find(
".bin") == std::string::npos)
31 return StatusCode::FAILURE;
38 if (inputFile.find(
".txt") != std::string::npos)
40 std::ifstream
file(inputFile, std::ios::in);
44 return StatusCode::FAILURE;
48 while (
file >> std::hex >> cache)
50 testVector.push_back(cache);
58 std::ifstream
file(inputFile, std::ios::binary);
62 return StatusCode::FAILURE;
66 while (
file.read(
reinterpret_cast<char *
>(&cache),
sizeof(uint64_t)))
69 cache = __builtin_bswap64(cache);
70 testVector.push_back(cache);
77 return StatusCode::SUCCESS;
84 std::vector<uint64_t>::size_type size = -1;
86 if (tv_1.size() != tv_2.size())
88 ATH_MSG_WARNING(
"The two test vectors have different sizes: " << tv_1.size() <<
" and " << tv_2.size());
90 size = tv_1.size() < tv_2.size() ? tv_1.size() : tv_2.size();
94 ATH_MSG_DEBUG(
"The two test vectors have the same size: " << tv_1.size());
99 for (std::vector<uint64_t>::size_type i = 0; i < size; i++)
101 if (tv_1[i] != tv_2[i])
103 ATH_MSG_DEBUG(
"The two test vectors are different at index " << i);
117 return StatusCode::SUCCESS;
122 ATH_MSG_DEBUG(
"Comparing the FPGA output to the reference vector for " << tvHolder.
name);
124 std::vector<uint64_t>::size_type size = -1;
126 if (tvHolder.
refTV.size() != tv_comp.size())
128 ATH_MSG_WARNING(
"The two test vectors have different sizes: " << tvHolder.
refTV.size() <<
" and " << tv_comp.size());
130 size = tvHolder.
refTV.size() < tv_comp.size() ? tvHolder.
refTV.size() : tv_comp.size();
135 size = tvHolder.
refTV.size();
139 for (std::vector<uint64_t>::size_type i = 0; i < size; i++)
141 if (tvHolder.
refTV[i] != tv_comp[i])
143 ATH_MSG_DEBUG(
"The two test vectors are different at index " << i);
157 return StatusCode::SUCCESS;
179 unsigned int isLast = 0;
180 for (
unsigned int i = 0; i < pixelClusters->
size(); i++)
191 uint64_t rdoList[4] = {0, 0, 0, 0};
193 unsigned int rdoListSize = pixelClusters->
at(i)->
rdoList().size();
194 rdoListSize = rdoListSize > 4 ? 4 : rdoListSize;
195 for (
unsigned int j = 0; j < rdoListSize; j++)
197 rdoList[j] = pixelClusters->
at(i)->
rdoList().at(j).get_compact();
244 isLast = i == (pixelClusters->
size() - 1) ? 1 : 0;
265 return StatusCode::SUCCESS;
287 unsigned int isLast = 0;
288 for (
unsigned int i = 0; i < stripClusters->
size(); i++)
299 uint64_t rdoList[4] = {0, 0, 0, 0};
301 unsigned int rdoListSize = stripClusters->
at(i)->
rdoList().size();
302 rdoListSize = rdoListSize > 4 ? 4 : rdoListSize;
303 for (
unsigned int j = 0; j < rdoListSize; j++)
305 rdoList[j] = stripClusters->
at(i)->
rdoList().at(j).get_compact();
343 isLast = i == (stripClusters->
size() - 1) ? 1 : 0;
363 return StatusCode::SUCCESS;
#define ATH_MSG_WARNING(x)
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions,...
const std::vector< Identifier > rdoList() const
Returns the list of identifiers of the channels building the cluster.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
int channelsInEta() const
float widthInEta() const
Returns the width of the cluster in phi (x) and eta (y) directions, respectively.
int totalToT() const
Returns the sum of the ToTs of the channels building the cluster.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the strip cluster.
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x), respectively.
const std::vector< Identifier > rdoList() const
Returns the list of identifiers of the channels building the cluster.
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash)
DetectorIdentType identifier() const
Returns the full Identifier of the measurement.
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
PixelClusterContainer_v1 PixelClusterContainer
Define the version of the pixel cluster container.
StripClusterContainer_v1 StripClusterContainer
Define the version of the strip cluster container.
std::vector< uint64_t > refTV