1 #ifndef CondFormats_HcalObjects_HcalItemArrayCollById_h 2 #define CondFormats_HcalObjects_HcalItemArrayCollById_h 26 template<
typename Item,
unsigned N>
41 const unsigned detIdTransformCode,
42 InputArray& defaultFunctors)
50 " invalid lookup table");
56 maxIndex >=
coll_.size())
58 " collection and lookup table are inconsistent");
71 for (
unsigned i=0;
i<
N; ++
i)
76 inline std::size_t
size()
const {
return coll_.size();}
86 const unsigned arrayIndex)
const 88 const Item*
f =
coll_.get(itemIndex, arrayIndex);
89 if (f ==
nullptr && arrayIndex <
N)
96 inline const Item*
getDefault(
const unsigned arrayIndex)
const 98 if (arrayIndex <
N)
return default_[arrayIndex].get();
107 const unsigned arrayIndex)
const 112 const unsigned arrayIndex)
const 116 "In HcalItemArrayCollById::at: invalid detector id");
131 for (
unsigned j=0; j<
N; ++j)
135 const bool rd = r.
default_[j].get();
155 template<
class Archive>
164 namespace serialization {
165 template<
typename Item,
unsigned N>
168 BOOST_STATIC_CONSTANT(
int,
value = 1);
173 #endif // CondFormats_HcalObjects_HcalItemArrayCollById_h
friend class boost::serialization::access
virtual ~HcalItemArrayCollById()
virtual bool isEqual(const AbsHcalAlgoData &other) const override
unsigned largestIndex() const
HcalItemArrayColl< Item, N > coll_
boost::array< boost::shared_ptr< Item >, N > StoredArray
unsigned getIndex(const HcalDetId &id) const
unsigned find(unsigned detId) const
std::array< std::unique_ptr< Item >, N > InputArray
void setDefault(InputArray &arr)
static const unsigned InvalidIndex
HcalItemArrayCollById(const HcalItemArrayColl< Item, N > &coll, const HcalIndexLookup &indexLookupTable, const unsigned detIdTransformCode, InputArray &defaultFunctors)
void serialize(Archive &ar, unsigned)
static unsigned arraySize()
const Item * getDefault(const unsigned arrayIndex) const
const Item * getByIndex(const unsigned itemIndex, const unsigned arrayIndex) const
const Item & at(const HcalDetId &id, const unsigned arrayIndex) const
HcalItemArrayColl< Item, N >::InputArray InputArray