diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h b/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h index dfc36746d514283cc30446b70815cd1cf7ec779b..b6ba67b4a9c24e6bb43ce83def29bc3752da60e5 100755 --- a/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h +++ b/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h @@ -67,7 +67,9 @@ public: const SCT_ID * m_sctIdHelper; bool m_first; - + + bool m_useSiProperties; + bool m_testNegativeStrips; }; diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadITkSiDetectorElements.py b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadITkSiDetectorElements.py new file mode 100644 index 0000000000000000000000000000000000000000..272a27913f2f2a606eb1efaa204bebbd587d7271 --- /dev/null +++ b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadITkSiDetectorElements.py @@ -0,0 +1,48 @@ +from AthenaCommon.DetFlags import DetFlags +DetFlags.ID_setOn() +DetFlags.BCM_setOff() +DetFlags.Calo_setOff() +DetFlags.Muon_setOff() +DetFlags.pixel_setOn() +DetFlags.TRT_setOff() + +# Full job is a list of algorithms +from AthenaCommon.AlgSequence import AlgSequence +job = AlgSequence() + +DetDescrVersion = 'ATLAS-P2-ITK-22-02-00' + +from AthenaCommon.GlobalFlags import globalflags +globalflags.DetDescrVersion = DetDescrVersion + +## Need to set the layout option up front +from InDetSLHC_Example.SLHC_JobProperties import SLHC_Flags + +SLHC_Flags.doGMX.set_Value_and_Lock(True) +include("InDetSLHC_Example/preInclude.SLHC.py") +include("InDetSLHC_Example/preInclude.SLHC_Setup.py") +include("InDetSLHC_Example/preInclude.SLHC_Setup_Strip_GMX.py") + +from AtlasGeoModel import GeoModelInit + +from GeoModelSvc.GeoModelSvcConf import GeoModelSvc +GeoModelSvc = GeoModelSvc() +GeoModelSvc.AtlasVersion = globalflags.DetDescrVersion() +from AthenaCommon.AppMgr import ServiceMgr as svcMgr +svcMgr += GeoModelSvc + +from IOVDbSvc.CondDB import conddb +conddb.setGlobalTag("OFLCOND-MC15c-SDR-14-03") + +from InDetDetDescrExample.InDetDetDescrExampleConf import ReadSiDetectorElements + +ReadStripElements = ReadSiDetectorElements("ReadStripElements") +ReadStripElements.UseSiProperties = False +ReadStripElements.LoopOverElements = False +ReadStripElements.TestNegativeStrips = False +ReadStripElements.ManagerName = "SCT" +job += ReadStripElements; + +theApp.EvtMax = 1 + +include("InDetSLHC_Example/postInclude.SLHC_Setup_ITK.py") diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx b/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx index a3496cd09f47765a8f28ee473479ed58c48c0f81..436e6aec8656cb545a7dd1cd145b07470d07df29 100755 --- a/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx +++ b/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx @@ -60,7 +60,9 @@ ReadSiDetectorElements::ReadSiDetectorElements(const std::string& name, ISvcLoca m_idHelper(0), m_pixelIdHelper(0), m_sctIdHelper(0), - m_first(true) + m_first(true), + m_useSiProperties(true), + m_testNegativeStrips(true) { // Get parameter values from jobOptions file declareProperty("ManagerName", m_managerName); @@ -71,6 +73,8 @@ ReadSiDetectorElements::ReadSiDetectorElements(const std::string& name, ISvcLoca declareProperty("SiLorentzAngleSvc", m_siLorentzAngleSvc); declareProperty("SiConditionsSvc", m_siConditionsSvc); declareProperty("SiPropertiesSvc", m_siPropertiesSvc); + declareProperty("UseSiProperties", m_useSiProperties); + declareProperty("TestNegativeStrips", m_testNegativeStrips); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -225,11 +229,14 @@ void ReadSiDetectorElements::printAllElements() { // << m_siLorentzAngleSvc->getTanLorentzAngle(hashId) << endl; // These are no longer accessed through the detector element. - const InDet::SiliconProperties & siProperties = m_siPropertiesSvc->getSiProperties(hashId); - cout << " Hall Mobility (cm2/volt/s), Drift mobility (cm2/volt/s), diffusion constant (cm2/s) = " - << siProperties.hallMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " - << siProperties.driftMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " - << siProperties.diffusionConstant(element->carrierType()) /(CLHEP::cm2/CLHEP::s) << endl; + if(m_useSiProperties){ + const InDet::SiliconProperties & siProperties = m_siPropertiesSvc->getSiProperties(hashId); + cout << " Hall Mobility (cm2/volt/s), Drift mobility (cm2/volt/s), diffusion constant (cm2/s) = " + << siProperties.hallMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " + << siProperties.driftMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " + << siProperties.diffusionConstant(element->carrierType()) /(CLHEP::cm2/CLHEP::s) << endl; + } + //Assuming these are left here for future refefence... //cout << element->hitDepthDirection() << " " // << element->hitPhiDirection() << " " // << element->hitEtaDirection() << " " @@ -260,7 +267,7 @@ void ReadSiDetectorElements::printAllElements() { if (elementtest2 != element) {cout << " Id test 4 FAILED!" << endl; idOK = false;} if (idOK) cout << " ID tests OK" << std::endl; } else { - // cout << "Missing element!!!!!!!!!!!" << endl; + cout << "Missing element!!!!!!!!!!!" << endl; } } } @@ -440,9 +447,11 @@ void ReadSiDetectorElements::printRandomAccess() { cellIds.push_back(SiCellId(32)); // phi,eta cellIds.push_back(SiCellId(1)); // phi,eta cellIds.push_back(SiCellId(0)); // phi,eta - cellIds.push_back(SiCellId(-1)); // phi,eta - cellIds.push_back(SiCellId(-2)); // phi,eta - cellIds.push_back(SiCellId(-3)); // phi,eta + if(m_testNegativeStrips){//These cause exceptions for Itk, so give option to not do it... + cellIds.push_back(SiCellId(-1)); // phi,eta + cellIds.push_back(SiCellId(-2)); // phi,eta + cellIds.push_back(SiCellId(-3)); // phi,eta + } cellIds.push_back(SiCellId(767)); // phi,eta cellIds.push_back(SiCellId(768)); // phi,eta positions.push_back(Amg::Vector2D(12.727*CLHEP::mm, 4.534*CLHEP::mm)); // eta,phi @@ -468,7 +477,7 @@ void ReadSiDetectorElements::printRandomAccess() { positions.clear(); cellIds.push_back(SiCellId(532)); // phi,eta cellIds.push_back(SiCellId(0)); // phi,eta - cellIds.push_back(SiCellId(-1)); // phi,eta + if(m_testNegativeStrips) cellIds.push_back(SiCellId(-1)); // phi,eta cellIds.push_back(SiCellId(767)); // phi,eta cellIds.push_back(SiCellId(768)); // phi,eta positions.push_back(Amg::Vector2D(12.727*CLHEP::mm, 20.534*CLHEP::mm)); // eta,phi @@ -559,11 +568,13 @@ ReadSiDetectorElements::testElement(const Identifier & id, << endl; cout << " center: r (mm) = " << element->center().perp()/CLHEP::mm << ", phi (deg) = " << element->center().phi()/CLHEP::deg << endl; - const InDet::SiliconProperties & siProperties = m_siPropertiesSvc->getSiProperties(hashId); - cout << " Lorentz correction (mm), mobility (cm2/V/s), tanLorentzPhi = " - << element->getLorentzCorrection()/CLHEP::mm << " " - << siProperties.hallMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " - << element->getTanLorentzAnglePhi() << endl; + if(m_useSiProperties){ + const InDet::SiliconProperties & siProperties = m_siPropertiesSvc->getSiProperties(hashId); + cout << " Lorentz correction (mm), mobility (cm2/V/s), tanLorentzPhi = " + << element->getLorentzCorrection()/CLHEP::mm << " " + << siProperties.hallMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " + << element->getTanLorentzAnglePhi() << endl; + } cout << " Temperature (C), bias voltage, depletion voltage: " << m_siConditionsSvc->temperature(hashId) << " " << m_siConditionsSvc->biasVoltage(hashId) << " "