ATLAS Offline Software
Classes | Public Types | Public Member Functions | List of all members
LUCID_RodEncoder Class Reference

#include <LUCID_RodEncoder.h>

Collaboration diagram for LUCID_RodEncoder:

Classes

struct  Cache
 

Public Types

typedef std::vector< const LUCID_Digit * > VDIGIT
 

Public Member Functions

 LUCID_RodEncoder ()
 
 ~LUCID_RodEncoder ()
 
void addDigit (const LUCID_Digit *digit, Cache &cache) const
 
void encode (std::vector< uint32_t > &data_block, Cache &cache, MsgStream &log) const
 
const VDIGITgetDigits (Cache &cache) const
 

Detailed Description

Definition at line 19 of file LUCID_RodEncoder.h.

Member Typedef Documentation

◆ VDIGIT

Definition at line 22 of file LUCID_RodEncoder.h.

Constructor & Destructor Documentation

◆ LUCID_RodEncoder()

LUCID_RodEncoder::LUCID_RodEncoder ( )

Definition at line 7 of file LUCID_RodEncoder.cxx.

7 {}

◆ ~LUCID_RodEncoder()

LUCID_RodEncoder::~LUCID_RodEncoder ( )

Definition at line 9 of file LUCID_RodEncoder.cxx.

9 {}

Member Function Documentation

◆ addDigit()

void LUCID_RodEncoder::addDigit ( const LUCID_Digit digit,
Cache cache 
) const
inline

Definition at line 35 of file LUCID_RodEncoder.h.

36  {
37  cache.Digits.push_back(digit);
38  }

◆ encode()

void LUCID_RodEncoder::encode ( std::vector< uint32_t > &  data_block,
LUCID_RodEncoder::Cache cache,
MsgStream &  log 
) const

Definition at line 12 of file LUCID_RodEncoder.cxx.

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 }

◆ getDigits()

const VDIGIT& LUCID_RodEncoder::getDigits ( Cache cache) const
inline

Definition at line 43 of file LUCID_RodEncoder.h.

43 { return cache.Digits; }

The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
LUCID_RodEncoder::Cache::hitcounter1
unsigned int hitcounter1
Definition: LUCID_RodEncoder.h:26
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
LUCID_RodEncoder::Cache::Digits
VDIGIT Digits
Definition: LUCID_RodEncoder.h:29
LUCID_RodEncoder::Cache::hitcounter3
unsigned int hitcounter3
Definition: LUCID_RodEncoder.h:28
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LUCID_RodEncoder::Cache::hitcounter2
unsigned int hitcounter2
Definition: LUCID_RodEncoder.h:27
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LUCID_RodEncoder::Cache::hitcounter0
unsigned int hitcounter0
Definition: LUCID_RodEncoder.h:25