1 #ifndef HcalCondObjectContainer_h 2 #define HcalCondObjectContainer_h 80 typedef std::pair<std::string, std::vector<Item> >
tHcalCont;
111 template <
class Item>
114 template <
class Item>
121 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
122 HBcontainer.push_back(emptyItem);
125 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
126 HEcontainer.push_back(emptyItem);
129 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
130 HOcontainer.push_back(emptyItem);
133 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
134 HFcontainer.push_back(emptyItem);
137 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
138 HTcontainer.push_back(emptyItem);
142 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
143 CALIBcontainer.push_back(emptyItem);
151 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
152 CASTORcontainer.push_back(emptyItem);
154 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
155 ZDCcontainer.push_back(emptyItem);
160 template <
class Item>
162 unsigned int index = indexFor(fId);
164 const Item* cell =
nullptr;
166 if (
index < 0xFFFFFFFu) {
170 if (
index < HBcontainer.size())
171 cell = &(HBcontainer.at(
index));
174 if (
index < HEcontainer.size())
175 cell = &(HEcontainer.at(
index));
178 if (
index < HFcontainer.size())
179 cell = &(HFcontainer.at(
index));
182 if (
index < HOcontainer.size())
183 cell = &(HOcontainer.at(
index));
186 if (
index < HTcontainer.size())
187 cell = &(HTcontainer.at(
index));
191 cell = &(CALIBcontainer.at(
index));
198 if (
index < CASTORcontainer.size())
199 cell = &(CASTORcontainer.at(
index));
201 if (
index < ZDCcontainer.size())
202 cell = &(ZDCcontainer.at(
index));
210 <<
"Unavailable Conditions of type " << myname() <<
" for cell " << textForId(fId);
215 <<
"Requested conditions of type " << myname() <<
" for cell " << textForId(fId)
216 <<
" got conditions for cell " << textForId(
DetId(cell->rawId()));
224 template <
class Item>
226 const Item* cell = getValues(fId,
false);
235 template <
class Item>
238 DetId fId(myItem.rawId());
239 unsigned int index = indexFor(fId);
241 Item* cell =
nullptr;
243 if (
index < 0xFFFFFFFu) {
247 if (HBcontainer.empty())
249 if (
index < HBcontainer.size())
250 cell = &(HBcontainer.at(
index));
253 if (HEcontainer.empty())
255 if (
index < HEcontainer.size())
256 cell = &(HEcontainer.at(
index));
259 if (HFcontainer.empty())
261 if (
index < HFcontainer.size())
262 cell = &(HFcontainer.at(
index));
265 if (HOcontainer.empty())
267 if (
index < HOcontainer.size())
268 cell = &(HOcontainer.at(
index));
271 if (HTcontainer.empty())
273 if (
index < HTcontainer.size())
274 cell = &(HTcontainer.at(
index));
278 if (CALIBcontainer.empty())
280 if (
index < CALIBcontainer.size())
281 cell = &(CALIBcontainer.at(
index));
289 if (CASTORcontainer.empty())
291 if (
index < CASTORcontainer.size())
292 cell = &(CASTORcontainer.at(
index));
294 if (ZDCcontainer.empty())
296 if (
index < ZDCcontainer.size())
297 cell = &(ZDCcontainer.at(
index));
302 if (cell !=
nullptr) {
309 <<
" no valid filling possible for Conditions of type " << myname() <<
" for DetId " << textForId(fId);
313 template <
class Item>
317 for (
unsigned int i = 0;
i < HBcontainer.size();
i++) {
318 if (emptyItem.rawId() != HBcontainer.at(
i).rawId())
321 for (
unsigned int i = 0;
i < HEcontainer.size();
i++) {
322 if (emptyItem.rawId() != HEcontainer.at(
i).rawId())
325 for (
unsigned int i = 0;
i < HOcontainer.size();
i++) {
326 if (emptyItem.rawId() != HOcontainer.at(
i).rawId())
329 for (
unsigned int i = 0;
i < HFcontainer.size();
i++) {
330 if (emptyItem.rawId() != HFcontainer.at(
i).rawId())
333 for (
unsigned int i = 0;
i < HTcontainer.size();
i++) {
334 if (emptyItem.rawId() != HTcontainer.at(
i).rawId())
337 for (
unsigned int i = 0;
i < ZDCcontainer.size();
i++) {
338 if (emptyItem.rawId() != ZDCcontainer.at(
i).rawId())
341 for (
unsigned int i = 0;
i < CALIBcontainer.size();
i++) {
342 if (emptyItem.rawId() != CALIBcontainer.at(
i).rawId())
345 for (
unsigned int i = 0;
i < CASTORcontainer.size();
i++) {
346 if (emptyItem.rawId() != CASTORcontainer.at(
i).rawId())
bool hcalEqualDetId(Item *cell, const DetId &fId)
virtual std::string myname() const
HcalCondObjectContainerBase(HcalCondObjectContainerBase const &o)
const HcalTopology * topo_
std::vector< Item > HEcontainer
HcalOtherSubdetector extractOther(const DetId &id) const
std::vector< Item > HBcontainer
uint32_t kSizeForDenseIndexing_
virtual ~HcalCondObjectContainer()
std::vector< Item > CASTORcontainer
std::string textForId(const DetId &id) const
constexpr Detector det() const
get the detector field from this detid
std::vector< tHcalCont > tAllContWithNames
unsigned int indexFor(DetId) const
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalTopology * topo() const
HcalCondObjectContainerBase & operator=(HcalCondObjectContainerBase const &o)
bool exists(DetId fId) const
std::vector< DetId > getAllChannels() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< Item > ZDCcontainer
static const int SubdetectorId
HcalCondObjectContainer(const HcalTopology *topo)
const tAllContWithNames getAllContainers() const
#define COND_SERIALIZABLE
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
int getCreatorPackedIndexVersion() const
static constexpr int32_t SubdetectorId
std::vector< Item > CALIBcontainer
unsigned int sizeFor(DetId) const
void initContainer(DetId container)
bool addValues(const Item &myItem)
std::pair< std::string, std::vector< Item > > tHcalCont
std::vector< Item > HFcontainer
void setTopo(const HcalTopology *topo)