1 #ifndef HcalCondObjectContainer_h
2 #define HcalCondObjectContainer_h
60 typedef std::pair< std::string, std::vector<Item> >
tHcalCont;
101 template<
class Item>
void
108 case(
HcalBarrel) :
for (
unsigned int i=0;
i<sizeFor(fId);
i++) HBcontainer.push_back(emptyItem);
break;
109 case(
HcalEndcap) :
for (
unsigned int i=0;
i<sizeFor(fId);
i++) HEcontainer.push_back(emptyItem);
break;
110 case(
HcalOuter) :
for (
unsigned int i=0;
i<sizeFor(fId);
i++) HOcontainer.push_back(emptyItem);
break;
111 case(
HcalForward) :
for (
unsigned int i=0;
i<sizeFor(fId);
i++) HFcontainer.push_back(emptyItem);
break;
112 case(
HcalTriggerTower) :
for (
unsigned int i=0;
i<sizeFor(fId);
i++) HTcontainer.push_back(emptyItem);
break;
114 for (
unsigned int i=0;
i<sizeFor(fId);
i++) CALIBcontainer.push_back(emptyItem);
break;
120 for (
unsigned int i=0;
i<sizeFor(fId);
i++) CASTORcontainer.push_back(emptyItem);
122 for (
unsigned int i=0;
i<sizeFor(fId);
i++) ZDCcontainer.push_back(emptyItem);
128 template<
class Item>
const Item*
131 unsigned int index=indexFor(fId);
135 if (index<0xFFFFFFFu) {
138 case(
HcalBarrel) :
if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) );
break;
139 case(
HcalEndcap) :
if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) );
break;
140 case(
HcalForward) :
if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) );
break;
141 case(
HcalOuter) :
if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) );
break;
142 case(
HcalTriggerTower) :
if (index < HTcontainer.size()) cell = &(HTcontainer.at(index) );
break;
144 if (index < CALIBcontainer.size()) cell = &(CALIBcontainer.at(index) );
150 if (index < CASTORcontainer.size()) cell = &(CASTORcontainer.at(index) );
152 if (index < ZDCcontainer.size()) cell = &(ZDCcontainer.at(index) );
162 <<
"Unavailable Conditions of type " << myname() <<
" for cell " << textForId(fId);
164 }
else if (cell->rawId() != fId) {
167 <<
"Requested conditions of type " << myname() <<
" for cell " << textForId(fId) <<
" got conditions for cell " << textForId(
DetId(cell->rawId()));
175 template<
class Item>
const bool
178 const Item* cell = getValues(fId,
false);
181 if (cell->rawId() == fId )
187 template<
class Item>
bool
191 DetId fId(myItem.rawId());
192 unsigned int index=indexFor(fId);
196 if (index<0xFFFFFFFu) {
199 case(
HcalBarrel) :
if (!HBcontainer.size() ) initContainer(fId);
200 if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) );
break;
201 case(
HcalEndcap) :
if (!HEcontainer.size() ) initContainer(fId);
202 if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) );
break;
203 case(
HcalForward) :
if (!HFcontainer.size() ) initContainer(fId);
204 if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) );
break;
205 case(
HcalOuter) :
if (!HOcontainer.size() ) initContainer(fId);
206 if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) );
break;
208 if (index < HTcontainer.size()) cell = &(HTcontainer.at(index) );
break;
210 if (!CALIBcontainer.size() ) initContainer(fId);
211 if (index < CALIBcontainer.size()) cell = &(CALIBcontainer.at(index) );
218 if (!CASTORcontainer.size() ) initContainer(fId);
219 if (index < CASTORcontainer.size()) cell = &(CASTORcontainer.at(index) );
221 if (!ZDCcontainer.size() ) initContainer(fId);
222 if (index < ZDCcontainer.size()) cell = &(ZDCcontainer.at(index) );
234 <<
" no valid filling possible for Conditions of type " << myname() <<
" for DetId " << textForId(fId);
238 template<
class Item> std::vector<DetId>
241 std::vector<DetId> channels;
243 for (
unsigned int i=0;
i<HBcontainer.size();
i++)
245 if (emptyItem.rawId() != HBcontainer.at(
i).rawId() )
246 channels.push_back(
DetId(HBcontainer.at(
i).rawId()) );
248 for (
unsigned int i=0;
i<HEcontainer.size();
i++)
250 if (emptyItem.rawId() != HEcontainer.at(
i).rawId() )
251 channels.push_back(
DetId(HEcontainer.at(
i).rawId()) );
253 for (
unsigned int i=0;
i<HOcontainer.size();
i++)
255 if (emptyItem.rawId() != HOcontainer.at(
i).rawId() )
256 channels.push_back(
DetId(HOcontainer.at(
i).rawId()) );
258 for (
unsigned int i=0;
i<HFcontainer.size();
i++)
260 if (emptyItem.rawId() != HFcontainer.at(
i).rawId() )
261 channels.push_back(
DetId(HFcontainer.at(
i).rawId()) );
263 for (
unsigned int i=0;
i<HTcontainer.size();
i++)
265 if (emptyItem.rawId() != HTcontainer.at(
i).rawId() )
266 channels.push_back(
DetId(HTcontainer.at(
i).rawId()) );
268 for (
unsigned int i=0;
i<ZDCcontainer.size();
i++)
270 if (emptyItem.rawId() != ZDCcontainer.at(
i).rawId() )
271 channels.push_back(
DetId(ZDCcontainer.at(
i).rawId()) );
273 for (
unsigned int i=0;
i<CALIBcontainer.size();
i++)
275 if (emptyItem.rawId() != CALIBcontainer.at(
i).rawId() )
276 channels.push_back(
DetId(CALIBcontainer.at(
i).rawId()) );
278 for (
unsigned int i=0;
i<CASTORcontainer.size();
i++)
280 if (emptyItem.rawId() != CASTORcontainer.at(
i).rawId() )
281 channels.push_back(
DetId(CASTORcontainer.at(
i).rawId()) );
unsigned int indexFor(DetId) const
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
HcalCondObjectContainerBase(const HcalTopology *)
void setTopo(const HcalTopology *topo) const
virtual ~HcalCondObjectContainer()
std::vector< Item > CASTORcontainer
const Item * getValues(DetId fId, bool throwOnFail=true) const
HcalOtherSubdetector extractOther(const DetId &id) const
int getCreatorPackedIndexVersion() const
unsigned int sizeFor(DetId) const
const tAllContWithNames getAllContainers() const
const bool exists(DetId fId) const
std::vector< DetId > getAllChannels() const
std::vector< Item > ZDCcontainer
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static const int SubdetectorId
HcalCondObjectContainer(const HcalTopology *topo)
const HcalTopology *topo_ COND_TRANSIENT
static const int SubdetectorId
virtual std::string myname() const
std::string textForId(const DetId &id) const
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer
void initContainer(DetId container)
int packedIndexVersion_ COND_TRANSIENT
bool addValues(const Item &myItem)
Detector det() const
get the detector field from this detid
std::vector< Item > HFcontainer
std::pair< std::string, std::vector< Item > > tHcalCont
std::vector< tHcalCont > tAllContWithNames
const HcalTopology * topo() const