13 #include "GeoModelKernel/GeoNameTag.h"
14 #include "GeoModelKernel/GeoPhysVol.h"
15 #include "GeoModelKernel/GeoAlignableTransform.h"
16 #include "GaudiKernel/SystemOfUnits.h"
37 :
InDetDD::DetectorFactoryBase(athenaComps),
38 m_detectorManager(nullptr),
39 m_useDynamicAlignFolders(false)
61 std::unique_ptr<SiCommonItems> commonItems{std::make_unique<SiCommonItems>(athenaComps->
getIdHelper())};
72 <<
"\" which is inconsistent with the layout choosen!"
84 int versionMajorNumber = 5;
85 int versionMinorNumber = 1;
86 int versionPatchNumber = 0;
115 msg(MSG::INFO) <<
"Building Pixel Detector" <<
endmsg;
133 GeoVPhysVol* pephys =
pe.Build() ;
138 world->add(
new GeoNameTag(
"Pixel"));
139 GeoAlignableTransform *
transform =
new GeoAlignableTransform(topTransform);
223 msg(MSG::INFO) <<
"Doing consistency checks." <<
endmsg;
228 int missingCount = 0;
229 InDetDD::SiDetectorElementCollection::const_iterator iter;
230 for (iter =
manager->getDetectorElementBegin(); iter !=
manager->getDetectorElementEnd(); ++iter){
234 msg(MSG::WARNING) <<
"MISSING ELEMENT!!!!!!!!!!! - Element # " <<
count-1 <<
endmsg;
240 msg(MSG::ERROR) <<
"There are missing elements in element array." <<
endmsg;
242 msg(MSG::INFO) <<
"Number missing: " << missingCount <<
endmsg;
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++) {
260 int etaCorrection = 0;
267 if (
manager->numerology().useLayer(iLayer)) {
269 for (
int iEta =
manager->numerology().beginEtaModuleForLayer(iLayer);
270 iEta < manager->numerology().endEtaModuleForLayer(iLayer) - etaCorrection;
273 if (!etaCorrection && !
iEta &&
manager->numerology().skipEtaZeroForLayer(iLayer))
continue;
277 std::stringstream ostr;
278 ostr <<
"[2.1 . " << iBarrel <<
" . " << iLayer <<
" . " <<
iPhi <<
" . " <<
iEta <<
" . 0]";
281 msg(MSG::WARNING) <<
" No element found for id: " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
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)) {
302 std::stringstream ostr;
303 ostr <<
"[2.1." << iEndcap <<
"." << iDisk <<
"." <<
iPhi <<
"." <<
iEta <<
".0]";
306 msg(MSG::WARNING) <<
" No element found for id: " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
315 int endcapCountDBM = 0;
316 int endcapCountErrorDBM = 0;
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)) {
330 std::stringstream ostr;
331 ostr <<
"[2.1." << iEndcap <<
"." << iDisk <<
"." <<
iPhi <<
"." <<
iEta <<
".0]";
333 endcapCountErrorDBM++;
334 msg(MSG::WARNING) <<
" No element found for id (DBM): " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
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;
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;
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;