1 #ifndef CondFormats_HcalObjects_HcalItemCollById_h
2 #define CondFormats_HcalObjects_HcalItemCollById_h
26 template<
typename Item>
39 const unsigned detIdTransformCode,
40 std::unique_ptr<Item> defaultItem)
49 " invalid lookup table");
55 maxIndex >=
coll_.size())
57 " collection and lookup table are inconsistent");
66 {
default_ = boost::shared_ptr<Item>(f.release());}
69 inline std::size_t
size()
const {
return coll_.size();}
84 if (index <
coll_.size())
return coll_.get(index);
99 "In HcalItemCollById::at: invalid detector id");
131 friend class boost::serialization::access;
133 template<
class Archive>
142 namespace serialization {
143 template<
typename Item>
146 BOOST_STATIC_CONSTANT(
int,
value = 1);
151 #endif // CondFormats_HcalObjects_HcalItemCollById_h
unsigned getIndex(const HcalDetId &id) const
HcalItemColl< Item > coll_
void serialize(Archive &ar, unsigned)
boost::shared_ptr< Item > default_
unsigned largestIndex() const
const Item * getByIndex(const unsigned index) const
const Item * getDefault() const
const Item & at(const HcalDetId &id) const
HcalItemCollById(const HcalItemColl< Item > &coll, const HcalIndexLookup &indexLookupTable, const unsigned detIdTransformCode, std::unique_ptr< Item > defaultItem)
virtual ~HcalItemCollById()
virtual bool isEqual(const AbsHcalAlgoData &other) const override
unsigned find(unsigned detId) const
void setDefault(std::unique_ptr< Item > f)
static const unsigned InvalidIndex