21 return StatusCode::SUCCESS;
26 ATH_MSG_DEBUG(
"Preparing input test vector from " << inputFile);
29 if (inputFile.find(
".txt") == std::string::npos && inputFile.find(
".bin") == std::string::npos)
32 return StatusCode::FAILURE;
39 if (inputFile.find(
".txt") != std::string::npos)
41 std::ifstream
file(inputFile, std::ios::in);
45 return StatusCode::FAILURE;
49 while (
file >> std::hex >> cache)
51 testVector.push_back(cache);
59 std::ifstream
file(inputFile, std::ios::binary);
63 return StatusCode::FAILURE;
67 while (
file.read(
reinterpret_cast<char *
>(&cache),
sizeof(uint64_t)))
70 cache = __builtin_bswap64(cache);
71 testVector.push_back(cache);
78 return StatusCode::SUCCESS;
85 std::vector<uint64_t>::size_type size = -1;
87 if (tv_1.size() != tv_2.size())
89 ATH_MSG_WARNING(
"The two test vectors have different sizes: " << tv_1.size() <<
" and " << tv_2.size());
91 size = tv_1.size() < tv_2.size() ? tv_1.size() : tv_2.size();
95 ATH_MSG_DEBUG(
"The two test vectors have the same size: " << tv_1.size());
100 for (std::vector<uint64_t>::size_type i = 0; i < size; i++)
102 if (tv_1[i] != tv_2[i])
104 ATH_MSG_DEBUG(
"The two test vectors are different at index " << i);
118 return StatusCode::SUCCESS;
123 ATH_MSG_DEBUG(
"Comparing the FPGA output to the reference vector for " << tvHolder.
name);
125 std::vector<uint64_t>::size_type size = -1;
127 if (tvHolder.
refTV.size() != tv_comp.size())
129 ATH_MSG_WARNING(
"The two test vectors have different sizes: " << tvHolder.
refTV.size() <<
" and " << tv_comp.size());
131 size = tvHolder.
refTV.size() < tv_comp.size() ? tvHolder.
refTV.size() : tv_comp.size();
136 size = tvHolder.
refTV.size();
140 for (std::vector<uint64_t>::size_type i = 0; i < size; i++)
142 if (tvHolder.
refTV[i] != tv_comp[i])
144 ATH_MSG_DEBUG(
"The two test vectors are different at index " << i);
158 return StatusCode::SUCCESS;
180 unsigned int isLast = 0;
181 for (
unsigned int i = 0; i < pixelClusters->
size(); i++)
192 uint64_t rdoList[4] = {0, 0, 0, 0};
194 unsigned int rdoListSize = pixelClusters->
at(i)->
rdoList().size();
195 rdoListSize = rdoListSize > 4 ? 4 : rdoListSize;
196 for (
unsigned int j = 0; j < rdoListSize; j++)
198 rdoList[j] = pixelClusters->
at(i)->
rdoList().at(j).get_compact();
245 isLast = i == (pixelClusters->
size() - 1) ? 1 : 0;
266 return StatusCode::SUCCESS;
288 unsigned int isLast = 0;
289 for (
unsigned int i = 0; i < stripClusters->
size(); i++)
300 uint64_t rdoList[4] = {0, 0, 0, 0};
302 unsigned int rdoListSize = stripClusters->
at(i)->
rdoList().size();
303 rdoListSize = rdoListSize > 4 ? 4 : rdoListSize;
304 for (
unsigned int j = 0; j < rdoListSize; j++)
306 rdoList[j] = stripClusters->
at(i)->
rdoList().at(j).get_compact();
344 isLast = i == (stripClusters->
size() - 1) ? 1 : 0;
364 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.
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.
int computeTotalToT(const SG::AuxElement &cluster)
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