1 #ifndef HcalCondObjectContainer_h 2 #define HcalCondObjectContainer_h 78 typedef std::pair<std::string, std::vector<Item> >
tHcalCont;
109 template <
class Item>
112 template <
class Item>
119 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
120 HBcontainer.push_back(emptyItem);
123 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
124 HEcontainer.push_back(emptyItem);
127 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
128 HOcontainer.push_back(emptyItem);
131 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
132 HFcontainer.push_back(emptyItem);
135 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
136 HTcontainer.push_back(emptyItem);
140 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
141 CALIBcontainer.push_back(emptyItem);
149 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
150 CASTORcontainer.push_back(emptyItem);
152 for (
unsigned int i = 0;
i < sizeFor(fId);
i++)
153 ZDCcontainer.push_back(emptyItem);
158 template <
class Item>
160 unsigned int index = indexFor(fId);
162 const Item* cell =
nullptr;
164 if (
index < 0xFFFFFFFu) {
168 if (
index < HBcontainer.size())
169 cell = &(HBcontainer.at(
index));
172 if (
index < HEcontainer.size())
173 cell = &(HEcontainer.at(
index));
176 if (
index < HFcontainer.size())
177 cell = &(HFcontainer.at(
index));
180 if (
index < HOcontainer.size())
181 cell = &(HOcontainer.at(
index));
184 if (
index < HTcontainer.size())
185 cell = &(HTcontainer.at(
index));
189 cell = &(CALIBcontainer.at(
index));
196 if (
index < CASTORcontainer.size())
197 cell = &(CASTORcontainer.at(
index));
199 if (
index < ZDCcontainer.size())
200 cell = &(ZDCcontainer.at(
index));
208 <<
"Unavailable Conditions of type " << myname() <<
" for cell " << textForId(fId);
213 <<
"Requested conditions of type " << myname() <<
" for cell " << textForId(fId)
214 <<
" got conditions for cell " << textForId(
DetId(cell->rawId()));
222 template <
class Item>
224 const Item* cell = getValues(fId,
false);
233 template <
class Item>
236 DetId fId(myItem.rawId());
237 unsigned int index = indexFor(fId);
239 Item* cell =
nullptr;
241 if (
index < 0xFFFFFFFu) {
245 if (HBcontainer.empty())
247 if (
index < HBcontainer.size())
248 cell = &(HBcontainer.at(
index));
251 if (HEcontainer.empty())
253 if (
index < HEcontainer.size())
254 cell = &(HEcontainer.at(
index));
257 if (HFcontainer.empty())
259 if (
index < HFcontainer.size())
260 cell = &(HFcontainer.at(
index));
263 if (HOcontainer.empty())
265 if (
index < HOcontainer.size())
266 cell = &(HOcontainer.at(
index));
269 if (HTcontainer.empty())
271 if (
index < HTcontainer.size())
272 cell = &(HTcontainer.at(
index));
276 if (CALIBcontainer.empty())
278 if (
index < CALIBcontainer.size())
279 cell = &(CALIBcontainer.at(
index));
287 if (CASTORcontainer.empty())
289 if (
index < CASTORcontainer.size())
290 cell = &(CASTORcontainer.at(
index));
292 if (ZDCcontainer.empty())
294 if (
index < ZDCcontainer.size())
295 cell = &(ZDCcontainer.at(
index));
300 if (cell !=
nullptr) {
307 <<
" no valid filling possible for Conditions of type " << myname() <<
" for DetId " << textForId(fId);
311 template <
class Item>
315 for (
unsigned int i = 0;
i < HBcontainer.size();
i++) {
316 if (emptyItem.rawId() != HBcontainer.at(
i).rawId())
319 for (
unsigned int i = 0;
i < HEcontainer.size();
i++) {
320 if (emptyItem.rawId() != HEcontainer.at(
i).rawId())
323 for (
unsigned int i = 0;
i < HOcontainer.size();
i++) {
324 if (emptyItem.rawId() != HOcontainer.at(
i).rawId())
327 for (
unsigned int i = 0;
i < HFcontainer.size();
i++) {
328 if (emptyItem.rawId() != HFcontainer.at(
i).rawId())
331 for (
unsigned int i = 0;
i < HTcontainer.size();
i++) {
332 if (emptyItem.rawId() != HTcontainer.at(
i).rawId())
335 for (
unsigned int i = 0;
i < ZDCcontainer.size();
i++) {
336 if (emptyItem.rawId() != ZDCcontainer.at(
i).rawId())
339 for (
unsigned int i = 0;
i < CALIBcontainer.size();
i++) {
340 if (emptyItem.rawId() != CALIBcontainer.at(
i).rawId())
343 for (
unsigned int i = 0;
i < CASTORcontainer.size();
i++) {
344 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
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)