|
|
Go to the documentation of this file. 1 #ifndef CondFormats_HcalObjects_HcalItemArrayCollById_h
2 #define CondFormats_HcalObjects_HcalItemArrayCollById_h
26 template <
typename Item,
unsigned N>
39 const unsigned detIdTransformCode,
45 "In HcalItemArrayCollById constructor:"
46 " invalid lookup table");
53 "In HcalItemArrayCollById constructor:"
54 " collection and lookup table are inconsistent");
66 for (
unsigned i = 0;
i <
N; ++
i)
71 inline std::size_t
size()
const {
return coll_.size(); }
81 inline const Item*
getByIndex(
const unsigned itemIndex,
const unsigned arrayIndex)
const {
82 const Item*
f =
coll_.get(itemIndex, arrayIndex);
83 if (
f ==
nullptr && arrayIndex <
N)
90 inline const Item*
getDefault(
const unsigned arrayIndex)
const {
101 inline const Item*
get(
const HcalDetId&
id,
const unsigned arrayIndex)
const {
106 inline const Item&
at(
const HcalDetId&
id,
const unsigned arrayIndex)
const {
109 throw cms::Exception(
"In HcalItemArrayCollById::at: invalid detector id");
122 for (
unsigned j = 0;
j <
N; ++
j) {
125 const bool rd =
r.default_[
j].get();
145 template <
class Archive>
153 namespace serialization {
154 template <
typename Item,
unsigned N>
156 BOOST_STATIC_CONSTANT(
int,
value = 1);
161 #endif // CondFormats_HcalObjects_HcalItemArrayCollById_h
HcalItemArrayCollById(const HcalItemArrayColl< Item, N > &coll, const HcalIndexLookup &indexLookupTable, const unsigned detIdTransformCode, InputArray &defaultFunctors)
void setDefault(InputArray &arr)
const Item & at(const HcalDetId &id, const unsigned arrayIndex) const
virtual bool isEqual(const AbsHcalAlgoData &other) const override
const Item * getByIndex(const unsigned itemIndex, const unsigned arrayIndex) const
const Item * getDefault(const unsigned arrayIndex) const
boost::array< std::shared_ptr< Item >, N > StoredArray
virtual ~HcalItemArrayCollById()
unsigned largestIndex() const
static const unsigned InvalidIndex
unsigned getIndex(const HcalDetId &id) const
static constexpr unsigned arraySize()
unsigned find(unsigned detId) const
HcalItemArrayColl< Item, N >::InputArray InputArray
HcalItemArrayColl< Item, N > coll_
friend class boost::serialization::access
std::array< std::unique_ptr< Item >, N > InputArray
void serialize(Archive &ar, unsigned)
const Item * get(const HcalDetId &id, const unsigned arrayIndex) const