219{
222
223 msg(MSG::INFO) <<
"Doing consistency checks." <<
endmsg;
224
226
228 int missingCount = 0;
230 for (iter =
manager->getDetectorElementBegin(); iter !=
manager->getDetectorElementEnd(); ++iter){
232 const InDetDD::SiDetectorElement * element = *
iter;
233 if (!element) {
234 msg(MSG::WARNING) <<
"MISSING ELEMENT!!!!!!!!!!! - Element # " <<
count-1 <<
endmsg;
235 missingCount++;
236 }
237 }
238
239 if (missingCount) {
240 msg(MSG::ERROR) <<
"There are missing elements in element array." <<
endmsg;
242 msg(MSG::INFO) <<
"Number missing: " << missingCount <<
endmsg;
243 }
244
245
246
247
248
249
250
251 int barrelCount = 0;
252 int barrelCountError = 0;
253 for (
int iBarrelIndex = 0; iBarrelIndex <
manager->numerology().numBarrels(); iBarrelIndex++) {
254 int iBarrel =
manager->numerology().barrelId(iBarrelIndex);
255 for (
int iLayer = 0; iLayer <
manager->numerology().
numLayers(); iLayer++) {
256
257
258
260 int etaCorrection = 0;
262
263 etaCorrection = 1;
264 }
265
266
267 if (
manager->numerology().useLayer(iLayer)) {
268 for (
int iPhi = 0;
iPhi <
manager->numerology().numPhiModulesForLayer(iLayer);
iPhi++) {
269 for (
int iEta =
manager->numerology().beginEtaModuleForLayer(iLayer);
270 iEta < manager->numerology().endEtaModuleForLayer(iLayer) - etaCorrection;
272
273 if (!etaCorrection && !iEta &&
manager->numerology().skipEtaZeroForLayer(iLayer))
continue;
274 Identifier
id = idHelper->
wafer_id(iBarrel,iLayer,iPhi,iEta);
275 const InDetDD::SiDetectorElement * element =
manager->getDetectorElement(
id);
276 barrelCount++;
277 std::stringstream ostr;
278 ostr <<
"[2.1 . " << iBarrel <<
" . " << iLayer <<
" . " <<
iPhi <<
" . " <<
iEta <<
" . 0]";
279 if (!element) {
280 barrelCountError++;
281 msg(MSG::WARNING) <<
" No element found for id: " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
282 }
283 }
284 }
285 }
286 }
287 }
288
289
290
291 int endcapCount = 0;
292 int endcapCountError = 0;
293 for (
int iEndcapIndex = 0; iEndcapIndex <
manager->numerology().numEndcaps(); iEndcapIndex++) {
294 int iEndcap =
manager->numerology().endcapId(iEndcapIndex);
295 for (
int iDisk = 0; iDisk <
manager->numerology().numDisks(); iDisk++) {
296 if (
manager->numerology().useDisk(iDisk)) {
297 for (
int iEta = 0;
iEta <
manager->numerology().numRingsForDisk(iDisk);
iEta++) {
298 for (
int iPhi = 0;
iPhi <
manager->numerology().numPhiModulesForDiskRing(iDisk,iEta);
iPhi++) {
299 Identifier
id = idHelper->
wafer_id(iEndcap,iDisk,iPhi,iEta);
300 const InDetDD::SiDetectorElement * element =
manager->getDetectorElement(
id);
301 endcapCount++;
302 std::stringstream ostr;
303 ostr <<
"[2.1." << iEndcap <<
"." << iDisk <<
"." <<
iPhi <<
"." <<
iEta <<
".0]";
304 if (!element) {
305 endcapCountError++;
306 msg(MSG::WARNING) <<
" No element found for id: " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
307 }
308 }
309 }
310 }
311 }
312 }
313
314
315 int endcapCountDBM = 0;
316 int endcapCountErrorDBM = 0;
318
319
320
321 for (
int iEndcapIndex = 0; iEndcapIndex <
manager->numerology().numEndcapsDBM(); iEndcapIndex++) {
322 int iEndcap =
manager->numerology().endcapIdDBM(iEndcapIndex);
323 for (
int iDisk = 0; iDisk <
manager->numerology().numDisksDBM(); iDisk++) {
324 if (
manager->numerology().useDiskDBM(iDisk)) {
325 for (
int iEta = 0;
iEta <
manager->numerology().numRingsForDiskDBM(iDisk);
iEta++) {
326 for (
int iPhi = 0;
iPhi <
manager->numerology().numPhiModulesForDiskRingDBM(iDisk,iEta);
iPhi++) {
327 Identifier
id = idHelper->
wafer_id(iEndcap,iDisk,iPhi,iEta);
328 const InDetDD::SiDetectorElement * element =
manager->getDetectorElement(
id);
329 endcapCountDBM++;
330 std::stringstream ostr;
331 ostr <<
"[2.1." << iEndcap <<
"." << iDisk <<
"." <<
iPhi <<
"." <<
iEta <<
".0]";
332 if (!element) {
333 endcapCountErrorDBM++;
334 msg(MSG::WARNING) <<
" No element found for id (DBM): " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
335 }
336 }
337 }
338 }
339 }
340 }
341 }
342
343 if (barrelCountError || endcapCountError || endcapCountErrorDBM) {
344 msg(MSG::ERROR) <<
"There are elements which cannot be found." <<
endmsg;
345 msg(MSG::INFO) <<
"Number of barrel elements not found : " << barrelCountError <<
endmsg;
346 msg(MSG::INFO) <<
"Number of pixel endcap elements not found : " << endcapCountError <<
endmsg;
347 msg(MSG::INFO) <<
"Number of DBM endcap elements not found : " << endcapCountErrorDBM <<
endmsg;
348 }
349
350 if ( barrelCount+endcapCount+endcapCountDBM != int(maxHash)) {
351 msg(MSG::ERROR) <<
"Total count does not match maxHash." <<
endmsg;
352 msg(MSG::INFO) <<
"Number of barrel elements : " << barrelCount <<
endmsg;
353 msg(MSG::INFO) <<
"Number of endcap elements : " << endcapCount <<
endmsg;
354 msg(MSG::INFO) <<
"Number of endcap elements (DBM) : " << endcapCountDBM <<
endmsg;
355 msg(MSG::INFO) <<
"Total : " << barrelCount+endcapCount+endcapCountDBM <<
endmsg;
356 msg(MSG::INFO) <<
"MaxHash : " << maxHash <<
endmsg;
357 }
358
359 msg(MSG::INFO) <<
"Number of barrel elements : " << barrelCount <<
endmsg;
360 msg(MSG::INFO) <<
"Number of endcap elements : " << endcapCount <<
endmsg;
361 msg(MSG::INFO) <<
"Number of endcap elements (DBM) : " << endcapCountDBM <<
endmsg;
362 msg(MSG::INFO) <<
"Total : " << barrelCount+endcapCount+endcapCountDBM <<
endmsg;
363 msg(MSG::INFO) <<
"MaxHash : " << maxHash <<
endmsg;
364
365}
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