201{
204
205 msg(MSG::INFO) <<
"Doing consistency checks." <<
endmsg;
206
208
210 int missingCount = 0;
212 for (iter =
manager->getDetectorElementBegin(); iter !=
manager->getDetectorElementEnd(); ++iter){
214 const InDetDD::SiDetectorElement * element = *
iter;
215 if (!element) {
216 msg(MSG::WARNING) <<
"MISSING ELEMENT!!!!!!!!!!! - Element # " <<
count-1 <<
endmsg;
217 missingCount++;
218 }
219 }
220
221 if (missingCount) {
222 msg(MSG::ERROR) <<
"There are missing elements in element array." <<
endmsg;
224 msg(MSG::INFO) <<
"Number missing: " << missingCount <<
endmsg;
225 }
226
227
228
229
230
231
232
233 int barrelCount = 0;
234 int barrelCountError = 0;
235 for (
int iBarrelIndex = 0; iBarrelIndex <
manager->numerology().numBarrels(); iBarrelIndex++)
236 {
237 int iBarrel =
manager->numerology().barrelId(iBarrelIndex);
238 for (
int iLayer = 0; iLayer <
manager->numerology().
numLayers(); iLayer++) {
239
240
241
243 int etaCorrection = 0;
245 etaCorrection = 1;
246 }
247
248
249 if (
manager->numerology().useLayer(iLayer)) {
250 for (
int iPhi = 0;
iPhi <
manager->numerology().numPhiModulesForLayer(iLayer);
iPhi++)
251 {
252 for (
int iEta =
manager->numerology().beginEtaModuleForLayer(iLayer);
253 iEta < manager->numerology().endEtaModuleForLayer(iLayer) - etaCorrection;
255 {
256 if (!etaCorrection && !iEta &&
manager->numerology().skipEtaZeroForLayer(iLayer))
continue;
257 Identifier
id = idHelper->
wafer_id(iBarrel,iLayer,iPhi,iEta);
258 const InDetDD::SiDetectorElement * element =
manager->getDetectorElement(
id);
259 barrelCount++;
260 std::stringstream ostr;
261 ostr <<
"[2.1 . " << iBarrel <<
" . " << iLayer <<
" . " <<
iPhi <<
" . " <<
iEta <<
" . 0]";
262 if (!element) {
263 barrelCountError++;
264 msg(MSG::WARNING) <<
" No element found for id: " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
265
266 }
267
268 }
269
270 }
271
272 }
273
274 }
275
276 }
277
278
279
280 int endcapCount = 0;
281 int endcapCountError = 0;
282 for (
int iEndcapIndex = 0; iEndcapIndex <
manager->numerology().numEndcaps(); iEndcapIndex++) {
283 int iEndcap =
manager->numerology().endcapId(iEndcapIndex);
284 for (
int iDisk = 0; iDisk <
manager->numerology().numDisks(); iDisk++) {
285 if (
manager->numerology().useDisk(iDisk)) {
286 for (
int iEta = 0;
iEta <
manager->numerology().numRingsForDisk(iDisk);
iEta++) {
287 for (
int iPhi = 0;
iPhi <
manager->numerology().numPhiModulesForDiskRing(iDisk,iEta);
iPhi++) {
288 Identifier
id = idHelper->
wafer_id(iEndcap,iDisk,iPhi,iEta);
289 const InDetDD::SiDetectorElement * element =
manager->getDetectorElement(
id);
290 endcapCount++;
291 std::stringstream ostr;
292 ostr <<
"[2.1." << iEndcap <<
"." << iDisk <<
"." <<
iPhi <<
"." <<
iEta <<
".0]";
293 if (!element) {
294 endcapCountError++;
295 msg(MSG::WARNING) <<
" No element found for id: " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
296 }
297 }
298 }
299 }
300 }
301 }
302
303
304 int endcapCountDBM = 0;
305 int endcapCountErrorDBM = 0;
307
308 for (
int iEndcapIndex = 0; iEndcapIndex <
manager->numerology().numEndcapsDBM(); iEndcapIndex++) {
309 int iEndcap =
manager->numerology().endcapIdDBM(iEndcapIndex);
310 for (
int iDisk = 0; iDisk <
manager->numerology().numDisksDBM(); iDisk++) {
311 if (
manager->numerology().useDiskDBM(iDisk)) {
312 for (
int iEta = 0;
iEta <
manager->numerology().numRingsForDiskDBM(iDisk);
iEta++) {
313 for (
int iPhi = 0;
iPhi <
manager->numerology().numPhiModulesForDiskRingDBM(iDisk,iEta);
iPhi++) {
314 Identifier
id = idHelper->
wafer_id(iEndcap,iDisk,iPhi,iEta);
315 const InDetDD::SiDetectorElement * element =
manager->getDetectorElement(
id);
316 endcapCountDBM++;
317 std::stringstream ostr;
318 ostr <<
"[2.1." << iEndcap <<
"." << iDisk <<
"." <<
iPhi <<
"." <<
iEta <<
".0]";
319 if (!element) {
320 endcapCountErrorDBM++;
321 msg(MSG::WARNING) <<
" No element found for id (DBM): " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
322 }
323 }
324 }
325 }
326 }
327 }
328 }
329
330 if (barrelCountError || endcapCountError || endcapCountErrorDBM) {
331 msg(MSG::ERROR) <<
"There are elements which cannot be found." <<
endmsg;
332 msg(MSG::INFO) <<
"Number of barrel elements not found : " << barrelCountError <<
endmsg;
333 msg(MSG::INFO) <<
"Number of pixel endcap elements not found : " << endcapCountError <<
endmsg;
334 msg(MSG::INFO) <<
"Number of DBM endcap elements not found : " << endcapCountErrorDBM <<
endmsg;
335 }
336
337 if ( barrelCount+endcapCount+endcapCountDBM != int(maxHash)) {
338 msg(MSG::ERROR) <<
"Total count does not match maxHash." <<
endmsg;
339 msg(MSG::INFO) <<
"Number of barrel elements : " << barrelCount <<
endmsg;
340 msg(MSG::INFO) <<
"Number of endcap elements : " << endcapCount <<
endmsg;
341 msg(MSG::INFO) <<
"Number of endcap elements (DBM) : " << endcapCountDBM <<
endmsg;
342 msg(MSG::INFO) <<
"Total : " << barrelCount+endcapCount+endcapCountDBM <<
endmsg;
343 msg(MSG::INFO) <<
"MaxHash : " << maxHash <<
endmsg;
344 }
345
346 msg(MSG::INFO) <<
"Number of barrel elements : " << barrelCount <<
endmsg;
347 msg(MSG::INFO) <<
"Number of endcap elements : " << endcapCount <<
endmsg;
348 msg(MSG::INFO) <<
"Number of endcap elements (DBM) : " << endcapCountDBM <<
endmsg;
349 msg(MSG::INFO) <<
"Total : " << barrelCount+endcapCount+endcapCountDBM <<
endmsg;
350 msg(MSG::INFO) <<
"MaxHash : " << maxHash <<
endmsg;
351
352}
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
DataModel_detail::const_iterator< DataVector > const_iterator
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
size_type wafer_hash_max() const
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
constexpr unsigned int numLayers()
setScale setgFexType iEta