1 #ifndef HcalCondObjectContainer_h
2 #define HcalCondObjectContainer_h
29 bool addValues(
const Item& myItem,
bool h2mode_=
false);
34 virtual std::string
myname()
const {
return (std::string)
"Hcal Undefined";}
37 typedef std::pair< std::string, std::vector<Item> >
tHcalCont;
80 template<
class Item>
void
112 template<
class Item>
const Item*
120 unsigned int index1 =
abs(index);
122 const Item* cell =
NULL;
126 if (index1 < HBcontainer.size())
127 cell = &(HBcontainer.at(index1) );
130 if (index1 < HEcontainer.size())
131 cell = &(HEcontainer.at(index1) );
134 if (index1 < HOcontainer.size())
135 cell = &(HOcontainer.at(index1) );
138 if (index1 < HFcontainer.size())
139 cell = &(HFcontainer.at(index1) );
142 if (index1 < HTcontainer.size())
143 cell = &(HTcontainer.at(index1) );
146 if (index1 < ZDCcontainer.size())
147 cell = &(ZDCcontainer.at(index1) );
150 if (index1 < CASTORcontainer.size())
151 cell = &(CASTORcontainer.at(index1) );
154 if (index1 < CALIBcontainer.size())
155 cell = &(CALIBcontainer.at(index1) );
162 if ((!cell) || (cell->rawId() != fId ) )
164 <<
"Unavailable Conditions of type " << myname() <<
" for cell " << myId;
168 template<
class Item>
const bool
175 if (index < 0)
return false;
176 unsigned int index1 =
abs(index);
177 const Item* cell =
NULL;
180 if (index1 < HBcontainer.size()) cell = &(HBcontainer.at(index1) );
183 if (index1 < HEcontainer.size()) cell = &(HEcontainer.at(index1) );
186 if (index1 < HOcontainer.size()) cell = &(HOcontainer.at(index1) );
189 if (index1 < HFcontainer.size()) cell = &(HFcontainer.at(index1) );
192 if (index1 < HTcontainer.size()) cell = &(HTcontainer.at(index1) );
195 if (index1 < ZDCcontainer.size()) cell = &(ZDCcontainer.at(index1) );
198 if (index1 < CASTORcontainer.size()) cell = &(CASTORcontainer.at(index1) );
201 if (index1 < CALIBcontainer.size()) cell = &(CALIBcontainer.at(index1) );
203 default:
return false;
break;
209 if (cell->rawId() == fId )
215 template<
class Item>
bool
218 unsigned long myRawId = myItem.rawId();
222 if (index < 0) success =
false;
223 unsigned int index1 =
abs(index);
227 if (!HBcontainer.size() ) initContainer(myId.
genericSubdet() );
228 if (index1 < HBcontainer.size())
230 HBcontainer.at(index1) = myItem;
235 if (!HEcontainer.size() ) initContainer(myId.
genericSubdet(), h2mode_ );
236 if (index1 < HEcontainer.size())
238 HEcontainer.at(index1) = myItem;
243 if (!HOcontainer.size() ) initContainer(myId.
genericSubdet() );
244 if (index1 < HOcontainer.size())
246 HOcontainer.at(index1) = myItem;
251 if (!HFcontainer.size() ) initContainer(myId.
genericSubdet() );
252 if (index1 < HFcontainer.size())
254 HFcontainer.at(index1) = myItem;
259 if (!HTcontainer.size() ) initContainer(myId.
genericSubdet() );
260 if (index1 < HTcontainer.size())
262 HTcontainer.at(index1) = myItem;
267 if (!ZDCcontainer.size() ) initContainer(myId.
genericSubdet() );
268 if (index1 < ZDCcontainer.size())
270 ZDCcontainer.at(index1) = myItem;
275 if (!CASTORcontainer.size() ) initContainer(myId.
genericSubdet() );
276 if (index1 < CASTORcontainer.size())
278 CASTORcontainer.at(index1) = myItem;
283 if (!CALIBcontainer.size() ) initContainer(myId.
genericSubdet() );
284 if (index1 < CALIBcontainer.size())
286 CALIBcontainer.at(index1) = myItem;
295 <<
" no valid filling possible for Conditions of type " << myname() <<
" for DetId " << myId;
299 template<
class Item> std::vector<DetId>
302 std::vector<DetId> channels;
304 for (
unsigned int i=0;
i<HBcontainer.size();
i++)
306 if (emptyItem.rawId() != HBcontainer.at(
i).rawId() )
307 channels.push_back(
DetId(HBcontainer.at(
i).rawId()) );
309 for (
unsigned int i=0;
i<HEcontainer.size();
i++)
311 if (emptyItem.rawId() != HEcontainer.at(
i).rawId() )
312 channels.push_back(
DetId(HEcontainer.at(
i).rawId()) );
314 for (
unsigned int i=0;
i<HOcontainer.size();
i++)
316 if (emptyItem.rawId() != HOcontainer.at(
i).rawId() )
317 channels.push_back(
DetId(HOcontainer.at(
i).rawId()) );
319 for (
unsigned int i=0;
i<HFcontainer.size();
i++)
321 if (emptyItem.rawId() != HFcontainer.at(
i).rawId() )
322 channels.push_back(
DetId(HFcontainer.at(
i).rawId()) );
324 for (
unsigned int i=0;
i<HTcontainer.size();
i++)
326 if (emptyItem.rawId() != HTcontainer.at(
i).rawId() )
327 channels.push_back(
DetId(HTcontainer.at(
i).rawId()) );
329 for (
unsigned int i=0;
i<ZDCcontainer.size();
i++)
331 if (emptyItem.rawId() != ZDCcontainer.at(
i).rawId() )
332 channels.push_back(
DetId(ZDCcontainer.at(
i).rawId()) );
334 for (
unsigned int i=0;
i<CALIBcontainer.size();
i++)
336 if (emptyItem.rawId() != CALIBcontainer.at(
i).rawId() )
337 channels.push_back(
DetId(CALIBcontainer.at(
i).rawId()) );
339 for (
unsigned int i=0;
i<CASTORcontainer.size();
i++)
341 if (emptyItem.rawId() != CASTORcontainer.at(
i).rawId() )
342 channels.push_back(
DetId(CASTORcontainer.at(
i).rawId()) );
bool addValues(const Item &myItem, bool h2mode_=false)
int hashedId(bool h2mode_=false) const
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
virtual ~HcalCondObjectContainer()
std::vector< Item > CASTORcontainer
void initContainer(int container, bool h2mode_=false)
const tAllContWithNames getAllContainers() const
const bool exists(DetId fId) const
std::vector< DetId > getAllChannels() const
std::vector< Item > ZDCcontainer
virtual std::string myname() const
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
HcalCondObjectContainer()
HcalGenericSubdetector genericSubdet() const
std::vector< Item > CALIBcontainer
const Item * getValues(DetId fId) const
std::vector< Item > HFcontainer
std::pair< std::string, std::vector< Item > > tHcalCont
std::vector< tHcalCont > tAllContWithNames