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