ATLAS Offline Software
Functions
TrigPassBitsCnv_p1.cxx File Reference
#include "TrigSteeringEvent/TrigPassBits.h"
#include <cmath>
#include <iostream>
#include "TrigSteeringEventTPCnv/TrigPassBits_p1.h"
#include "TrigSteeringEventTPCnv/TrigPassBitsCnv_p1.h"
Include dependency graph for TrigPassBitsCnv_p1.cxx:

Go to the source code of this file.

Functions

void store_bits (const std::vector< bool > &bits, std::vector< uint32_t > &store)
 
void restore_bits (std::vector< bool > &bits, const std::vector< uint32_t > &store)
 
unsigned necessary_words (unsigned size)
 

Function Documentation

◆ necessary_words()

unsigned necessary_words ( unsigned  size)

Definition at line 52 of file TrigPassBitsCnv_p1.cxx.

52  {
53  return (size ? 1 : 0) + size/32;
54 }

◆ restore_bits()

void restore_bits ( std::vector< bool > &  bits,
const std::vector< uint32_t > &  store 
)

Definition at line 30 of file TrigPassBitsCnv_p1.cxx.

30  {
31  const unsigned word_count = store.size();
32  const unsigned bits_count = bits.size();
33 
34 
35  for ( unsigned word = 0; word < word_count; ++word) {
36  const uint32_t& temp(store[word]);
37 
38  for ( unsigned bit = 0; bit < 32; ++bit) {
39  const unsigned position = word*32+bit;
40  if (position >= bits_count )
41  return;
42 
43  if (temp & (1 << bit))
44  bits[position] = true;
45  else
46  bits[position] = false;
47  }
48  }
49 }

◆ store_bits()

void store_bits ( const std::vector< bool > &  bits,
std::vector< uint32_t > &  store 
)

Definition at line 13 of file TrigPassBitsCnv_p1.cxx.

13  {
14  const unsigned word_count = store.size();
15  const unsigned bits_count = bits.size();
16 
17  for ( unsigned word = 0; word < word_count; ++word) {
18  uint32_t& temp(store[word]);
19 
20  for ( unsigned bit = 0; bit < 32; ++bit) {
21  const unsigned position = word*32+bit;
22  if (position >= bits_count )
23  return;
24  if (bits[position])
25  temp |= (1 << bit);
26  }
27  }
28 }
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39