1 #ifndef CastorCondObjectContainer_h
2 #define CastorCondObjectContainer_h
57 template<
class Item>
void
62 if (CASTORcontainer.empty())
64 CASTORcontainer.push_back(emptyItem);
69 template<
class Item>
const Item*
72 const Item* cell =
NULL;
76 unsigned int index = hashed_id(fId);
78 if (index < CASTORcontainer.size())
79 cell = &(CASTORcontainer.at(index) );
83 if ((!cell) || (cell->rawId() != fId ) ) {
86 <<
"Unavailable Conditions of type " << myname() <<
" for cell " << myId;
94 template<
class Item>
const bool
97 const Item* cell = getValues(fId,
false);
100 if (cell->rawId() == fId )
105 template<
class Item>
bool
108 unsigned long myRawId = myItem.rawId();
110 unsigned int index = hashed_id(myId);
114 if (CASTORcontainer.empty() ) initContainer();
115 if (index < CASTORcontainer.size())
117 CASTORcontainer.at(index) = myItem;
124 <<
" no valid filling possible for Conditions of type " << myname() <<
" for DetId " << myId;
129 template<
class Item> std::vector<DetId>
132 std::vector<DetId> channels;
134 for (
unsigned int i=0;
i<CASTORcontainer.size();
i++)
136 if (emptyItem.rawId() != CASTORcontainer.at(
i).rawId() )
137 channels.push_back(
DetId(CASTORcontainer.at(
i).rawId()) );
148 int zside = tid.
zside();
149 int sector = tid.
sector();
151 static const int CASTORhalf=224;
153 int index = 14*(sector-1) + (module-1);
154 if (zside == -1) index += CASTORhalf;
CastorCondObjectContainer()
std::vector< Item > CASTORcontainer
int sector() const
get the sector (1-16)
std::vector< DetId > getAllChannels() const
int module() const
get the module (1-2 for EM, 1-12 for HAD)
const Item * getValues(DetId fId, bool throwOnFail=true) const
const bool exists(DetId fId) const
unsigned int hashed_id(DetId fId) const
~CastorCondObjectContainer()
int zside() const
get the z-side of the cell (1/-1)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static const int SubdetectorId
bool addValues(const Item &myItem)
Detector det() const
get the detector field from this detid
std::string myname() const