ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArByteStream
src
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
11
Mon::Mon
(IMessageSvc* msgSvc)
12
:
headerMarker
(0xFF1234FF),
debugMarker
(0xDEADBEEF),
nStreams
(
NSTREAMS
),
streamNumber
(
STREAMNUMBER
),
13
m_logstr
(msgSvc,
"LArByteStream.Mon"
)
14
{}
15
16
void
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
24
void
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
38
void
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
43
void
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
48
void
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
61
void
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
66
void
Mon::fillTimeShift
(uint32_t word,
int
i) {
67
timeShift
[i] = word;
68
}
69
70
void
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
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
NSTREAMS
#define NSTREAMS
Definition
Mon.cxx:6
STREAMNUMBER
#define STREAMNUMBER
Definition
Mon.cxx:7
NBCS
#define NBCS
Definition
Mon.cxx:8
NACTIVESCS
#define NACTIVESCS
Definition
Mon.cxx:9
Mon.h
Tool to store LATOME mon header and footer data.
Mon::debugMarker
uint32_t debugMarker
Definition
Mon.h:41
Mon::region
int region
Definition
Mon.h:43
Mon::fillRegion
void fillRegion(uint32_t word)
Definition
Mon.cxx:24
Mon::headerMarker
uint32_t headerMarker
Definition
Mon.h:37
Mon::fillPacketInfo
void fillPacketInfo(uint32_t word)
Definition
Mon.cxx:16
Mon::fillNBCs
void fillNBCs(uint32_t word, int i)
Definition
Mon.cxx:61
Mon::packetSize
int packetSize
Definition
Mon.h:40
Mon::nPackets
int nPackets
Definition
Mon.h:38
Mon::fillNActiveSCs
void fillNActiveSCs(uint32_t word)
Definition
Mon.cxx:70
Mon::timeShift
std::array< uint32_t, 2 > timeShift
Definition
Mon.h:48
Mon::fillStreamNumber
void fillStreamNumber(uint32_t word)
Definition
Mon.cxx:43
Mon::fillNStreams
void fillNStreams(uint32_t word)
Definition
Mon.cxx:38
Mon::m_logstr
MsgStream m_logstr
Definition
Mon.h:54
Mon::streamNumber
int streamNumber
Definition
Mon.h:45
Mon::fillDataType
void fillDataType(uint32_t word, int i)
Definition
Mon.cxx:48
Mon::fillTimeShift
void fillTimeShift(uint32_t word, int i)
Definition
Mon.cxx:66
Mon::dataType
std::array< int, 2 > dataType
Definition
Mon.h:46
Mon::Mon
Mon(IMessageSvc *msgSvc)
Definition
Mon.cxx:11
Mon::nActiveSCs
int nActiveSCs
Definition
Mon.h:49
Mon::packetIndex
int packetIndex
Definition
Mon.h:39
Mon::nBCs
std::array< int, 2 > nBCs
Definition
Mon.h:47
Mon::nStreams
int nStreams
Definition
Mon.h:44
Generated on
for ATLAS Offline Software by
1.17.0