1 #ifndef CastorCondObjectContainer_h
2 #define CastorCondObjectContainer_h
61 template<
class Item>
void
66 if (CASTORcontainer.empty())
68 CASTORcontainer.push_back(emptyItem);
73 template<
class Item>
const Item*
80 unsigned int index = hashed_id(fId);
82 if (index < CASTORcontainer.size())
83 cell = &(CASTORcontainer.at(index) );
87 if ((!cell) || (cell->rawId() != fId ) ) {
90 <<
"Unavailable Conditions of type " << myname() <<
" for cell " << myId;
98 template<
class Item>
const bool
101 const Item* cell = getValues(fId,
false);
104 if (cell->rawId() == fId )
109 template<
class Item>
bool
112 unsigned long myRawId = myItem.rawId();
114 unsigned int index = hashed_id(myId);
118 if (CASTORcontainer.empty() ) initContainer();
119 if (index < CASTORcontainer.size())
121 CASTORcontainer.at(index) = myItem;
128 <<
" no valid filling possible for Conditions of type " << myname() <<
" for DetId " << myId;
133 template<
class Item> std::vector<DetId>
136 std::vector<DetId> channels;
138 for (
unsigned int i=0;
i<CASTORcontainer.size();
i++)
140 if (emptyItem.rawId() != CASTORcontainer.at(
i).rawId() )
141 channels.push_back(
DetId(CASTORcontainer.at(
i).rawId()) );
153 int sector = tid.
sector();
155 static const int CASTORhalf=224;
157 int index = 14*(sector-1) + (module-1);
158 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
#define COND_SERIALIZABLE
bool addValues(const Item &myItem)
Detector det() const
get the detector field from this detid
std::string myname() const