ATLAS Offline Software
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 
12  : headerMarker(0xFF1234FF), debugMarker(0xDEADBEEF), nStreams(NSTREAMS), streamNumber(STREAMNUMBER)
13 {}
14 
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 
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 
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 
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 
47 void 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 
60 void 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 
65 void Mon::fillTimeShift(uint32_t word, int i) {
66  timeShift[i] = word;
67 }
68 
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 }
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Mon::packetSize
int packetSize
Definition: Mon.h:39
Mon::fillNBCs
void fillNBCs(uint32_t word, int i)
Definition: Mon.cxx:60
Mon::Mon
Mon()
Definition: Mon.cxx:11
Mon::region
int region
Definition: Mon.h:42
Mon::dataType
std::array< int, 2 > dataType
Definition: Mon.h:45
Mon.h
Tool to store LATOME mon header and footer data.
Mon::fillStreamNumber
void fillStreamNumber(uint32_t word)
Definition: Mon.cxx:42
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
Mon::nActiveSCs
int nActiveSCs
Definition: Mon.h:48
Mon::fillTimeShift
void fillTimeShift(uint32_t word, int i)
Definition: Mon.cxx:65
Mon::nBCs
std::array< int, 2 > nBCs
Definition: Mon.h:46
STREAMNUMBER
#define STREAMNUMBER
Definition: Mon.cxx:7
Mon::nStreams
int nStreams
Definition: Mon.h:43
Mon::fillNStreams
void fillNStreams(uint32_t word)
Definition: Mon.cxx:37
NBCS
#define NBCS
Definition: Mon.cxx:8
Mon::nPackets
int nPackets
Definition: Mon.h:37
NACTIVESCS
#define NACTIVESCS
Definition: Mon.cxx:9
Mon::timeShift
std::array< uint32_t, 2 > timeShift
Definition: Mon.h:47
Mon::fillNActiveSCs
void fillNActiveSCs(uint32_t word)
Definition: Mon.cxx:69
Mon::fillPacketInfo
void fillPacketInfo(uint32_t word)
Definition: Mon.cxx:15
Mon::fillDataType
void fillDataType(uint32_t word, int i)
Definition: Mon.cxx:47
Mon::fillRegion
void fillRegion(uint32_t word)
Definition: Mon.cxx:23
Mon::streamNumber
int streamNumber
Definition: Mon.h:44
Mon::packetIndex
int packetIndex
Definition: Mon.h:38
NSTREAMS
#define NSTREAMS
Definition: Mon.cxx:6