ATLAS Offline Software
|
Hash lookup of calibration weights for calorimeter cells. More...
#include <CaloCellClusterWeights.h>
Public Types | |
Storage and payload types | |
typedef std::vector< double > | weight_t |
Type of weight. More... | |
typedef std::tuple< bool, weight_t > | value_t |
Type of payload. More... | |
typedef std::vector< value_t > | store_t |
Store type. More... | |
typedef store_t::const_iterator | const_iterator |
Iterator type for const access. More... | |
typedef store_t::iterator | iterator |
Iterator type. More... | |
Public Member Functions | |||||
CaloCellClusterWeights () | |||||
Default constructor. More... | |||||
CaloCellClusterWeights (size_t size) | |||||
Constructor with client-defined size. More... | |||||
CaloCellClusterWeights (const CaloCellClusterWeights &cellClusterWeights) | |||||
Copy constructor. More... | |||||
virtual | ~CaloCellClusterWeights () | ||||
Destructor. More... | |||||
Random access to payload | |||||
Accessing value using operator
| |||||
const weight_t & | operator[] (size_t hash) const | ||||
const weight_t & | at (size_t hash) const | ||||
Accessing value using function and hash. More... | |||||
const weight_t & | at (const CaloCell *pCell) const | ||||
Accessing value using function and cell pointer. More... | |||||
bool | check (size_t hash) const | ||||
Safe checking if cell is used by any cluster. More... | |||||
bool | check (const CaloCell *pCell) const | ||||
Safe checking if cell is used by any cluster. More... | |||||
bool | fastCheck (size_t hash) const | ||||
Fast checking if cell is used by any cluster. More... | |||||
bool | fastCheck (const CaloCell *pCell) const | ||||
Fast checking if cell is used by any cluster. More... | |||||
Store modifiers | |||||
Loading a value by hash id This method overwrites the stored value at the given index. It also sets the "used" flag in the store for the cell.
| |||||
void | set (size_t hash, double value) | ||||
void | set (const CaloCell *pCell, double value) | ||||
Loading a value by cell pointer. More... | |||||
void | reset () | ||||
Reset the store. More... | |||||
void | clear () | ||||
Clear the store. More... | |||||
void | clear (size_t hash) | ||||
Clear a specific entry in the store. More... | |||||
Store parameters | |||||
size_t | size () const | ||||
Store size. More... | |||||
size_t | reserve () const | ||||
Reserved memory. More... | |||||
Iterators | |||||
const_iterator | begin () const | ||||
Constant access iterator pointing to beginning of the store. More... | |||||
const_iterator | end () const | ||||
Constant iterator indicating the end of the store. More... | |||||
iterator | begin () | ||||
Access iterator pointing to beginning of the store. More... | |||||
iterator | end () | ||||
Iterator indicating the end of the store. More... | |||||
Store access | |||||
const store_t & | store () const | ||||
Read-only access to underlying store. More... | |||||
store_t & | store () | ||||
Read/write access to underlying store. More... | |||||
Static Public Member Functions | |
static std::string | key (const std::string &pref) |
Construct a SG key for this object. More... | |
Private Attributes | |
store_t | m_hashTable |
Store implementation. More... | |
weight_t | m_defaultValue { weight_t() } |
Default (empty) entry. More... | |
Hash lookup of calibration weights for calorimeter cells.
This object wraps a random access lookup of calibration weights based on the hash id of a calorimeter cell. It is meant to provide these weights to several tools, thus e.g. reducing the number of searches for cells in topo-clusters.
The data object reserves a fixed memory segment sufficient to store one weight per cell, and is of a fixed size which is defaulted to the total number of calorimeter cells, but can also be set at construction.
Definition at line 22 of file CaloCellClusterWeights.h.
typedef store_t::const_iterator CaloCellClusterWeights::const_iterator |
Iterator type for const access.
Definition at line 31 of file CaloCellClusterWeights.h.
typedef store_t::iterator CaloCellClusterWeights::iterator |
Iterator type.
Definition at line 32 of file CaloCellClusterWeights.h.
typedef std::vector<value_t> CaloCellClusterWeights::store_t |
Store type.
Definition at line 30 of file CaloCellClusterWeights.h.
typedef std::tuple<bool,weight_t> CaloCellClusterWeights::value_t |
Type of payload.
Definition at line 29 of file CaloCellClusterWeights.h.
typedef std::vector<double> CaloCellClusterWeights::weight_t |
Type of weight.
Definition at line 28 of file CaloCellClusterWeights.h.
CaloCellClusterWeights::CaloCellClusterWeights | ( | ) |
Default constructor.
The constructed data object provides a reserved and sized store appropriate for the total number of cells in the calorimeter. The store is pre-filled with the default payload value (0).
Definition at line 18 of file CaloCellClusterWeights.cxx.
CaloCellClusterWeights::CaloCellClusterWeights | ( | size_t | size | ) |
Constructor with client-defined size.
A store with the specified size is created and pre-filled with the default payload value (0).
size | requested store size |
Definition at line 12 of file CaloCellClusterWeights.cxx.
CaloCellClusterWeights::CaloCellClusterWeights | ( | const CaloCellClusterWeights & | cellClusterWeights | ) |
|
virtualdefault |
Destructor.
const CaloCellClusterWeights::weight_t & CaloCellClusterWeights::at | ( | const CaloCell * | pCell | ) | const |
Accessing value using function and cell pointer.
hash | index (calorimeter cell hash id) |
Definition at line 33 of file CaloCellClusterWeights.cxx.
const CaloCellClusterWeights::weight_t & CaloCellClusterWeights::at | ( | size_t | hash | ) | const |
Accessing value using function and hash.
hash | index (calorimeter cell hash id) |
Definition at line 31 of file CaloCellClusterWeights.cxx.
|
inline |
Access iterator pointing to beginning of the store.
Definition at line 147 of file CaloCellClusterWeights.h.
|
inline |
Constant access iterator pointing to beginning of the store.
Definition at line 146 of file CaloCellClusterWeights.h.
Safe checking if cell is used by any cluster.
true
if cell is part of any cluster and has valid hash index Definition at line 39 of file CaloCellClusterWeights.cxx.
bool CaloCellClusterWeights::check | ( | size_t | hash | ) | const |
Safe checking if cell is used by any cluster.
true
if cell is part of any cluster and has valid hash index Definition at line 38 of file CaloCellClusterWeights.cxx.
void CaloCellClusterWeights::clear | ( | ) |
Clear the store.
All stored values are overwritten with the default payload value (0).
Definition at line 55 of file CaloCellClusterWeights.cxx.
void CaloCellClusterWeights::clear | ( | size_t | hash | ) |
Clear a specific entry in the store.
The value stored at the given index is overwritten with the default payload value (0).
hash | index in store |
Definition at line 56 of file CaloCellClusterWeights.cxx.
|
inline |
|
inline |
Constant iterator indicating the end of the store.
Definition at line 149 of file CaloCellClusterWeights.h.
Fast checking if cell is used by any cluster.
true
if cell is part of any cluster Definition at line 37 of file CaloCellClusterWeights.cxx.
bool CaloCellClusterWeights::fastCheck | ( | size_t | hash | ) | const |
Fast checking if cell is used by any cluster.
true
if cell is part of any cluster Definition at line 36 of file CaloCellClusterWeights.cxx.
|
inlinestatic |
const CaloCellClusterWeights::weight_t & CaloCellClusterWeights::operator[] | ( | size_t | hash | ) | const |
Definition at line 29 of file CaloCellClusterWeights.cxx.
|
inline |
void CaloCellClusterWeights::reset | ( | ) |
Reset the store.
All stored values are overwritten with the default payload value (0).
Definition at line 59 of file CaloCellClusterWeights.cxx.
Loading a value by cell pointer.
This method overwrites the stored value at the given index. It also sets the "used" flag in the store for the cell.
hash | index in store |
value | value to be stored at index |
Definition at line 53 of file CaloCellClusterWeights.cxx.
void CaloCellClusterWeights::set | ( | size_t | hash, |
double | value | ||
) |
Definition at line 41 of file CaloCellClusterWeights.cxx.
|
inline |
|
inline |
|
inline |
Default (empty) entry.
Definition at line 141 of file CaloCellClusterWeights.h.
|
private |
Store implementation.
Definition at line 140 of file CaloCellClusterWeights.h.