13 #include "GeoModelKernel/GeoNameTag.h"
14 #include "GeoModelKernel/GeoPhysVol.h"
15 #include "GeoModelKernel/GeoAlignableTransform.h"
16 #include "GeoModelRead/ReadGeoModel.h"
17 #include "GaudiKernel/SystemOfUnits.h"
39 :
InDetDD::DetectorFactoryBase(athenaComps)
40 , m_sqliteReader (sqliteReader)
62 std::unique_ptr<SiCommonItems> commonItems{std::make_unique<SiCommonItems>(athenaComps->
getIdHelper())};
72 <<
"\" which is inconsistent with the layout choosen!" <<
endmsg;
82 int versionMajorNumber = 5;
83 int versionMinorNumber = 1;
84 int versionPatchNumber = 0;
102 m_mapFPV = std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> (
new std::map<std::string, GeoFullPhysVol*> (
m_sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>(
"Pixel")));
103 m_mapAX = std::shared_ptr< std::map<std::string, GeoAlignableTransform*>> (
new std::map<std::string, GeoAlignableTransform *> (
m_sqliteReader->getPublishedNodes<std::string, GeoAlignableTransform*>(
"Pixel")));
113 msg(MSG::INFO) <<
"Building Pixel Detector" <<
endmsg;
124 GeoFullPhysVol *pPixelEnvelopeVol = (*m_mapFPV)[
"Pixel_Envelope"];
130 GeoAlignableTransform *
transform = (*m_mapAX)[
"Pixel_Envelope"];
205 msg(MSG::INFO) <<
"Doing consistency checks." <<
endmsg;
210 int missingCount = 0;
211 InDetDD::SiDetectorElementCollection::const_iterator iter;
212 for (iter =
manager->getDetectorElementBegin(); iter !=
manager->getDetectorElementEnd(); ++iter){
216 msg(MSG::WARNING) <<
"MISSING ELEMENT!!!!!!!!!!! - Element # " <<
count-1 <<
endmsg;
222 msg(MSG::ERROR) <<
"There are missing elements in element array." <<
endmsg;
224 msg(MSG::INFO) <<
"Number missing: " << missingCount <<
endmsg;
234 int barrelCountError = 0;
235 for (
int iBarrelIndex = 0; iBarrelIndex <
manager->numerology().numBarrels(); iBarrelIndex++)
237 int iBarrel =
manager->numerology().barrelId(iBarrelIndex);
238 for (
int iLayer = 0; iLayer <
manager->numerology().
numLayers(); iLayer++) {
243 int etaCorrection = 0;
249 if (
manager->numerology().useLayer(iLayer)) {
252 for (
int iEta =
manager->numerology().beginEtaModuleForLayer(iLayer);
253 iEta < manager->numerology().endEtaModuleForLayer(iLayer) - etaCorrection;
256 if (!etaCorrection && !
iEta &&
manager->numerology().skipEtaZeroForLayer(iLayer))
continue;
260 std::stringstream ostr;
261 ostr <<
"[2.1 . " << iBarrel <<
" . " << iLayer <<
" . " <<
iPhi <<
" . " <<
iEta <<
" . 0]";
264 msg(MSG::WARNING) <<
" No element found for id: " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
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)) {
291 std::stringstream ostr;
292 ostr <<
"[2.1." << iEndcap <<
"." << iDisk <<
"." <<
iPhi <<
"." <<
iEta <<
".0]";
295 msg(MSG::WARNING) <<
" No element found for id: " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
304 int endcapCountDBM = 0;
305 int endcapCountErrorDBM = 0;
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)) {
317 std::stringstream ostr;
318 ostr <<
"[2.1." << iEndcap <<
"." << iDisk <<
"." <<
iPhi <<
"." <<
iEta <<
".0]";
320 endcapCountErrorDBM++;
321 msg(MSG::WARNING) <<
" No element found for id (DBM): " << ostr.str() <<
" " << idHelper->
show_to_string(
id) <<
endmsg;
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;
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;
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;