ATLAS Offline Software
CaloCellClusterWeights.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */
3 
4 #ifndef CALOEVENT_CALOCELLCLUSTERWEIGHTS_H
5 #define CALOEVENT_CALOCELLCLUSTERWEIGHTS_H
6 
8 
9 #include <string>
10 #include <vector>
11 #include <tuple>
12 
13 class CaloCell;
14 
23 {
24 public:
25 
28  typedef std::vector<double> weight_t;
29  typedef std::tuple<bool,weight_t> value_t;
30  typedef std::vector<value_t> store_t;
31  typedef store_t::const_iterator const_iterator;
33 
47  CaloCellClusterWeights(const CaloCellClusterWeights& cellClusterWeights);
50 
57  const weight_t& operator[](size_t hash) const;
62  const weight_t& at(size_t hash) const;
67  const weight_t& at(const CaloCell* pCell) const;
71  bool check(size_t hash) const;
75  bool check(const CaloCell* pCell) const;
79  bool fastCheck(size_t hash) const;
83  bool fastCheck(const CaloCell* pCell) const;
85 
93  void set(size_t hash,double value);
99  void set(const CaloCell* pCell,double value);
103  void reset();
107  void clear();
112  void clear(size_t hash);
114 
117  size_t size() const;
118  size_t reserve() const;
119 
123  const_iterator begin() const;
124  const_iterator end() const;
125  iterator begin();
126  iterator end();
127 
131  const store_t& store() const;
132  store_t& store();
133 
136  static std::string key(const std::string& pref);
137 
138 private:
139 
142 };
143 
144 //CLASS_DEF( CaloCellClusterWeights, 249044352, 1 )
145 
148 
151 
152 inline size_t CaloCellClusterWeights::size() const { return m_hashTable.size(); }
153 inline size_t CaloCellClusterWeights::reserve() const { return m_hashTable.capacity(); }
154 
157 
158 inline std::string CaloCellClusterWeights::key(const std::string& pref) { return pref+std::string("_CCW"); }
159 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
CaloCellClusterWeights::~CaloCellClusterWeights
virtual ~CaloCellClusterWeights()
Destructor.
CaloCellClusterWeights::m_hashTable
store_t m_hashTable
Store implementation.
Definition: CaloCellClusterWeights.h:140
CaloCellClusterWeights::iterator
store_t::iterator iterator
Iterator type.
Definition: CaloCellClusterWeights.h:32
CaloCellClusterWeights::reset
void reset()
Reset the store.
Definition: CaloCellClusterWeights.cxx:59
CaloCellClusterWeights::weight_t
std::vector< double > weight_t
Type of weight.
Definition: CaloCellClusterWeights.h:28
athena.value
value
Definition: athena.py:122
CaloCellClusterWeights::check
bool check(size_t hash) const
Safe checking if cell is used by any cluster.
Definition: CaloCellClusterWeights.cxx:38
CaloCellClusterWeights::store
const store_t & store() const
Read-only access to underlying store.
Definition: CaloCellClusterWeights.h:155
CaloCellClusterWeights::begin
const_iterator begin() const
Constant access iterator pointing to beginning of the store.
Definition: CaloCellClusterWeights.h:146
CaloCellClusterWeights::fastCheck
bool fastCheck(size_t hash) const
Fast checking if cell is used by any cluster.
Definition: CaloCellClusterWeights.cxx:36
CaloCellClusterWeights::set
void set(size_t hash, double value)
Definition: CaloCellClusterWeights.cxx:41
CaloCellClusterWeights::at
const weight_t & at(size_t hash) const
Accessing value using function and hash.
Definition: CaloCellClusterWeights.cxx:31
CaloCellClusterWeights::operator[]
const weight_t & operator[](size_t hash) const
Definition: CaloCellClusterWeights.cxx:29
CaloCellClusterWeights::store_t
std::vector< value_t > store_t
Store type.
Definition: CaloCellClusterWeights.h:30
CaloCellClusterWeights::key
static std::string key(const std::string &pref)
Construct a SG key for this object.
Definition: CaloCellClusterWeights.h:158
CaloCellClusterWeights::reserve
size_t reserve() const
Reserved memory.
Definition: CaloCellClusterWeights.h:153
CaloCellClusterWeights::size
size_t size() const
Store size.
Definition: CaloCellClusterWeights.h:152
CaloCellClusterWeights::value_t
std::tuple< bool, weight_t > value_t
Type of payload.
Definition: CaloCellClusterWeights.h:29
CaloCellClusterWeights::clear
void clear()
Clear the store.
Definition: CaloCellClusterWeights.cxx:55
CaloCellClusterWeights
Hash lookup of calibration weights for calorimeter cells.
Definition: CaloCellClusterWeights.h:23
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
CaloCellClusterWeights::const_iterator
store_t::const_iterator const_iterator
Iterator type for const access.
Definition: CaloCellClusterWeights.h:31
CaloCellClusterWeights::CaloCellClusterWeights
CaloCellClusterWeights()
Default constructor.
Definition: CaloCellClusterWeights.cxx:18
CaloCellClusterWeights::end
const_iterator end() const
Constant iterator indicating the end of the store.
Definition: CaloCellClusterWeights.h:149
CLASS_DEF.h
macros to associate a CLID to a type
CaloCellClusterWeights::m_defaultValue
weight_t m_defaultValue
Default (empty) entry.
Definition: CaloCellClusterWeights.h:141