ATLAS Offline Software
Loading...
Searching...
No Matches
Mon.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#include "LArByteStream/Mon.h"
5
6#define NSTREAMS 62
7#define STREAMNUMBER 0
8#define NBCS 32
9#define NACTIVESCS 320
10
11Mon::Mon(IMessageSvc* msgSvc)
13 m_logstr(msgSvc, "LArByteStream.Mon")
14{}
15
16void Mon::fillPacketInfo(uint32_t word) {
17 nPackets = static_cast<int>((word & 0xff000000) >> 24);
18 packetIndex = static_cast<int>((word & 0xff0000) >> 16);
19 uint16_t sizeInBytes = static_cast<uint16_t>(word & 0xffff);
20 if (sizeInBytes % 4) m_logstr << MSG::ERROR << "ERROR: Packet size written in the mon header is not multiple of 4 (cannot be converted from [bytes] to [32 bit words])" << endmsg;
21 else packetSize = static_cast<int>(sizeInBytes / 4);
22}
23
24void Mon::fillRegion(uint32_t word) {
25 region = static_cast<int>(word);
26 switch (region) {
27 case 0: return;
28 case 1: return;
29 case 2: return;
30 case 3: return;
31 case 4: return;
32 case 5: return;
33 default:
34 m_logstr << MSG::ERROR << "Unknown calorimeter region word in mon header." << endmsg;
35 }
36}
37
38void Mon::fillNStreams(uint32_t word) {
39 nStreams = static_cast<int>(word);
40 if (nStreams != NSTREAMS) m_logstr << MSG::ERROR << "Number of streams word in mon header is not the standard one." << endmsg;
41}
42
43void Mon::fillStreamNumber(uint32_t word) {
44 streamNumber = static_cast<int>(word);
45 if (streamNumber != STREAMNUMBER) m_logstr << MSG::ERROR << "Stream number word in mon header is not the standard " << endmsg;
46}
47
48void Mon::fillDataType(uint32_t word, int i) {
49 dataType[i] = static_cast<int>(word);
50 switch (dataType[i]) {
51 case 0: return;
52 case 1: return;
53 case 2: return;
54 case 3: return;
55 case 0xff: return;
56 default:
57 m_logstr << MSG::ERROR << "Unknown calorimeter region word in mon header." << endmsg;
58 }
59}
60
61void Mon::fillNBCs(uint32_t word, int i) {
62 nBCs[i] = static_cast<int>(word);
63 if (nBCs[i] != NBCS) m_logstr << MSG::ERROR << "Number of BCs word in mon header is not the standard one." << endmsg;
64}
65
66void Mon::fillTimeShift(uint32_t word, int i) {
67 timeShift[i] = word;
68}
69
70void Mon::fillNActiveSCs(uint32_t word) {
71 nActiveSCs = static_cast<int>(word);
72 if (nActiveSCs != NACTIVESCS) m_logstr << MSG::ERROR << "Number of BCs word in mon header is not the standard one." << endmsg;
73}
#define endmsg
#define NSTREAMS
Definition Mon.cxx:6
#define STREAMNUMBER
Definition Mon.cxx:7
#define NBCS
Definition Mon.cxx:8
#define NACTIVESCS
Definition Mon.cxx:9
Tool to store LATOME mon header and footer data.
uint32_t debugMarker
Definition Mon.h:41
int region
Definition Mon.h:43
void fillRegion(uint32_t word)
Definition Mon.cxx:24
uint32_t headerMarker
Definition Mon.h:37
void fillPacketInfo(uint32_t word)
Definition Mon.cxx:16
void fillNBCs(uint32_t word, int i)
Definition Mon.cxx:61
int packetSize
Definition Mon.h:40
int nPackets
Definition Mon.h:38
void fillNActiveSCs(uint32_t word)
Definition Mon.cxx:70
std::array< uint32_t, 2 > timeShift
Definition Mon.h:48
void fillStreamNumber(uint32_t word)
Definition Mon.cxx:43
void fillNStreams(uint32_t word)
Definition Mon.cxx:38
MsgStream m_logstr
Definition Mon.h:54
int streamNumber
Definition Mon.h:45
void fillDataType(uint32_t word, int i)
Definition Mon.cxx:48
void fillTimeShift(uint32_t word, int i)
Definition Mon.cxx:66
std::array< int, 2 > dataType
Definition Mon.h:46
Mon(IMessageSvc *msgSvc)
Definition Mon.cxx:11
int nActiveSCs
Definition Mon.h:49
int packetIndex
Definition Mon.h:39
std::array< int, 2 > nBCs
Definition Mon.h:47
int nStreams
Definition Mon.h:44