ATLAS Offline Software
LUCID_RawData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // Coding of the RDO
9 // word0: LUCID-A - PMTs
10 // bits 0- 7: Connector A EPMC1 bits 0-7 (ordered)
11 // bits 8-15: Connector B EPMC1 bits 0-7 (ordered)
12 // bits 16-23: Connector C EPMC1 bits 0-7 (not used, always 0)
13 // bits 24-32: numer of bits set to 1: Counting of fired PMT side A
14 // word1: LUCID-C - PMTs
15 // bits 0- 7: Connector D EPMC1 bits 0-7 (ordered)
16 // bits 8-15: Connector E EPMC1 bits 0-7 (ordered)
17 // bits 16-23: Connector F EPMC1 bits 0-7 (not used, always 0)
18 // bits 24-32: numer of bits set to 1: Counting of fired PMT side C
19 // word2: LUCID-A - FIBERs
20 // bits 0- 7: Connector A EPMC1 bits 0-7 (ordered)
21 // bits 8-15: Connector B EPMC1 bits 0-7 (not used, always 0)
22 // bits 16-23: Connector C EPMC1 bits 0-7 (not used, always 0)
23 // bits 24-32: numer of bits set to 1: Counting of fired FIBERS side A
24 // word3: LUCID-C - FIBERs
25 // bits 0- 7: Connector D EPMC1 bits 0-7 (ordered)
26 // bits 8-15: Connector E EPMC1 bits 0-7 (not used, always 0)
27 // bits 16-23: Connector F EPMC1 bits 0-7 (not used, always 0)
28 // bits 24-32: numer of bits set to 1: Counting of fired FIBERS side C
30 
31 #ifndef LUCID_RAWDATA_H
32 #define LUCID_RAWDATA_H
33 
34 #include <vector>
35 #include <iostream>
36 #include <iomanip>
37 #include <stdint.h>
38 #include <sstream>
39 
41 
42  public:
43 
44  LUCID_RawData();
45  LUCID_RawData(const unsigned int word0,
46  const unsigned int word1,
47  const unsigned int word2,
48  const unsigned int word3,
49  const unsigned int word0p,
50  const unsigned int word1p,
51  const unsigned int word2p,
52  const unsigned int word3p,
53  const unsigned int word0n,
54  const unsigned int word1n,
55  const unsigned int word2n,
56  const unsigned int word3n,
57  const unsigned int status);
58 
59  LUCID_RawData(std::vector<uint32_t>& data_block);
60 
61  virtual ~LUCID_RawData();
62 
63  inline int getWord0() const { return m_word0; }
64  inline int getWord1() const { return m_word1; }
65  inline int getWord2() const { return m_word2; }
66  inline int getWord3() const { return m_word3; }
67 
68  inline int getWord0p() const { return m_word0p; }
69  inline int getWord1p() const { return m_word1p; }
70  inline int getWord2p() const { return m_word2p; }
71  inline int getWord3p() const { return m_word3p; }
72 
73  inline int getWord0n() const { return m_word0n; }
74  inline int getWord1n() const { return m_word1n; }
75  inline int getWord2n() const { return m_word2n; }
76  inline int getWord3n() const { return m_word3n; }
77 
78  inline int getStatus() const { return m_status; }
79 
80  inline void setWord0(uint32_t word) { m_word0 = word; }
81  inline void setWord1(uint32_t word) { m_word1 = word; }
82  inline void setWord2(uint32_t word) { m_word2 = word; }
83  inline void setWord3(uint32_t word) { m_word3 = word; }
84 
85  inline void setWord0p(uint32_t word) { m_word0p = word; }
86  inline void setWord1p(uint32_t word) { m_word1p = word; }
87  inline void setWord2p(uint32_t word) { m_word2p = word; }
88  inline void setWord3p(uint32_t word) { m_word3p = word; }
89 
90  inline void setWord0n(uint32_t word) { m_word0n = word; }
91  inline void setWord1n(uint32_t word) { m_word1n = word; }
92  inline void setWord2n(uint32_t word) { m_word2n = word; }
93  inline void setWord3n(uint32_t word) { m_word3n = word; }
94 
95  inline void setStatus(uint32_t status) { m_status = status; }
96 
97  inline std::vector<uint32_t> getDataBlock() const {
98 
99  std::vector<uint32_t> returnDB;
100 
101  returnDB.push_back(m_word0);
102  returnDB.push_back(m_word1);
103  returnDB.push_back(m_word2);
104  returnDB.push_back(m_word3);
105 
106  return returnDB;
107  }
108 
109  void encodeLumatMapping (void);
110  void decodeLumatMapping (void);
111  static int getLumatBitPosition (unsigned int tubeNumber) ;
112  bool isTubeFired (unsigned int tubeNumber, unsigned int bxID) const;
113 
114  inline int getNhitsPMTsideA () const { return (m_word0>>24); }
115  inline int getNhitsPMTsideC () const { return (m_word1>>24); }
116  inline int getNhitsFIBsideA () const { return (m_word2>>24); }
117  inline int getNhitsFIBsideC () const { return (m_word3>>24); }
118 
119  inline int getNhitsPMTsideAprevBX() const { return (m_word0p>>24); }
120  inline int getNhitsPMTsideCprevBX() const { return (m_word1p>>24); }
121  inline int getNhitsFIBsideAprevBX() const { return (m_word2p>>24); }
122  inline int getNhitsFIBsideCprevBX() const { return (m_word3p>>24); }
123 
124  inline int getNhitsPMTsideAnextBX() const { return (m_word0n>>24); }
125  inline int getNhitsPMTsideCnextBX() const { return (m_word1n>>24); }
126  inline int getNhitsFIBsideAnextBX() const { return (m_word2n>>24); }
127  inline int getNhitsFIBsideCnextBX() const { return (m_word3n>>24); }
128 
129  std::string str() const {
130 
131  std::ostringstream ost;
132 
133  ost << std::endl
134  << std::hex
135  << " word0 : " << m_word0 << std::endl
136  << " word1 : " << m_word1 << std::endl
137  << " word2 : " << m_word2 << std::endl
138  << " word3 : " << m_word3 << std::endl
139  << " word0p: " << m_word0p << std::endl
140  << " word1p: " << m_word1p << std::endl
141  << " word2p: " << m_word2p << std::endl
142  << " word3p: " << m_word3p << std::endl
143  << " word0n: " << m_word0n << std::endl
144  << " word1n: " << m_word1n << std::endl
145  << " word2n: " << m_word2n << std::endl
146  << " word3n: " << m_word3n << std::endl
147  << " status: " << m_status << std::endl
148  << std::dec
149  << " hitsPMTsideA: " << getNhitsPMTsideA() << std::endl
150  << " hitsPMTsideC: " << getNhitsPMTsideC() << std::endl
151  << " hitsFIBsideA: " << getNhitsFIBsideA() << std::endl
152  << " hitsFIBsideC: " << getNhitsFIBsideC() << std::endl
153  << " hitsPMTsideAprevBX: " << getNhitsPMTsideAprevBX() << std::endl
154  << " hitsPMTsideCprevBX: " << getNhitsPMTsideCprevBX() << std::endl
155  << " hitsFIBsideAprevBX: " << getNhitsFIBsideAprevBX() << std::endl
156  << " hitsFIBsideCprevBX: " << getNhitsFIBsideCprevBX() << std::endl
157  << " hitsPMTsideAnextBX: " << getNhitsPMTsideAnextBX() << std::endl
158  << " hitsPMTsideCnextBX: " << getNhitsPMTsideCnextBX() << std::endl
159  << " hitsFIBsideAnextBX: " << getNhitsFIBsideAnextBX() << std::endl
160  << " hitsFIBsideCnextBX: " << getNhitsFIBsideCnextBX() << std::endl;
161 
162  return ost.str();
163  }
164 
165  std::ostream& operator<<(std::ostream& os) { os << str(); return os; }
166 
167  private:
168 
169  unsigned int m_word0; // central BX
170  unsigned int m_word1; // central BX
171  unsigned int m_word2; // central BX
172  unsigned int m_word3; // central BX
173 
174  unsigned int m_word0p; // prevoius BX
175  unsigned int m_word1p; // prevoius BX
176  unsigned int m_word2p; // prevoius BX
177  unsigned int m_word3p; // prevoius BX
178 
179  unsigned int m_word0n; // next BX
180  unsigned int m_word1n; // next BX
181  unsigned int m_word2n; // next BX
182  unsigned int m_word3n; // next BX
183 
184  unsigned int m_status;
185 };
186 
187 #endif // LUCID_RAWDATA_H
LUCID_RawData::setStatus
void setStatus(uint32_t status)
Definition: LUCID_RawData.h:95
LUCID_RawData::m_word3p
unsigned int m_word3p
Definition: LUCID_RawData.h:177
LUCID_RawData::~LUCID_RawData
virtual ~LUCID_RawData()
Definition: LUCID_RawData.cxx:113
LUCID_RawData::getWord0
int getWord0() const
Definition: LUCID_RawData.h:63
LUCID_RawData::setWord0
void setWord0(uint32_t word)
Definition: LUCID_RawData.h:80
python.trigbs_prescaleL1.ost
ost
Definition: trigbs_prescaleL1.py:104
LUCID_RawData::getWord2p
int getWord2p() const
Definition: LUCID_RawData.h:70
xAOD::word1
word1
Definition: eFexEMRoI_v1.cxx:82
LUCID_RawData::getNhitsPMTsideCnextBX
int getNhitsPMTsideCnextBX() const
Definition: LUCID_RawData.h:125
LUCID_RawData::setWord3n
void setWord3n(uint32_t word)
Definition: LUCID_RawData.h:93
LUCID_RawData::getWord2
int getWord2() const
Definition: LUCID_RawData.h:65
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LUCID_RawData::m_word2
unsigned int m_word2
Definition: LUCID_RawData.h:171
LUCID_RawData::m_word2n
unsigned int m_word2n
Definition: LUCID_RawData.h:181
LUCID_RawData::decodeLumatMapping
void decodeLumatMapping(void)
Definition: LUCID_RawData.cxx:205
LUCID_RawData::getStatus
int getStatus() const
Definition: LUCID_RawData.h:78
LUCID_RawData::setWord2n
void setWord2n(uint32_t word)
Definition: LUCID_RawData.h:92
LUCID_RawData::isTubeFired
bool isTubeFired(unsigned int tubeNumber, unsigned int bxID) const
Definition: LUCID_RawData.cxx:115
LUCID_RawData::setWord3
void setWord3(uint32_t word)
Definition: LUCID_RawData.h:83
LUCID_RawData::getWord1
int getWord1() const
Definition: LUCID_RawData.h:64
LUCID_RawData::m_word3
unsigned int m_word3
Definition: LUCID_RawData.h:172
LUCID_RawData::m_word0n
unsigned int m_word0n
Definition: LUCID_RawData.h:179
LUCID_RawData::m_word1
unsigned int m_word1
Definition: LUCID_RawData.h:170
LUCID_RawData::setWord0n
void setWord0n(uint32_t word)
Definition: LUCID_RawData.h:90
LUCID_RawData
Definition: LUCID_RawData.h:40
LUCID_RawData::getNhitsPMTsideAnextBX
int getNhitsPMTsideAnextBX() const
Definition: LUCID_RawData.h:124
LUCID_RawData::setWord2p
void setWord2p(uint32_t word)
Definition: LUCID_RawData.h:87
LUCID_RawData::m_word3n
unsigned int m_word3n
Definition: LUCID_RawData.h:182
LUCID_RawData::m_word1p
unsigned int m_word1p
Definition: LUCID_RawData.h:175
LUCID_RawData::m_word0
unsigned int m_word0
Definition: LUCID_RawData.h:169
LUCID_RawData::getWord3p
int getWord3p() const
Definition: LUCID_RawData.h:71
LUCID_RawData::str
std::string str() const
Definition: LUCID_RawData.h:129
LUCID_RawData::encodeLumatMapping
void encodeLumatMapping(void)
Definition: LUCID_RawData.cxx:281
LUCID_RawData::getNhitsFIBsideCnextBX
int getNhitsFIBsideCnextBX() const
Definition: LUCID_RawData.h:127
LUCID_RawData::getNhitsPMTsideAprevBX
int getNhitsPMTsideAprevBX() const
Definition: LUCID_RawData.h:119
LUCID_RawData::LUCID_RawData
LUCID_RawData()
Definition: LUCID_RawData.cxx:7
LUCID_RawData::getWord2n
int getWord2n() const
Definition: LUCID_RawData.h:75
LUCID_RawData::m_word2p
unsigned int m_word2p
Definition: LUCID_RawData.h:176
LUCID_RawData::setWord1n
void setWord1n(uint32_t word)
Definition: LUCID_RawData.h:91
LUCID_RawData::getNhitsFIBsideCprevBX
int getNhitsFIBsideCprevBX() const
Definition: LUCID_RawData.h:122
LUCID_RawData::operator<<
std::ostream & operator<<(std::ostream &os)
Definition: LUCID_RawData.h:165
LUCID_RawData::getWord3n
int getWord3n() const
Definition: LUCID_RawData.h:76
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
LUCID_RawData::getWord1p
int getWord1p() const
Definition: LUCID_RawData.h:69
LUCID_RawData::getNhitsFIBsideAprevBX
int getNhitsFIBsideAprevBX() const
Definition: LUCID_RawData.h:121
LUCID_RawData::m_word0p
unsigned int m_word0p
Definition: LUCID_RawData.h:174
LUCID_RawData::getWord0n
int getWord0n() const
Definition: LUCID_RawData.h:73
LUCID_RawData::m_status
unsigned int m_status
Definition: LUCID_RawData.h:184
LUCID_RawData::setWord0p
void setWord0p(uint32_t word)
Definition: LUCID_RawData.h:85
LUCID_RawData::getNhitsPMTsideC
int getNhitsPMTsideC() const
Definition: LUCID_RawData.h:115
LUCID_RawData::getNhitsPMTsideA
int getNhitsPMTsideA() const
Definition: LUCID_RawData.h:114
LUCID_RawData::getNhitsFIBsideC
int getNhitsFIBsideC() const
Definition: LUCID_RawData.h:117
LUCID_RawData::getNhitsFIBsideAnextBX
int getNhitsFIBsideAnextBX() const
Definition: LUCID_RawData.h:126
LUCID_RawData::setWord1
void setWord1(uint32_t word)
Definition: LUCID_RawData.h:81
LUCID_RawData::getDataBlock
std::vector< uint32_t > getDataBlock() const
Definition: LUCID_RawData.h:97
LUCID_RawData::getNhitsPMTsideCprevBX
int getNhitsPMTsideCprevBX() const
Definition: LUCID_RawData.h:120
LUCID_RawData::getLumatBitPosition
static int getLumatBitPosition(unsigned int tubeNumber)
Definition: LUCID_RawData.cxx:160
LUCID_RawData::getNhitsFIBsideA
int getNhitsFIBsideA() const
Definition: LUCID_RawData.h:116
merge.status
status
Definition: merge.py:17
LUCID_RawData::getWord1n
int getWord1n() const
Definition: LUCID_RawData.h:74
LUCID_RawData::setWord1p
void setWord1p(uint32_t word)
Definition: LUCID_RawData.h:86
LUCID_RawData::getWord3
int getWord3() const
Definition: LUCID_RawData.h:66
LUCID_RawData::m_word1n
unsigned int m_word1n
Definition: LUCID_RawData.h:180
LUCID_RawData::setWord3p
void setWord3p(uint32_t word)
Definition: LUCID_RawData.h:88
LUCID_RawData::setWord2
void setWord2(uint32_t word)
Definition: LUCID_RawData.h:82
LUCID_RawData::getWord0p
int getWord0p() const
Definition: LUCID_RawData.h:68