ATLAS Offline Software
Loading...
Searching...
No Matches
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
13class CaloCell;
14
23{
24public:
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;
32 typedef store_t::iterator iterator;
34
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;
120
123 const_iterator begin() const;
124 const_iterator end() const;
125 iterator begin();
126 iterator end();
128
131 const store_t& store() const;
132 store_t& store();
134
136 static std::string key(const std::string& pref);
137
138private:
139
142};
143
144//CLASS_DEF( CaloCellClusterWeights, 249044352, 1 )
145
148
151
152inline size_t CaloCellClusterWeights::size() const { return m_hashTable.size(); }
153inline size_t CaloCellClusterWeights::reserve() const { return m_hashTable.capacity(); }
154
157
158inline std::string CaloCellClusterWeights::key(const std::string& pref) { return pref+std::string("_CCW"); }
159#endif
macros to associate a CLID to a type
static Double_t * pref
bool check(size_t hash) const
Safe checking if cell is used by any cluster.
CaloCellClusterWeights()
Default constructor.
static std::string key(const std::string &pref)
Construct a SG key for this object.
std::tuple< bool, weight_t > value_t
Type of payload.
void reset()
Reset the store.
store_t::const_iterator const_iterator
Iterator type for const access.
store_t::iterator iterator
Iterator type.
bool fastCheck(size_t hash) const
Fast checking if cell is used by any cluster.
std::vector< double > weight_t
Type of weight.
size_t reserve() const
Reserved memory.
weight_t m_defaultValue
Default (empty) entry.
const_iterator begin() const
Constant access iterator pointing to beginning of the store.
const_iterator end() const
Constant iterator indicating the end of the store.
virtual ~CaloCellClusterWeights()
Destructor.
size_t size() const
Store size.
const store_t & store() const
Read-only access to underlying store.
const weight_t & at(size_t hash) const
Accessing value using function and hash.
store_t m_hashTable
Store implementation.
void clear()
Clear the store.
std::vector< value_t > store_t
Store type.
void set(size_t hash, double value)
const weight_t & operator[](size_t hash) const
Data object for each calorimeter readout cell.
Definition CaloCell.h:57