7 #include "CLHEP/Units/SystemOfUnits.h" 
   17 #include "Identifier/Identifier.h" 
   36   m_managerName(
"Pixel"),  
 
   40   m_pixelIdHelper(nullptr),
 
   41   m_sctIdHelper(nullptr),
 
  104   return StatusCode::SUCCESS;
 
  116   return StatusCode::SUCCESS;
 
  120   const bool useConditionStore = not accessDuringInitialization;
 
  122   if (useConditionStore) {
 
  127     if (elements==
nullptr) {
 
  149         ATH_MSG_ALWAYS(
" center (x,y,z)   = " << element->center().x() << 
"," << element->center().y() << 
"," << element->center().z());
 
  150           ATH_MSG_ALWAYS(
" center (r,phi,z) = " << element->center().perp() << 
"," << element->center().phi() << 
"," <<element->center().z());
 
  154       ATH_MSG_ALWAYS(
" global (r,phi,z) hit position of (1,1,0)    = " <<element->globalPositionHit(
Amg::Vector3D(1,1,0)).perp() << 
"," << element->globalPositionHit(
Amg::Vector3D(1,1,0)).phi() <<
","<< element->globalPositionHit(
Amg::Vector3D(1,1,0)).z());
 
  155       ATH_MSG_ALWAYS(
" global (r,phi,z) hit  position of (-1,-1,0) = " <<element->globalPositionHit(
Amg::Vector3D(-1,-1,0)).perp() << 
"," << element->globalPositionHit(
Amg::Vector3D(-1,-1,0)).phi() <<
","<< element->globalPositionHit(
Amg::Vector3D(-1,-1,0)).z()); 
 
  160         ATH_MSG_ALWAYS(
" Normal = " <<element->normal().perp() << 
"," << element->normal().phi() <<
","<< element->normal().z());
 
  161         ATH_MSG_ALWAYS(
" sin(tilt), sin(stereo) = " <<  element->sinTilt() << 
" "  
  162                        << element->sinStereo());
 
  170         IdentifierHash hashId = element->identifyHash();
 
  172           const EventContext &ctx = Gaudi::Hive::currentContext();
 
  173           ATH_MSG_ALWAYS(
" Temperature (C), bias voltage, depletion voltage: " 
  185         ATH_MSG_ALWAYS(
" HashId, Id : " << hashId << 
"\t" << element->identify().getString());
 
  190         IdentifierHash idHashTest;
 
  200         if (useConditionStore) {
 
  207           elementtest2 = elements->getDetectorElement(hashId);
 
  213         if (idHashTest != hashId) {
ATH_MSG_ALWAYS(
" Id test 1 FAILED!"); idOK = 
false;}
 
  214         if (idTest != element->identify()) {
ATH_MSG_ALWAYS(
" Id test 2 FAILED!"); idOK = 
false;}
 
  215         if (elementtest1 != element) {
ATH_MSG_ALWAYS(
" Id test 3 FAILED!"); idOK = 
false;}
 
  216         if (elementtest2 != element) {
ATH_MSG_ALWAYS(
" Id test 4 FAILED!"); idOK = 
false;}
 
  226         ATH_MSG_ALWAYS(
"|"<<mytrf(2,0)<<
","<<mytrf(2,1)<<
","<<mytrf(2,2)<<
"|");
 
  227         ATH_MSG_ALWAYS(
"|"<<mytrf(1,0)<<
","<<mytrf(1,1)<<
","<<mytrf(1,2)<<
"|");
 
  228         ATH_MSG_ALWAYS(
"|"<<mytrf(0,0)<<
","<<mytrf(0,1)<<
","<<mytrf(0,2)<<
"|");
 
  231         ATH_MSG_ALWAYS(
"|"<<mytrfhit(2,0)<<
","<<mytrfhit(2,1)<<
","<<mytrfhit(2,2)<<
"|");
 
  232         ATH_MSG_ALWAYS(
"|"<<mytrfhit(1,0)<<
","<<mytrfhit(1,1)<<
","<<mytrfhit(1,2)<<
"|");
 
  233         ATH_MSG_ALWAYS(
"|"<<mytrfhit(0,0)<<
","<<mytrfhit(0,1)<<
","<<mytrfhit(0,2)<<
"|");
 
  238     if(element->depthDirection()) 
ATH_MSG_ALWAYS(
"Depth Direction True");
 
  247     if(std::abs(element->depthAngle())<0.5) 
ATH_MSG_ALWAYS(
"BAD DEPTH DIRECTION!");
 
  248     if(std::abs(element->etaAngle())<0.5) 
ATH_MSG_ALWAYS(
"BAD ETA DIRECTION!");
 
  249     if(std::abs(element->phiAngle())<0.5) 
ATH_MSG_ALWAYS(
"BAD PHI DIRECTION!");
 
  260   int barrelCountError = 0;
 
  262   for (
int iBarrelIndex = 0; iBarrelIndex < siNumerology.
numBarrels(); iBarrelIndex++) {
 
  263     int iBarrel = siNumerology.
barrelId(iBarrelIndex);
 
  266     for (
int iLayer = 0; iLayer < siNumerology.
numLayers(); iLayer++) {
 
  274           for (
int iSide = 0; iSide < nSides; iSide++) {
 
  282             if (useConditionStore) {
 
  308   int endcapCountError = 0;
 
  310   for (
int iEndcapIndex = 0; iEndcapIndex < siNumerology.
numEndcaps(); iEndcapIndex++) {
 
  311     int iEndcap = siNumerology.
endcapId(iEndcapIndex);
 
  314     for (
int iDisk = 0; iDisk < siNumerology.
numDisks(); iDisk++) {
 
  322           for (
int iSide = 0; iSide < nSides; iSide++) {
 
  364   const bool useConditionStore = (
m_managerName == 
"SCT" and (not accessDuringInitialization));
 
  366   if (useConditionStore) {
 
  370     if (elements==
nullptr) {
 
  382       std::vector<SiCellId> cellIds;
 
  383       std::vector<Amg::Vector2D> positions;
 
  390       cellIds.emplace_back(32,8); 
 
  392       for (
int i(151);
i != 176; ++
i){
 
  393         cellIds.emplace_back(
i,8); 
 
  395       cellIds.emplace_back(-1,1); 
 
  396       cellIds.emplace_back(0,1); 
 
  397       cellIds.emplace_back(1,-1); 
 
  398       cellIds.emplace_back(1,0); 
 
  399       cellIds.emplace_back(327,1); 
 
  400       cellIds.emplace_back(328,1); 
 
  401       cellIds.emplace_back(1,143); 
 
  402       cellIds.emplace_back(1,144); 
 
  413       cellIds.emplace_back(32,8); 
 
  422       cellIds.emplace_back(182,75); 
 
  438       std::vector<SiCellId> cellIds;
 
  439       std::vector<Amg::Vector2D> positions;
 
  447       id = idHelper->
wafer_id(0,1,15,-3,0);
 
  450       cellIds.emplace_back(32); 
 
  451       cellIds.emplace_back(1); 
 
  452       cellIds.emplace_back(0); 
 
  454         cellIds.emplace_back(-1); 
 
  455         cellIds.emplace_back(-2); 
 
  456         cellIds.emplace_back(-3); 
 
  458       cellIds.emplace_back(767); 
 
  459       cellIds.emplace_back(768); 
 
  467       id = idHelper->
wafer_id(0,1,15,-3,1);
 
  470       cellIds.emplace_back(32); 
 
  478       id = idHelper->
wafer_id(2,3,15,0,0);
 
  481       cellIds.emplace_back(532); 
 
  482       cellIds.emplace_back(0); 
 
  484       cellIds.emplace_back(767); 
 
  485       cellIds.emplace_back(768); 
 
  494       id = idHelper->
wafer_id(2,3,15,0,1);
 
  497       cellIds.emplace_back(532); 
 
  507       id = idHelper->
wafer_id(2,1,15,1,0);
 
  510       cellIds.emplace_back(532); 
 
  518       id = idHelper->
wafer_id(2,7,15,1,0);
 
  521       cellIds.emplace_back(532); 
 
  529       id = idHelper->
wafer_id(2,1,15,2,0);
 
  532       cellIds.emplace_back(532); 
 
  545   if (elementsC==
nullptr) {
 
  553   if (elementsC->
size()!=elementsM->
size()) {
 
  554     ATH_MSG_FATAL(
"Sizes of SiDetectorElementCollections are different");
 
  557   SiDetectorElementCollection::const_iterator elementC = elementsC->
begin();
 
  558   SiDetectorElementCollection::const_iterator elementM = elementsM->
begin();
 
  559   SiDetectorElementCollection::const_iterator elementMe = elementsM->
end();
 
  560   for (; elementM!=elementMe; ++elementC, ++elementM) {
 
  561     auto diff = (*elementC)->center()-(*elementM)->center();
 
  565       ATH_MSG_ALWAYS(
"center (store) " << (*elementC)->center().transpose());
 
  566       ATH_MSG_ALWAYS(
"center (manager) " << (*elementM)->center().transpose());
 
  575                                     const std::vector<SiCellId> & cellIdVec, 
 
  576                                     const std::vector<Amg::Vector2D> & positionsVec,
 
  592     ATH_MSG_ALWAYS(
" width, minWidth, maxWidth, length, thickness (mm) = "  
  601     ATH_MSG_ALWAYS(
" rMin, rMax, zMin, zMax (mm), phiMin, phiMax (deg) = "  
  610                    << element->
center() << 
" " 
  611                    << element->
normal() << 
" " 
  618       const EventContext &ctx = Gaudi::Hive::currentContext();
 
  619       ATH_MSG_ALWAYS(
" Temperature (C), bias voltage, depletion voltage: " 
  624     ATH_MSG_ALWAYS(
" sin(tilt), tilt (deg), sin(stereo), stereo (deg) = "  
  636     for (
unsigned int iTestCell = 0; iTestCell < cellIdVec.size(); iTestCell++) {
 
  637       SiCellId cellId = cellIdVec[iTestCell];
 
  647       ATH_MSG_ALWAYS(
" extracted cell id [phiIndex.etaIndex] = " << cellId2);
 
  651       ATH_MSG_ALWAYS(
" raw localPosition (using cell id) (xPhi,xEta) = "  
  652                      << localPosRaw1.
xPhi() << 
", " << localPosRaw1.
xEta());
 
  653       ATH_MSG_ALWAYS(
" raw localPosition (using full id) (xPhi,xEta) = "  
  654                      << localPosRaw2.
xPhi() << 
", " << localPosRaw2.
xEta());
 
  668     for (
unsigned int iTestPos = 0; iTestPos < positionsVec.size(); iTestPos++) {
 
  670       ATH_MSG_ALWAYS(
" Requested local pos (xPhi,xEta) = " << localPosOrig.
xPhi() << 
", " << localPosOrig.
xEta());
 
  682                      << 
" (in,out,nearBoundary,mayIntersect) : "  
  683                      << intersectState.
in() << 
"," 
  684                      << intersectState.
out() << 
"," 
  693       ATH_MSG_ALWAYS(
" using global position sin(tilt), tilt (deg), sin(stereo), stereo (deg) = " 
  694                      << element->
sinTilt(globalPos) << 
", " 
  722   return StatusCode::SUCCESS;