ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
LUCID
LUCID_Cnv
LUCID_RawDataByteStreamCnv
src
LUCID_RodEncoder.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LUCID_RawDataByteStreamCnv/LUCID_RodEncoder.h
"
6
7
LUCID_RodEncoder::LUCID_RodEncoder
() {}
8
9
LUCID_RodEncoder::~LUCID_RodEncoder
() {}
10
11
void
12
LUCID_RodEncoder::encode
(std::vector<uint32_t>& data_block,
13
LUCID_RodEncoder::Cache
& cache,
14
MsgStream& log)
const
15
{
16
17
VDIGIT::iterator digit_it = cache.Digits.begin();
18
VDIGIT::iterator digit_it_end = cache.Digits.end();
19
20
uint32_t data_word0 = 0;
21
uint32_t data_word1 = 0;
22
uint32_t data_word2 = 0;
23
uint32_t data_word3 = 0;
24
25
cache.hitcounter0 = 0;
26
cache.hitcounter1 = 0;
27
cache.hitcounter2 = 0;
28
cache.hitcounter3 = 0;
29
30
for
(; digit_it != digit_it_end; ++digit_it) {
31
32
unsigned
short
tubeID = (*digit_it)->getTubeID();
33
bool
isHit = (*digit_it)->isHit();
34
35
if
(tubeID < 16) {
36
data_word0 |= (isHit << (tubeID - 0));
37
cache.hitcounter0 += isHit;
38
}
else
if
(tubeID < 20) {
39
data_word2 |= (isHit << (tubeID - 16));
40
cache.hitcounter2 += isHit;
41
}
else
if
(tubeID < 36) {
42
data_word1 |= (isHit << (tubeID - 20));
43
cache.hitcounter1 += isHit;
44
}
else
if
(tubeID < 40) {
45
data_word3 |= (isHit << (tubeID - 36));
46
cache.hitcounter3 += isHit;
47
}
else
{
48
log << MSG::ERROR <<
" Unknown tubeID: "
<< tubeID <<
endmsg
;
49
}
50
}
51
52
data_word0 |= (cache.hitcounter0 << 24);
53
data_word1 |= (cache.hitcounter1 << 24);
54
data_word2 |= (cache.hitcounter2 << 24);
55
data_word3 |= (cache.hitcounter3 << 24);
56
57
data_block.push_back(data_word0);
58
data_block.push_back(data_word1);
59
data_block.push_back(data_word2);
60
data_block.push_back(data_word3);
61
62
cache.Digits.clear();
63
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
LUCID_RodEncoder.h
LUCID_RodEncoder::encode
void encode(std::vector< uint32_t > &data_block, Cache &cache, MsgStream &log) const
Definition
LUCID_RodEncoder.cxx:12
LUCID_RodEncoder::~LUCID_RodEncoder
~LUCID_RodEncoder()
Definition
LUCID_RodEncoder.cxx:9
LUCID_RodEncoder::LUCID_RodEncoder
LUCID_RodEncoder()
Definition
LUCID_RodEncoder.cxx:7
LUCID_RodEncoder::Cache
Definition
LUCID_RodEncoder.h:24
Generated on
for ATLAS Offline Software by
1.17.0