44 m_ErrorSummary(eSummary)
49 int s8 =
sizeof(char);
50 if (s8 != 1 || s32 != 4 * s8 || s64 != 2 * s32) {
51 LogError(
"UnexpectedSizes") <<
" unexpected sizes: " 52 <<
" size of char is: " << s8 <<
", size of Word32 is: " << s32
53 <<
", size of Word64 is: " << s64 <<
", send exception";
97 bool moreHeaders =
true;
102 moreHeaders = headerStatus;
106 bool moreTrailers =
true;
108 while (moreTrailers) {
112 moreTrailers = trailerStatus;
122 bool skipROC =
false;
128 if (*(ew - 1) == 0) {
145 int convroc = nroc - 1;
149 std::map<CTPPSPixelFramePosition, CTPPSPixelROCInfo>::const_iterator mit;
157 if ((nlink != link) | (nroc !=
roc)) {
161 if ((
roc - 1) < maxRocIndex) {
172 if (nlink >= maxLinkIndex) {
176 }
else if ((nroc - 1) >= maxRocIndex) {
179 fmt::format(
"Id {0}, in link {1}, of FED {2} in DetId {3}", convroc, nlink,
fedId, iD));
188 if (rocp.
rawId() == 0) {
196 if ((*detDigis).empty())
197 (*detDigis).
data.reserve(32);
200 if (skipROC || rocp.
rawId() == 0)
210 if (!
isRun3 && (dcol < min_Dcol || dcol > max_Dcol || pxid < min_Pixid || pxid > max_Pixid)) {
212 "unphysical dcol and/or pxid",
213 fmt::format(
"fedId= {0}, nllink= {1}, convroc= {2}, adc= {3}, dcol= {4}, pxid= {5}, detId= {6}",
226 if (
isRun3 && (col < min_COL || col > max_COL || row < min_ROW || row > max_ROW)) {
228 fmt::format(
"fedId= {0}, nllink= {1}, convroc= {2}, adc= {3}, col= {4}, row= {5}, detId= {6}",
242 std::pair<int, int> rocPixel;
243 std::pair<int, int> modPixel;
246 rocPixel = std::make_pair(row,
col);
249 rocPixel = std::make_pair(dcol, pxid);
256 (*detDigis).data.emplace_back(modPixel.first, modPixel.second,
adc);
261 unsigned int lvl1_ID,
264 std::vector<PPSPixelIndex> iDdet2fed) {
265 std::map<int, vector<Word32> > words;
269 for (
auto const& im : digis) {
273 const DetDigis& detDigis = im.second;
274 for (
auto const&
it : detDigis) {
275 int nroc = 999, nlink = 999;
276 int rocPixelRow = -1, rocPixelColumn = -1, rocID = -1;
277 int modulePixelColumn =
it.column();
278 int modulePixelRow =
it.row();
284 unsigned int urocID = rocID;
287 auto range = std::equal_range(iDdet2fed.begin(), iDdet2fed.end(), myTest,
compare);
289 auto i =
range.first - iDdet2fed.begin();
290 nlink = iDdet2fed.at(
i).fedch;
291 nroc = iDdet2fed.at(
i).rocch + 1;
299 words[iDdet2fed.at(
i).fedid].push_back(
word);
305 words[iDdet2fed.at(
i).fedid].push_back(
word);
315 for (
auto const& feddata : words) {
316 int fedId = feddata.first;
320 if (words.find(
fedId)->second.size() % 2 != 0)
321 words[
fedId].emplace_back(0);
324 size_t dataSize = words.find(
fedId)->second.size() *
sizeof(
Word32);
327 dataSize += (nHeaders + nTrailers) *
sizeof(
Word64);
339 unsigned int nWord32InFed = words.find(
fedId)->second.size();
340 for (
unsigned int i = 0;
i < nWord32InFed;
i += 2) {
351 if (
word != reinterpret_cast<Word64*>(
rawData.data() + dataSize)) {
353 string s =
"** PROBLEM in CTPPSPixelDataFormatter !!!";
354 LogError(
"CTPPSPixelDataFormatter") <<
"** PROBLEM in CTPPSPixelDataFormatter!!!";
362 std::ostringstream
str;
363 str <<
"word64: " <<
reinterpret_cast<const std::bitset<64>&
>(
word);
Contains mappind data related to a ROC.
bool checkHeader(bool &errorsInEvent, int fedId, const Word64 *header, Errors &errors) const
bool checkCRC(bool &errorsInEvent, int fedId, const Word64 *trailer, Errors &errors) const
void setParameters(uint32_t du, int idInDU, int idLk)
bool checkTrailer(bool &errorsInEvent, int fedId, unsigned int nWords, const Word64 *trailer, Errors &errors) const
Log< level::Error, false > LogError
bool checkROC(bool &errorsInEvent, int fedId, uint32_t iD, const Word32 &errorWord, Errors &errors) const
reference find_or_insert(det_id_type id)
uint32_t iD
the symbolic id
static void set(unsigned char *trailer, uint32_t lenght, uint16_t crc, uint8_t evt_stat, uint8_t tts, bool moreTrailers=false)
Set all fields in the trailer.
void add(const std::string &message, const std::string &details="")
int transformToROC(const int col, const int row, int &rocId, int &colROC, int &rowROC) const
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
unsigned int cms_uint32_t
void setErrorStatus(bool errorStatus)
void conversionError(int fedId, uint32_t iD, const State &state, const Word32 &errorWord, Errors &errors) const
static constexpr Word32 dummyDetId
std::pair< int, int > toGlobalfromDcol(const std::pair< int, int > &rocPixel) const
static int DColumn(const int colROC)
uint16_t *__restrict__ uint16_t const *__restrict__ adc
std::pair< int, int > toGlobal(const std::pair< int, int > &rocPixel) const