From ae0c8c383dfb2fe845d1b7cbdd166e54560de521 Mon Sep 17 00:00:00 2001 From: Vakhtang Tsulaia <Vakhtang.Tsulaia@cern.ch> Date: Mon, 9 Jul 2012 23:01:09 +0200 Subject: [PATCH] Migrate to CLHEP v21 (SCT_GeoModel-00-12-05) --- .../InDetDetDescr/SCT_GeoModel/README | 16 + .../SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h | 56 ++ .../SCT_GeoModel/SCT_BarrelModuleParameters.h | 68 ++ .../SCT_GeoModel/SCT_BarrelParameters.h | 190 ++++ .../SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h | 46 + .../SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h | 40 + .../SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h | 43 + .../SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h | 39 + .../SCT_GeoModel/SCT_ComponentFactory.h | 85 ++ .../SCT_GeoModel/SCT_CoolingBlock.h | 41 + .../SCT_GeoModel/SCT_CoolingEnd.h | 44 + .../SCT_GeoModel/SCT_CoolingPipe.h | 39 + .../SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h | 163 ++++ .../SCT_GeoModel/SCT_DetectorFactory.h | 44 + .../SCT_GeoModel/SCT_DetectorFactoryCosmic.h | 45 + .../SCT_GeoModel/SCT_DetectorTool.h | 60 ++ .../SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h | 43 + .../SCT_GeoModel/SCT_FSIEndJewel.h | 39 + .../SCT_GeoModel/SCT_FSIFibreMask.h | 41 + .../SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h | 79 ++ .../SCT_GeoModel/SCT_FSIScorpion.h | 39 + .../SCT_GeoModel/SCT_GeoModel/SCT_Flange.h | 42 + .../SCT_GeoModel/SCT_GeoModel/SCT_Forward.h | 76 ++ .../SCT_ForwardModuleParameters.h | 101 ++ .../SCT_GeoModel/SCT_ForwardParameters.h | 187 ++++ .../SCT_GeoModel/SCT_FwdCoolingBlock.h | 53 ++ .../SCT_GeoModel/SCT_FwdCoolingPipe.h | 50 + .../SCT_GeoModel/SCT_FwdCylinderServices.h | 69 ++ .../SCT_GeoModel/SCT_FwdDiscFixation.h | 39 + .../SCT_GeoModel/SCT_FwdDiscPowerTape.h | 44 + .../SCT_GeoModel/SCT_FwdDiscSupport.h | 45 + .../SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h | 44 + .../SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h | 60 ++ .../SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h | 97 ++ .../SCT_GeoModel/SCT_FwdModuleConnector.h | 42 + .../SCT_GeoModel/SCT_FwdOptoHarness.h | 44 + .../SCT_GeoModel/SCT_FwdPPConnector.h | 41 + .../SCT_GeoModel/SCT_FwdPPCooling.h | 41 + .../SCT_GeoModel/SCT_FwdPatchPanel.h | 47 + .../SCT_GeoModel/SCT_FwdPowerTape.h | 48 + .../SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h | 116 +++ .../SCT_GeoModel/SCT_FwdRingCooling.h | 44 + .../SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h | 123 +++ .../SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h | 48 + .../SCT_GeoModel/SCT_FwdSubSpine.h | 66 ++ .../SCT_GeoModel/SCT_FwdSupportFrame.h | 48 + .../SCT_FwdThermalShieldElement.h | 50 + .../SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h | 111 +++ .../SCT_GeoModel/SCT_GeneralParameters.h | 42 + .../SCT_GeoModel/SCT_GeoModelAthenaComps.h | 36 + .../SCT_GeoModel/SCT_GeometryManager.h | 67 ++ .../SCT_GeoModel/SCT_GeoModel/SCT_Harness.h | 39 + .../SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h | 38 + .../SCT_GeoModel/SCT_Identifier.h | 59 ++ .../SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h | 81 ++ .../SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h | 58 ++ .../SCT_GeoModel/SCT_GeoModel/SCT_Layer.h | 116 +++ .../SCT_GeoModel/SCT_MaterialManager.h | 54 ++ .../SCT_GeoModel/SCT_GeoModel/SCT_Module.h | 105 +++ .../SCT_GeoModel/SCT_GeoModel/SCT_Options.h | 41 + .../SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h | 72 ++ .../SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h | 38 + .../SCT_GeoModel/SCT_PixelAttachment.h | 48 + .../SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h | 40 + .../SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h | 43 + .../SCT_GeoModel/SCT_GeoModel/SCT_Ski.h | 143 +++ .../SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h | 84 ++ .../SCT_GeoModel/SCT_SkiPowerTape.h | 50 + .../SCT_GeoModel/SCT_GeoModel/SCT_Spider.h | 39 + .../SCT_GeoModel/SCT_SupportCyl.h | 41 + .../SCT_GeoModel/cmt/requirements | 32 + .../InDetDetDescr/SCT_GeoModel/doc/mainpage.h | 52 ++ .../SCT_GeoModel/src/SCT_Barrel.cxx | 299 ++++++ .../src/SCT_BarrelModuleParameters.cxx | 257 ++++++ .../SCT_GeoModel/src/SCT_BarrelParameters.cxx | 869 ++++++++++++++++++ .../SCT_GeoModel/src/SCT_BaseBoard.cxx | 55 ++ .../SCT_GeoModel/src/SCT_Bracket.cxx | 55 ++ .../SCT_GeoModel/src/SCT_Clamp.cxx | 54 ++ .../SCT_GeoModel/src/SCT_CloseOut.cxx | 51 + .../SCT_GeoModel/src/SCT_ComponentFactory.cxx | 52 ++ .../SCT_GeoModel/src/SCT_CoolingBlock.cxx | 54 ++ .../SCT_GeoModel/src/SCT_CoolingEnd.cxx | 55 ++ .../SCT_GeoModel/src/SCT_CoolingPipe.cxx | 50 + .../SCT_GeoModel/src/SCT_DataBase.cxx | 298 ++++++ .../SCT_GeoModel/src/SCT_DetectorFactory.cxx | 320 +++++++ .../SCT_GeoModel/src/SCT_DetectorTool.cxx | 329 +++++++ .../SCT_GeoModel/src/SCT_Dogleg.cxx | 56 ++ .../SCT_GeoModel/src/SCT_FSIEndJewel.cxx | 53 ++ .../SCT_GeoModel/src/SCT_FSIFibreMask.cxx | 52 ++ .../SCT_GeoModel/src/SCT_FSIHelper.cxx | 110 +++ .../SCT_GeoModel/src/SCT_FSIScorpion.cxx | 53 ++ .../SCT_GeoModel/src/SCT_Flange.cxx | 60 ++ .../SCT_GeoModel/src/SCT_Forward.cxx | 283 ++++++ .../src/SCT_ForwardModuleParameters.cxx | 391 ++++++++ .../src/SCT_ForwardParameters.cxx | 776 ++++++++++++++++ .../SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx | 68 ++ .../SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx | 68 ++ .../src/SCT_FwdCylinderServices.cxx | 241 +++++ .../SCT_GeoModel/src/SCT_FwdDiscFixation.cxx | 51 + .../SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx | 52 ++ .../SCT_GeoModel/src/SCT_FwdDiscSupport.cxx | 50 + .../SCT_GeoModel/src/SCT_FwdFSI.cxx | 52 ++ .../SCT_GeoModel/src/SCT_FwdHybrid.cxx | 126 +++ .../SCT_GeoModel/src/SCT_FwdModule.cxx | 316 +++++++ .../src/SCT_FwdModuleConnector.cxx | 66 ++ .../SCT_GeoModel/src/SCT_FwdOptoHarness.cxx | 68 ++ .../SCT_GeoModel/src/SCT_FwdPPConnector.cxx | 52 ++ .../SCT_GeoModel/src/SCT_FwdPPCooling.cxx | 52 ++ .../SCT_GeoModel/src/SCT_FwdPatchPanel.cxx | 54 ++ .../SCT_GeoModel/src/SCT_FwdPowerTape.cxx | 62 ++ .../SCT_GeoModel/src/SCT_FwdRing.cxx | 404 ++++++++ .../SCT_GeoModel/src/SCT_FwdRingCooling.cxx | 54 ++ .../SCT_GeoModel/src/SCT_FwdSensor.cxx | 361 ++++++++ .../SCT_GeoModel/src/SCT_FwdSpine.cxx | 107 +++ .../SCT_GeoModel/src/SCT_FwdSubSpine.cxx | 134 +++ .../SCT_GeoModel/src/SCT_FwdSupportFrame.cxx | 56 ++ .../src/SCT_FwdThermalShieldElement.cxx | 56 ++ .../SCT_GeoModel/src/SCT_FwdWheel.cxx | 550 +++++++++++ .../src/SCT_GeneralParameters.cxx | 91 ++ .../src/SCT_GeoModelAthenaComps.cxx | 37 + .../SCT_GeoModel/src/SCT_GeometryManager.cxx | 134 +++ .../SCT_GeoModel/src/SCT_Harness.cxx | 51 + .../SCT_GeoModel/src/SCT_Hybrid.cxx | 49 + .../SCT_GeoModel/src/SCT_Identifier.cxx | 28 + .../SCT_GeoModel/src/SCT_InnerSide.cxx | 207 +++++ .../SCT_GeoModel/src/SCT_InterLink.cxx | 133 +++ .../SCT_GeoModel/src/SCT_Layer.cxx | 507 ++++++++++ .../SCT_GeoModel/src/SCT_MaterialManager.cxx | 128 +++ .../SCT_GeoModel/src/SCT_Module.cxx | 407 ++++++++ .../SCT_GeoModel/src/SCT_Options.cxx | 78 ++ .../SCT_GeoModel/src/SCT_OuterSide.cxx | 219 +++++ .../SCT_GeoModel/src/SCT_Pigtail.cxx | 50 + .../SCT_GeoModel/src/SCT_PixelAttachment.cxx | 52 ++ .../SCT_GeoModel/src/SCT_PowerTape.cxx | 50 + .../SCT_GeoModel/src/SCT_Sensor.cxx | 167 ++++ .../SCT_GeoModel/src/SCT_Ski.cxx | 527 +++++++++++ .../SCT_GeoModel/src/SCT_SkiAux.cxx | 261 ++++++ .../SCT_GeoModel/src/SCT_SkiPowerTape.cxx | 173 ++++ .../SCT_GeoModel/src/SCT_Spider.cxx | 52 ++ .../SCT_GeoModel/src/SCT_SupportCyl.cxx | 53 ++ .../src/components/SCT_GeoModel_entries.cxx | 9 + .../src/components/SCT_GeoModel_load.cxx | 5 + 142 files changed, 15654 insertions(+) create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/README create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactoryCosmic.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h create mode 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeoModelAthenaComps.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Options.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/cmt/requirements create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/doc/mainpage.h create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx create mode 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeoModelAthenaComps.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx create mode 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Options.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/components/SCT_GeoModel_entries.cxx create mode 100755 InnerDetector/InDetDetDescr/SCT_GeoModel/src/components/SCT_GeoModel_load.cxx diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/README b/InnerDetector/InDetDetDescr/SCT_GeoModel/README new file mode 100755 index 00000000000..c33092d80e6 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/README @@ -0,0 +1,16 @@ +Package: offline/InnerDetector/InDetDetDescr/SCT_GeoModel + +Responsible: Pat Ward <cpw1@hep.phy.cam.ac.uk> + +Description: GeoModel description of the SCT. Creates the raw geometry and + readout elements. + +Inputs: Detector Description, Identifiers + +Outputs: Geometry, Detector Elements. + +Dependencies: Geometry Database, Identifiers, Detector Description. + +JobOptions: + +Last modified: December 11, 2008 by Pat Ward diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h new file mode 100755 index 00000000000..496da203672 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h @@ -0,0 +1,56 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_BARREL_H +#define SCT_GEOMODEL_SCT_BARREL_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" +#include "AthenaKernel/MsgStreamMember.h" + +class GeoVPhysVol; +class GeoFullPhysVol; +class GeoLogVol; +class SCT_Identifier; + +class SCT_Barrel : public SCT_UniqueComponentFactory +{ + +public: + SCT_Barrel(const std::string & name); + virtual GeoVPhysVol * build(SCT_Identifier id) const; + +public: + int numLayers() const {return m_numLayers;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + + MsgStream& msg( MSG::Level lvl ) const { return m_msg << lvl; } + bool msgLvl( MSG::Level lvl ) { return m_msg.get().level() <= lvl; } + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + + void buildThermalShield(GeoFullPhysVol * parent) const; + void buildEMIShield(GeoFullPhysVol * parent) const; + + + int m_numLayers; + + double m_innerRadius; + double m_outerRadius; + double m_length; + + double m_thermalShieldEndWallThickness; + + double m_zClearance; + + bool m_isOldGeometry; + + mutable Athena::MsgStreamMember m_msg; + +}; + +#endif // SCT_GEOMODEL_SCT_BARREL_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h new file mode 100755 index 00000000000..7b40a6ffa3c --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h @@ -0,0 +1,68 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GeoModel_SCT_BarrelModuleParameters_H +#define SCT_GeoModel_SCT_BarrelModuleParameters_H + +#include <string> + +class SCT_DataBase; + +class SCT_BarrelModuleParameters { + +public: + + // Constructor + SCT_BarrelModuleParameters(); + + // Sensors + double sensorThickness() const; + double sensorWidth() const; + double sensorLength() const; + int sensorNumWafers() const; + std::string sensorMaterial() const; + double sensorDistCenterToCenter() const; + double sensorStripLength() const; + double sensorStripPitch() const; + int sensorNumStrips() const; + int sensorNumReadoutStrips() const; + int sensorStripShift() const; + + // BaseBoard + double baseBoardThickness() const; + double baseBoardWidth() const; + double baseBoardLength() const; + std::string baseBoardMaterial() const; + double baseBoardOffsetY() const; + double baseBoardOffsetZ() const; + + // Hybrid + double hybridThickness() const; + double hybridWidth() const; + double hybridLength() const; + std::string hybridMaterial() const; + double hybridOffsetX() const; + double hybridOffsetZ() const; + + // Pigtail + double pigtailThickness() const; + double pigtailWidth() const; + double pigtailLength() const; + std::string pigtailMaterial() const; + + // Module + int moduleStereoUpperSign() const; + int moduleUpperSideNumber() const; + double moduleStereoAngle() const; + double moduleSensorToSensorGap() const; + + +private: + + SCT_DataBase * m_rdb; + +}; + + +#endif // SCT_GeoModel_SCT_BarrelModuleParameters_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h new file mode 100755 index 00000000000..111dbe08b81 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h @@ -0,0 +1,190 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GeoModel_SCT_BarrelParameters_H +#define SCT_GeoModel_SCT_BarrelParameters_H + +#include <string> + +class SCT_DataBase; + +class SCT_BarrelParameters { + +public: + + // Constructor + SCT_BarrelParameters(); + + // Ski + int skiFirstStagger() const; + double skiRadialSep() const; + int modulesPerSki() const; + double skiZPosition(int index) const; + int skiModuleIdentifier(int index) const; + + // Layer + double tilt(int iLayer) const; + int layerStereoSign(int iLayer) const; + double radius(int iLayer) const; + int skisPerLayer(int iLayer) const; + double layerBracketPhiOffset(int iLayer) const; + double layerPhiOfRefModule(int iLayer) const; + + // Bracket + double bracketThickness() const; + double bracketWidth() const; + double bracketLength() const; + std::string bracketMaterial() const; + + // Dogleg + double doglegThickness() const; + double doglegWidth() const; + double doglegLength() const; + std::string doglegMaterial() const; + double doglegOffsetX() const; + double doglegOffsetY() const; + + // CoolingBlock + double coolingBlockThickness() const; + double coolingBlockWidth() const; + double coolingBlockLength() const; + std::string coolingBlockMaterial() const; + double coolingBlockOffsetX() const; + double coolingBlockOffsetY() const; + double coolingBlockOffsetZ() const; + + // CoolingPipe + double coolingPipeRadius() const; + std::string coolingPipeMaterial() const; + double coolingPipeOffsetX() const; + double coolingPipeOffsetY() const; + + // PowerTape + double powerTapeThickness() const; + double powerTapeWidth() const; + std::string powerTapeMaterial() const; + double powerTapeStartPointOffset() const; + + // Harness + double harnessThickness() const; + double harnessWidth() const; + std::string harnessMaterial() const; + + // SupportCyl + double supportCylInnerRadius(int iLayer) const; + double supportCylOuterRadius(int iLayer) const; + double supportCylDeltaR(int iLayer) const; + std::string supportCylMaterial(int iLayer) const; + + // Flange + double flangeDeltaZ(int iLayer) const; + double flangeDeltaR(int iLayer) const; + std::string flangeMaterial(int iLayer) const; + + // Clamp + double clampDeltaZ(int iLayer) const; + double clampDeltaR(int iLayer) const; + std::string clampMaterial(int iLayer) const; + + // Cooling Inlet/outlets + double coolingEndDeltaR(int iLayer) const; + std::string coolingEndMaterial(int iLayer) const; + + // CloseOut + double closeOutDeltaZ(int iLayer) const; + std::string closeOutMaterial(int iLayer) const; + + // InterLink and B6 bearing + double interLinkDeltaZ() const; + double interLinkInnerRadius() const; + double interLinkOuterRadius() const; + std::string interLinkMaterial() const; + double interLinkDeltaPhi() const; + double interLinkPhiPos() const; + int interLinkNRepeat() const; + std::string bearingMaterial() const; + double bearingDeltaPhi() const; + double bearingPhiPos() const; + int bearingNRepeat() const; + + // FSI and FSI flange + bool includeFSI() const; + double fsiFlangeInnerRadius() const; + double fsiFlangeOuterRadius() const; + std::string fsiFlangeMaterial() const; + double fsiFibreMaskDeltaR() const; + std::string fsiFibreMaskMaterial() const; + double fsiEndJewelRadialWidth() const; + double fsiEndJewelRPhiWidth() const; + double fsiEndJewelLength() const; + std::string fsiEndJewelMaterial() const; + int fsiEndJewelNRepeat(int iLayer) const; + double fsiEndJewelPhi(int iLayer) const; + double fsiEndJewelZ(int iLayer) const; + double fsiScorpionRadialWidth() const; + double fsiScorpionRPhiWidth() const; + double fsiScorpionLength() const; + std::string fsiScorpionMaterial() const; + int fsiScorpionNRepeat(int iLayer) const; + double fsiScorpionPhi(int iLayer) const; + double fsiScorpionZ(int iLayer) const; + + // Spider + double spiderDeltaZ() const; + double spiderInnerRadius() const; + double spiderOuterRadius() const; + std::string spiderMaterial() const; + + // Thermal Shield + double thermalShieldInnerRadius() const; + double thermalShieldOuterRadius() const; + double thermalShieldEndZMax() const; + double thermalShieldCylTotalThickness() const; + double thermalShieldCylInnerWallThickness() const; + double thermalShieldCylOuterWallThickness() const; + double thermalShieldSpacerZWidth() const; + double thermalShieldFirstSpacerZMin() const; + double thermalShieldEndCapCylThickness() const; + double thermalShieldEndCapThickness() const; + double thermalShieldBulkheadInnerRadius() const; + double thermalShieldBulkheadOuterRadius() const; + double thermalShieldEndPanelInnerRadius() const; + double thermalShieldEndPanelOuterRadius() const; + std::string thermalShieldMaterialSpacer() const; + std::string thermalShieldMaterialCyl() const; + std::string thermalShieldMaterialOuterSect() const; + std::string thermalShieldMaterialInnerSect() const; + + // EMI Shield (Inner Thermal Shield) + double emiShieldInnerRadius() const; + double emiShieldDeltaR() const; + double emiShieldZMax() const; + std::string emiShieldMaterial() const; + double emiJointDeltaR() const; + double emiJointRPhi() const; + std::string emiJointMaterial() const; + + // Attachment of pixel to SCT. + double pixelAttachmentInnerRadius() const; + double pixelAttachmentOuterRadius() const; + double pixelAttachmentZMin() const; + double pixelAttachmentDeltaZ() const; + std::string pixelAttachmentMaterial() const; + + // Barrel General + int numLayers() const; + double barrelInnerRadius() const; + double barrelOuterRadius() const; + double barrelLength() const; + double cylinderLength() const; + double activeLength() const; + bool isOldGeometry() const; + + private: + SCT_DataBase * m_rdb; + +}; + + +#endif // SCT_GeoModel_SCT_BarrelParameters_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h new file mode 100755 index 00000000000..42b689d5be7 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_BaseBoard_H +#define SCT_GEOMODEL_SCT_BaseBoard_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + +class SCT_BaseBoard: public SCT_SharedComponentFactory +{ +public: + SCT_BaseBoard(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + + //double baseBoardOffsetX() const {return m_baseBoardOffsetX;} // Thu 16th Jun 2005 D.Naito removed. + //double baseBoardOffsetY() const {return m_baseBoardOffsetY;} // Thu 16th Jun 2005 D.Naito removed. + //double baseBoardOffsetZ() const {return m_baseBoardOffsetZ;} // Thu 16th Jun 2005 D.Naito removed. + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + double m_thickness; + double m_width; + double m_length; + + //double m_baseBoardOffsetX; // Thu 16th Jun 2005 D.Naito removed. + //double m_baseBoardOffsetY; // Thu 16th Jun 2005 D.Naito removed. + //double m_baseBoardOffsetZ; // Thu 16th Jun 2005 D.Naito removed. + double m_safety; + +}; + +#endif // SCT_GEOMODEL_SCT_BaseBoard_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h new file mode 100755 index 00000000000..73057d438ab --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_BRACKET_H +#define SCT_GEOMODEL_SCT_BRACKET_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + + +class SCT_Bracket: public SCT_SharedComponentFactory + +{ + +public: + SCT_Bracket(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + double m_thickness; + double m_width; + double m_length; + +}; + +#endif // SCT_GEOMODEL_SCT_BRACKET_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h new file mode 100755 index 00000000000..78cb9c51599 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_CLAMP_H +#define SCT_GEOMODEL_SCT_CLAMP_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_Clamp : public SCT_SharedComponentFactory +{ + +public: + SCT_Clamp(const std::string & name, int iLayer, + double innerRadius); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_iLayer; + + const GeoMaterial * m_material; + std::string m_materialName; + double m_innerRadius; + double m_outerRadius; + double m_length; + double m_radialWidth; +}; + +#endif // SCT_GEOMODEL_SCT_CLAMP_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h new file mode 100755 index 00000000000..4586a5856ba --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_CLOSEOUT_H +#define SCT_GEOMODEL_SCT_CLOSEOUT_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" +#include <string> + +class GeoMaterial; + +class SCT_CloseOut : public SCT_SharedComponentFactory +{ + +public: + SCT_CloseOut(const std::string & name, int iLayer); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_iLayer; + + const GeoMaterial * m_material; + double m_innerRadius; + double m_outerRadius; + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_CLOSEOUT_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h new file mode 100755 index 00000000000..a87f6f9f5c1 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h @@ -0,0 +1,85 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_COMPONENTFACTORY_H +#define SCT_GEOMODEL_SCT_COMPONENTFACTORY_H + +#include "SCT_GeoModel/SCT_Identifier.h" +#include <string> + +namespace InDetDD{class SCT_DetectorManager;} +class SCT_GeometryManager; + +class GeoLogVol; +class GeoVPhysVol; + + +class SCT_ComponentFactory +{ + +public: + SCT_ComponentFactory(const std::string & name); + + const std::string & getName() const {return m_name;} + + static void setDetectorManager(InDetDD::SCT_DetectorManager * manager); + static void setGeometryManager(SCT_GeometryManager * manager); + + // utility function to covert int to string + static std::string intToString(int i); + +protected: + InDetDD::SCT_DetectorManager * detectorManager() const {return s_detectorManager;} + const SCT_GeometryManager * geometryManager() const {return s_geometryManager;} + + double epsilon() const; + + virtual ~SCT_ComponentFactory(); + +private: + std::string m_name; + static double s_epsilon; + + static InDetDD::SCT_DetectorManager* s_detectorManager; + static const SCT_GeometryManager* s_geometryManager; + +}; + + +class SCT_SharedComponentFactory : public SCT_ComponentFactory +{ + +public: + SCT_SharedComponentFactory(const std::string & name) : + SCT_ComponentFactory(name), + m_physVolume(0) + {}; + + GeoVPhysVol * getVolume() const {return m_physVolume;} + +protected: + GeoVPhysVol * m_physVolume; + virtual GeoVPhysVol * build() = 0; + +}; + +class SCT_UniqueComponentFactory : public SCT_ComponentFactory +{ + +public: + SCT_UniqueComponentFactory(const std::string & name) : + SCT_ComponentFactory(name), + m_logVolume(0) + {}; + + virtual GeoVPhysVol * build(SCT_Identifier id) const = 0; + +protected: + const GeoLogVol * m_logVolume; + + virtual const GeoLogVol * preBuild() = 0; + +}; + +#endif // SCT_GEOMODEL_SCT_COMPONENTFACTORY_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h new file mode 100755 index 00000000000..65612b0e06f --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_COOLINGBLOCK_H +#define SCT_GEOMODEL_SCT_COOLINGBLOCK_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + + +class SCT_CoolingBlock: public SCT_SharedComponentFactory + +{ + +public: + SCT_CoolingBlock(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + std::string m_materialName; + double m_thickness; + double m_width; + double m_length; + +}; + +#endif // SCT_GEOMODEL_SCT_COOLINGBLOCK_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h new file mode 100755 index 00000000000..c089f8564d3 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_COOLINGEND_H +#define SCT_GEOMODEL_SCT_COOLINGEND_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_CoolingEnd : public SCT_SharedComponentFactory +{ + +public: + SCT_CoolingEnd(const std::string & name, int iLayer, + double innerRadius, + double length); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_iLayer; + + const GeoMaterial * m_material; + std::string m_materialName; + double m_innerRadius; + double m_outerRadius; + double m_length; + double m_radialWidth; +}; + +#endif // SCT_GEOMODEL_SCT_COOLINGEND_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h new file mode 100755 index 00000000000..f538c271cd6 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_COOLINGPIPE_H +#define SCT_GEOMODEL_SCT_COOLINGPIPE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + + +class SCT_CoolingPipe: public SCT_SharedComponentFactory + +{ + +public: + SCT_CoolingPipe(const std::string & name, double length); + +public: + const GeoMaterial * material() const {return m_material;} + double pipeRadius() const {return m_pipeRadius;} + double length() const {return m_length;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + std::string m_materialName; + double m_pipeRadius; + double m_length; + +}; + +#endif // SCT_GEOMODEL_SCT_COOLINGPIPE_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h new file mode 100755 index 00000000000..933087e161a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h @@ -0,0 +1,163 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GeoModel_SCT_DataBase_H +#define SCT_GeoModel_SCT_DataBase_H + +#include "SCT_GeoModel/SCT_GeoModelAthenaComps.h" +#include <string> + +#include "RDBAccessSvc/IRDBAccessSvc.h" +class IRDBRecord; + + +class SCT_DataBase +{ + + +public: + + // Get pointer to singleton instance. + static SCT_DataBase * instance(); + + // Delete instance + static void reinit(); + + // Access to athena components + static void setAthenaComps(const SCT_GeoModelAthenaComps * athenaComps); + const SCT_GeoModelAthenaComps * athenaComps() const; + + + //const IRDBRecord* atls() const; + + IRDBRecordset_ptr weightTable() const; + IRDBRecordset_ptr scalingTable() const; + IRDBRecordset_ptr topLevelTable() const; + + IRDBRecordset_ptr conditionsTable() const; + const IRDBRecord* conditions() const; + + const IRDBRecord* brlSensor() const; + const IRDBRecord* brlModule() const; + + const IRDBRecord* brlSki() const; + const IRDBRecord* brlSkiZ(int i) const; + int brlSkiZSize() const; + const IRDBRecord* brlLayer(int i) const; + const IRDBRecord* brlServices() const; + const IRDBRecord* brlServPerLayer(int i) const; + const IRDBRecord* brlThermalShield() const; + const IRDBRecord* brlGeneral() const; + const IRDBRecord* brlFSI() const; + int brlFSISize() const; + const IRDBRecord* brlFSILocation(int i) const; + + const IRDBRecord* fwdSensor(int i) const; + const IRDBRecord* fwdHybrid() const; + const IRDBRecord* fwdSpine(int i) const; + const IRDBRecord* fwdModule(int i) const; + int fwdModuleSize() const; + IRDBRecordset_ptr fwdModuleConnectorTable() const; + const IRDBRecord* fwdModuleConnector() const; + + const IRDBRecord* fwdRing(int i) const; + int fwdRingSize() const; + const IRDBRecord* fwdWheel(int i) const; + const IRDBRecord* fwdWheelRingMap(int i) const; + int fwdWheelRingMapSize() const; + const IRDBRecord* fwdDiscSupport() const; + const IRDBRecord* fwdPatchPanelLoc(int i) const; + int fwdPatchPanelLocSize() const; + const IRDBRecord* fwdPatchPanel(int i) const; + int fwdPatchPanelSize() const; + const IRDBRecord* fwdPPConnector() const; + int fwdPPConnectorSize() const; + const IRDBRecord* fwdPPCooling() const; + int fwdPPCoolingSize() const; + const IRDBRecord* fwdCoolingBlock(int i) const; + const IRDBRecord* fwdRingServices(int i) const; + const IRDBRecord* fwdServices() const; + const IRDBRecord* fwdFSILocation(int i) const; + int fwdFSILocationSize() const; + const IRDBRecord* fwdFSIType(int i) const; + int fwdFSITypeSize() const; + const IRDBRecord* fwdFSI(int i) const; + int fwdFSISize() const; + const IRDBRecord* fwdThermalShield(int i) const; + int fwdThermalShieldSize() const; + const IRDBRecord* fwdGeneral() const; + IRDBRecordset_ptr fwdOptoHarnessTable() const; + const IRDBRecord* fwdOptoHarness(int i) const; + IRDBRecordset_ptr fwdDiscFixationTable() const; + const IRDBRecord* fwdDiscFixation() const; + const IRDBRecord* fwdCylServ(int i) const; + int fwdCylServSize() const; + const IRDBRecord* fwdCylServLoc(int i) const; + int fwdCylServLocSize() const; + + // Return the SCT version tag. + const std::string & versionTag() const; + + MsgStream& msg (MSG::Level lvl) const; + +private: + + // Singleton - Constructor is private + SCT_DataBase(); + SCT_DataBase(const SCT_DataBase &); + SCT_DataBase& operator= (const SCT_DataBase &); + +private: + + static SCT_DataBase * s_instance; + static const SCT_GeoModelAthenaComps * s_athenaComps; + + std::string m_sctVersionTag; + + IRDBRecordset_ptr m_weightTable; + IRDBRecordset_ptr m_scalingTable; + IRDBRecordset_ptr m_topLevel; + IRDBRecordset_ptr m_conditions; + + IRDBRecordset_ptr m_brlSensor; + IRDBRecordset_ptr m_brlModule; + IRDBRecordset_ptr m_brlSki; + IRDBRecordset_ptr m_brlSkiZ; + IRDBRecordset_ptr m_brlLayer; + IRDBRecordset_ptr m_brlServices; + IRDBRecordset_ptr m_brlServPerLayer; + IRDBRecordset_ptr m_brlThermalShield; + IRDBRecordset_ptr m_brlGeneral; + IRDBRecordset_ptr m_brlFSI; + IRDBRecordset_ptr m_brlFSILocation; + IRDBRecordset_ptr m_fwdSensor; + IRDBRecordset_ptr m_fwdHybrid; + IRDBRecordset_ptr m_fwdSpine; + IRDBRecordset_ptr m_fwdModule; + IRDBRecordset_ptr m_fwdModuleConnector; + IRDBRecordset_ptr m_fwdRing; + IRDBRecordset_ptr m_fwdWheel; + IRDBRecordset_ptr m_fwdWheelRingMap; + IRDBRecordset_ptr m_fwdDiscSupport; + IRDBRecordset_ptr m_fwdPatchPanelLoc; + IRDBRecordset_ptr m_fwdPatchPanel; + IRDBRecordset_ptr m_fwdPPConnector; + IRDBRecordset_ptr m_fwdPPCooling; + IRDBRecordset_ptr m_fwdCoolingBlock; + IRDBRecordset_ptr m_fwdRingServices; + IRDBRecordset_ptr m_fwdServices; + IRDBRecordset_ptr m_fwdFSILocation; + IRDBRecordset_ptr m_fwdFSIType; + IRDBRecordset_ptr m_fwdFSI; + IRDBRecordset_ptr m_fwdThermalShield; + IRDBRecordset_ptr m_fwdGeneral; + IRDBRecordset_ptr m_fwdOptoHarness; + IRDBRecordset_ptr m_fwdDiscFixation; + IRDBRecordset_ptr m_fwdCylServ; + IRDBRecordset_ptr m_fwdCylServLoc; + + +}; + +#endif //SCT_GeoModel_SCT_DataBase_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h new file mode 100755 index 00000000000..5a2b831ff86 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_DETECTORFACTORY_H +#define SCT_GEOMODEL_SCT_DETECTORFACTORY_H + +#include "InDetGeoModelUtils/InDetDetectorFactoryBase.h" +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +class GeoPhysVol; +class SCT_GeometryManager; +class SCT_Options; +class SCT_GeoModelAthenaComps; + +class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase +{ + + public: + // Constructor + SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaComps, + const SCT_Options & options); + + // Destructor + virtual ~SCT_DetectorFactory(); + + // Creation of geometry: + virtual void create(GeoPhysVol *world); + + // Access to the results: + virtual const InDetDD::SCT_DetectorManager * getDetectorManager() const; + + private: + // Copy and assignments operations illegal and so are made private + SCT_DetectorFactory(const SCT_DetectorFactory &right); + const SCT_DetectorFactory & operator=(const SCT_DetectorFactory &right); + + InDetDD::SCT_DetectorManager *m_detectorManager; + SCT_GeometryManager *m_geometryManager; + +}; + +#endif + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactoryCosmic.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactoryCosmic.h new file mode 100755 index 00000000000..e40d27a311d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactoryCosmic.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_DETECTORFACTORYCOSMIC_H +#define SCT_GEOMODEL_SCT_DETECTORFACTORYCOSMIC_H + +#include "GeoModelKernel/GeoVDetectorFactory.h" +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +class StoreGateSvc; +class ISvcLocator; +class GeoPhysVol; +class SCT_GeometryManager; +class SCT_Options; + +class SCT_DetectorFactoryCosmic : public GeoVDetectorFactory +{ + + public: + // Constructor + SCT_DetectorFactoryCosmic(ISvcLocator* svcLocator, StoreGateSvc *detStore, const SCT_Options & options); + + // Destructor + virtual ~SCT_DetectorFactoryCosmic(); + + // Creation of geometry: + virtual void create(GeoPhysVol *world); + + // Access to the results: + virtual const InDetDD::SCT_DetectorManager * getDetectorManager() const; + + private: + // Copy and assignments operations illegal and so are made private + SCT_DetectorFactoryCosmic(const SCT_DetectorFactoryCosmic &right); + const SCT_DetectorFactoryCosmic & operator=(const SCT_DetectorFactoryCosmic &right); + + InDetDD::SCT_DetectorManager *m_detectorManager; + SCT_GeometryManager *m_geometryManager; + + +}; + +#endif + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h new file mode 100755 index 00000000000..503354587f7 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h @@ -0,0 +1,60 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_DETECTORTOOL_H +#define SCT_GEOMODEL_SCT_DETECTORTOOL_H + +#include "GeoModelUtilities/GeoModelTool.h" +#include "GaudiKernel/ServiceHandle.h" + +class ISiLorentzAngleSvc; +class IGeoModelSvc; +class IRDBAccessSvc; +class IGeometryDBSvc; +class SCT_GeoModelAthenaComps; + +#include <string> + +namespace InDetDD { + class SCT_DetectorManager; +} + +class SCT_DetectorTool : public GeoModelTool { + +public: + + // Standard Constructor + SCT_DetectorTool( const std::string& type, const std::string& name, const IInterface* parent ); + + // Standard Destructor + virtual ~SCT_DetectorTool(); + + virtual StatusCode create( StoreGateSvc* detStore ); + virtual StatusCode clear(StoreGateSvc* detStore); + + // Register callback function on ConDB object + virtual StatusCode registerCallback( StoreGateSvc* detStore ); + + // Callback function itself + virtual StatusCode align(IOVSVC_CALLBACK_ARGS); + + +private: + std::string m_detectorName; + bool m_initialLayout; + bool m_alignable; + bool m_cosmic; + + const InDetDD::SCT_DetectorManager * m_manager; + + SCT_GeoModelAthenaComps * m_athenaComps; + + ServiceHandle< IGeoModelSvc > m_geoModelSvc; + ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc; + ServiceHandle< IGeometryDBSvc > m_geometryDBSvc; + ServiceHandle< ISiLorentzAngleSvc > m_lorentzAngleSvc; + +}; + +#endif // SCT_GEOMODEL_SCT_DETECTORTOOL_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h new file mode 100755 index 00000000000..567c8d1c28d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// 14th Aug 2005 S.Mima modified. +// +#ifndef SCT_GEOMODEL_SCT_DOGLEG_H +#define SCT_GEOMODEL_SCT_DOGLEG_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + + +class SCT_Dogleg: public SCT_SharedComponentFactory + +{ + +public: + SCT_Dogleg(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + double m_thickness; + double m_width; + double m_length; + +}; + +#endif // SCT_GEOMODEL_SCT_DOGLEG_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h new file mode 100755 index 00000000000..7c437e90042 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FSIENDJEWEL_H +#define SCT_GEOMODEL_SCT_FSIENDJEWEL_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_FSIEndJewel : public SCT_SharedComponentFactory +{ + +public: + SCT_FSIEndJewel(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double radialWidth() const {return m_radialWidth;} + double rPhiWidth() const {return m_rPhiWidth;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + std::string m_materialName; + double m_radialWidth; + double m_rPhiWidth; + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_FSIENDJEWEL_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h new file mode 100755 index 00000000000..63da137bdd6 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FSIFIBREMASK_H +#define SCT_GEOMODEL_SCT_FSIFIBREMASK_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_FSIFibreMask : public SCT_SharedComponentFactory +{ + +public: + SCT_FSIFibreMask(const std::string & name, int iLayer, double length); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_iLayer; + + const GeoMaterial * m_material; + std::string m_materialName; + double m_innerRadius; + double m_outerRadius; + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_FSIFIBREMASK_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h new file mode 100755 index 00000000000..8a185e29b20 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h @@ -0,0 +1,79 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FSIHELPER_H +#define SCT_GEOMODEL_SCT_FSIHELPER_H + +#include <vector> +#include <map> +#include <string> + +class SCT_DataBase; + +class FSILocation +{ +public: + FSILocation(std::string name, + double radius, + double phi, + int side); + + const std::string & name() const {return m_name;} + double radius() const {return m_radius;} + double phi() const {return m_phi;} + int side() const {return m_side;} + + +private: + std::string m_name; + double m_radius; + double m_phi; + int m_side; +}; + +class FSIDetails +{ + +public: + FSIDetails(const FSILocation * location, + int simType, + const std::string & simTypeString, + const std::string & locationType, + const std::string & actualType); + const FSILocation & location() const {return *m_location;} + int simType() const {return m_simType;} + const std::string & simTypeString() const {return m_simTypeStr;} + const std::string & locationType() const {return m_locType;} + const std::string & actualType() const {return m_actualType;} + +private: + const FSILocation * m_location; + int m_simType; + std::string m_simTypeStr; + std::string m_locType; + std::string m_actualType; + +}; + + +class FSIHelper +{ +public: + FSIHelper(SCT_DataBase * rdb); + ~FSIHelper(); + + // Gte vector of FSI details for a given wheel + const std::vector<const FSIDetails *> & fsiVector(int wheel) const; + +private: + void fill(); + + std::vector<std::vector<const FSIDetails *> * > m_wheelLocMap; + std::map<std::string, FSILocation *> m_locationTypes; + + SCT_DataBase * m_rdb; + +}; + +#endif // SCT_GEOMODEL_SCT_FSIHELPER_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h new file mode 100755 index 00000000000..ea18db3ca22 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FSISCORPION_H +#define SCT_GEOMODEL_SCT_FSISCORPION_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_FSIScorpion : public SCT_SharedComponentFactory +{ + +public: + SCT_FSIScorpion(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double radialWidth() const {return m_radialWidth;} + double rPhiWidth() const {return m_rPhiWidth;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + std::string m_materialName; + double m_radialWidth; + double m_rPhiWidth; + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_FSISCORPION_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h new file mode 100755 index 00000000000..26b55e5a561 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FLANGE_H +#define SCT_GEOMODEL_SCT_FLANGE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_Flange : public SCT_SharedComponentFactory +{ + +public: + SCT_Flange(const std::string & name, int iLayer); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_iLayer; + + const GeoMaterial * m_material; + std::string m_materialName; + double m_innerRadius; + double m_outerRadius; + double m_length; + double m_radialWidth; +}; + +#endif // SCT_GEOMODEL_SCT_FLANGE_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h new file mode 100755 index 00000000000..4c2934a7785 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h @@ -0,0 +1,76 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FORWARD_H +#define SCT_GEOMODEL_SCT_FORWARD_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <vector> + +class SCT_FwdModule; +class SCT_FwdWheel; + +class SCT_Forward : public SCT_UniqueComponentFactory +{ + +public: + + SCT_Forward(const std::string & name, int ec); + ~SCT_Forward(); + + // + // Methods to return basic and derived parameters. + // + // Retrieve basic parameters + // + + int numModuleTypes() const {return m_numModuleTypes;} + int numWheels() const {return m_numWheels;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double zMax() const {return m_zMax;} + double zMin() const {return m_zMin;} + double trtGapPos() const {return m_trtGapPos;} + + // + // Retrieve derived parameters + // + double length() const {return m_length;} + double zCenter() const {return 0.5*(m_zMin+m_zMax);} + + virtual GeoVPhysVol * build(SCT_Identifier id) const; + + + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + + // Basic parameters + int m_endcap; + int m_numModuleTypes; + int m_numWheels; + double m_innerRadius; + double m_outerRadius; + double m_zMin; + double m_zMax; + double m_trtGapPos; + double m_coolingPipeRadius; + int m_numThermalShieldElements; + bool m_cylinderServicesPresent; + + // Derived parameters + double m_length; + double m_outerRadiusCylinderServices; + + // Child detector elements + std::vector <const SCT_FwdWheel *> m_wheels; + + std::vector <const SCT_FwdModule *> m_modules; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDRING_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h new file mode 100755 index 00000000000..6f90aa29f50 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h @@ -0,0 +1,101 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GeoModel_SCT_ForwardModuleParameters_H +#define SCT_GeoModel_SCT_ForwardModuleParameters_H + +#include <string> + +class SCT_DataBase; + +class SCT_ForwardModuleParameters { + +public: + + // Constructor + SCT_ForwardModuleParameters(); + + // Sensor + // For Inner module there is only one sensor, + // the "Far" sensor is only defined in that case. + + int fwdSensorNumWafers(int iModuleType) const; + double fwdSensorThickness(int iModuleType) const; + double fwdSensorInnerWidthNear(int iModuleType) const; + double fwdSensorInnerWidthFar(int iModuleType) const; + double fwdSensorOuterWidthNear(int iModuleType) const; + double fwdSensorOuterWidthFar(int iModuleType) const; + double fwdSensorLengthNear(int iModuleType) const; + double fwdSensorLengthFar(int iModuleType) const; + double fwdSensorRadiusNear(int iModuleType) const; + double fwdSensorRadiusFar(int iModuleType) const; + std::string fwdSensorMaterialNear(int iModuleType) const; + std::string fwdSensorMaterialFar(int iModuleType) const; + bool fwdSensorActiveFar(int iModuleType) const; + bool fwdSensorActiveNear(int iModuleType) const; + + // Sensor + // Pitch and readout strips. + double fwdSensorActiveHalfLengthNear(int iModuleType) const; + double fwdSensorActiveHalfLengthFar(int iModuleType) const; + double fwdSensorAngularPitch(int iModuleType) const; + int fwdSensorNumStrips(int iModuleType) const; + int fwdSensorNumReadoutStrips(int iModuleType) const; + int fwdSensorStripShift(int iModuleType) const; + + // Hybrid + double fwdHybridThickness() const; + double fwdHybridInnerWidth() const; + double fwdHybridOuterWidth() const; + double fwdHybridLength() const; + double fwdHybridLengthToCorner() const; + double fwdHybridMountPointToInnerEdge() const; + std::string fwdHybridMaterial() const; + + // Spine + double fwdSpineThickness(int iModuleType) const; + double fwdSpineWidth(int iModuleType) const; + double fwdSpineEndToModuleCenter(int iModuleType) const; + double fwdSpineEndLocatorToEndMount(int iModuleType) const; + std::string fwdSpineMaterial(int iModuleType) const; + + // SubSpine + double fwdSubSpineInnerWidth(int iModuleType) const; + double fwdSubSpineInnerLength(int iModuleType) const; + double fwdSubSpineInnerRefDist(int iModuleType) const; + double fwdSubSpineMiddleWidth(int iModuleType) const; + double fwdSubSpineMiddleLength(int iModuleType) const; + double fwdSubSpineMiddleRefDist(int iModuleType) const; + double fwdSubSpineOuterWidth(int iModuleType) const; + double fwdSubSpineOuterLength(int iModuleType) const; + double fwdSubSpineOuterRefDist(int iModuleType) const; + std::string fwdSubSpineMaterial(int iModuleType) const; + + + // Module + int fwdModuleNumTypes() const; + double fwdModuleStereoAngle(int iModuleType) const; + int fwdModuleStereoUpperSign(int iModuleType) const; + int fwdModuleUpperSideNumber(int iModuleType) const; + double fwdModuleGlueThickness(int iModuleType) const; + double fwdModuleMountPoint(int iModuleType) const; + double fwdModuleDistBtwMountPoints(int iModuleType) const; + double fwdModuleHybridEdgeToSpine(int iModuleType) const; + bool fwdHybridIsOnInnerEdge(int iModuleType) const; + + // Module Connectors + bool fwdModuleConnectorPresent() const; + double fwdModuleConnectorDeltaR() const; + double fwdModuleConnectorRPhi() const; + double fwdModuleConnectorThickness() const; + std::string fwdModuleConnectorMaterial() const; + +private: + + SCT_DataBase * m_rdb; + +}; + + +#endif // SCT_GeoModel_SCT_ForwardModuleParameters_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h new file mode 100755 index 00000000000..2037c6e2e07 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h @@ -0,0 +1,187 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GeoModel_SCT_ForwardParameters_H +#define SCT_GeoModel_SCT_ForwardParameters_H + +#include <string> +#include <vector> + +class SCT_DataBase; +class FSIHelper; +class FSIDetails; + +class SCT_ForwardParameters { + +public: + + // Constructor and destructor + SCT_ForwardParameters(); + ~SCT_ForwardParameters(); + + ////////////////////////////////////////////////////////////////////////////// + // Forward SCT + ////////////////////////////////////////////////////////////////////////////// + + // Ring + //double fwdRingModuleToDiscCenter() const; + int fwdRingNumModules(int iRing) const; + double fwdRingModuleStagger(int iRing) const; + double fwdRingPhiOfRefModule(int iRing) const; + int fwdRingStaggerOfRefModule(int iRing) const; + int fwdRingUsualRingSide(int iRing) const; + double fwdRingDistToDiscCenter(int iRin) const; + + + + // Wheel + double fwdWheelZPosition(int iWheel) const; + int fwdWheelStereoType(int iWheel) const; + int fwdWheelNumRings(int iWheel) const; + + int fwdWheelRingMapIndex(int iWheel, int iRing, int ec) const; + int fwdWheelRingMapIndexDB(int iWheelDB, int iRing) const; + int fwdRingStaggerOfRefModule(int iWheel, int iRing, int ec) const; + int fwdWheelRingSide(int iWheel, int iRing, int ec) const; + int fwdWheelModuleType(int iWheel, int iRing, int ec) const; + + // DiscSupport + double fwdDiscSupportInnerRadius() const; + double fwdDiscSupportOuterRadius() const; + double fwdDiscSupportThickness() const; + std::string fwdDiscSupportMaterial() const; + + // PatchPanel + int fwdNumPatchPanelLocs() const; + int fwdPatchPanelType(int iLoc) const; + double fwdPatchPanelLocAngle(int iLoc) const; + bool fwdPatchPanelRepeatQuadrant(int iLoc) const; + int fwdNumPatchPanelTypes() const; + double fwdPatchPanelThickness(int iType) const; + double fwdPatchPanelMidRadius(int iType) const; + double fwdPatchPanelDeltaR(int iType) const; + double fwdPatchPanelRPhi(int iType) const; + std::string fwdPatchPanelMaterial(int iType) const; + + // PatchPanel Connector + bool fwdPPConnectorPresent() const; + double fwdPPConnectorThickness() const; + double fwdPPConnectorDeltaR() const; + double fwdPPConnectorRPhi() const; + std::string fwdPPConnectorMaterial() const; + + // PatchPanel Cooling + bool fwdPPCoolingPresent() const; + double fwdPPCoolingThickness() const; + double fwdPPCoolingDeltaR() const; + double fwdPPCoolingRPhi() const; + std::string fwdPPCoolingMaterial() const; + + // Cooling Block + int fwdCoolingBlockHiLo(int iType) const; + int fwdCoolingBlockMainOrSecondary(int iType) const; + double fwdCoolingBlockDeltaR(int iType) const; + double fwdCoolingBlockRPhi(int iType) const; + double fwdCoolingBlockThickness(int iType) const; + double fwdCoolingBlockOffsetFromDisc(int iType) const; + std::string fwdCoolingBlockMaterial(int iType) const; + + // DiscPowerTape + double fwdDiscPowerTapeInnerRadius(int iRing) const; + double fwdDiscPowerTapeOuterRadius(int iRing) const; + double fwdDiscPowerTapeThickness(int iRing) const; + std::string fwdDiscPowerTapeMaterial(int iRing) const; + + // RingCooling + double fwdRingCoolingInnerRadius(int iRing) const; + double fwdRingCoolingOuterRadius(int iRing) const; + double fwdRingCoolingThickness(int iRing) const; + std::string fwdRingCoolingMaterial(int iRing) const; + + // Disc Fixation + bool fwdDiscFixationPresent() const; + double fwdDiscFixationThickness() const; + double fwdDiscFixationRadius() const; + std::string fwdDiscFixationMaterial() const; + + // Support Frame + double fwdSupportFrameRadialThickness() const; + double fwdSupportFrameInnerRadius() const; + double fwdSupportFrameZMin() const; + double fwdSupportFrameZMax() const; + std::string fwdSupportFrameMaterial() const; + + // CoolingPipe + double fwdCoolingPipeRadius() const; + std::string fwdCoolingPipeMaterial() const; + + // PowerTape + double fwdPowerTapeCrossSectArea() const; + std::string fwdPowerTapeMaterial() const; + + // FSI + //int fwdFSINumLocTypes() const; + //std::string fwdFSILocType(int iLocIndex) const; + //double fwdFSILocRadius(int iLocIndex) const; + //double fwdFSILocPhi(int iLocIndex) const; + int fwdFSINumGeomTypes() const; + double fwdFSIGeomDeltaR(int iType) const; + double fwdFSIGeomRPhi(int iType) const; + double fwdFSIGeomThickness(int iType) const; + std::string fwdFSIGeomMaterial(int iType) const; + double fwdFSIGeomZOffset(int iType) const; + + //int fwdFSIWheel(int index) const; + //std::string fwdFSILocation(int index) const; + //int fwdFSISimType(int index) const; + const std::vector<const FSIDetails *> & fsiVector(int iWheel) const; + const FSIHelper & fsiHelper() const; + + // Cylinder Services + bool fwdCylinderServicePresent() const; + int fwdNumCylinderServiceLocs() const; + std::string fwdCylinderServiceLocName(int iLoc) const; + double fwdCylinderServiceLocAngle(int iLoc) const; + int fwdNumCylinderServiceTypes() const; + std::string fwdCylinderServiceName(int iType) const; + std::string fwdCylinderServiceMaterial(int iType) const; + double fwdCylinderServiceDeltaR(int iType) const; + double fwdCylinderServiceRPhi(int iType) const; + + // Thermal Shield + int fwdNumThermalShieldElements() const; + std::string fwdThermalShieldMaterial(int iElement) const; + double fwdThermalShieldInnerRadius(int iElement) const; + double fwdThermalShieldOuterRadius(int iElement) const; + double fwdThermalShieldZMin(int iElement) const; + double fwdThermalShieldZMax(int iElement) const; + + // Forward General + int fwdNumModuleTypes() const; + int fwdNumWheels() const; + double fwdInnerRadius() const; + double fwdOuterRadius() const; + double fwdZMin() const; + double fwdZMax() const; + double fwdTrtGapPos() const; + + // OptoHarness + bool fwdOptoHarnessPresent() const; + int fwdOptoHarnessDiscType(int itype) const; + double fwdOptoHarnessInnerRadius(int itype) const; + double fwdOptoHarnessOuterRadius(int itype) const; + double fwdOptoHarnessThickness(int itype) const; + std::string fwdOptoHarnessMaterial(int itype) const; + + +private: + + SCT_DataBase * m_rdb; + + mutable FSIHelper * m_fsiHelper; + +}; + + +#endif // SCT_GeoModel_SCT_ForwardParameters_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h new file mode 100755 index 00000000000..14b7c5608c7 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h @@ -0,0 +1,53 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDCOOLINGBLOCK_H +#define SCT_GEOMODEL_SCT_FWDCOOLINGBLOCK_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + + +class SCT_FwdCoolingBlock: public SCT_SharedComponentFactory + +{ + + +public: + SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary); + + enum types {UPPER = 1, + LOWER = -1, + MAIN = 0, + SECONDARY = 1}; + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double deltaR() const {return m_deltaR;} + double rphi() const {return m_rphi;} + double offsetFromDisc() const {return m_offset;} + double index() const {return m_coolingBlockIndex;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + std::string m_materialName; + double m_thickness; + double m_deltaR; + double m_rphi; + double m_offset; + int m_hiLo; + int m_mainSec; + int m_coolingBlockIndex; + +}; + +#endif // SCT_GEOMODEL_SCT_COOLINGBLOCK_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h new file mode 100755 index 00000000000..311bcf19091 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDCOOLINGPIPE_H +#define SCT_GEOMODEL_SCT_FWDCOOLINGPIPE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdCoolingPipe : public SCT_SharedComponentFactory +{ + +public: + +public: + SCT_FwdCoolingPipe(const std::string & name, + int numPipes, + double innerRadius, + double startPos, + double endPos); + + + const GeoMaterial * material() const {return m_material;} + double pipeRadius() const {return m_pipeRadius;} + + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double thickness() const {return m_thickness;} + double length() const {return m_length;} + double zPosition() const {return m_zPosition;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + int m_numPipes; + double m_pipeRadius; + double m_innerRadius; + double m_outerRadius; + double m_thickness; + double m_length; + double m_zPosition; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDCOOLINGPIPE_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h new file mode 100755 index 00000000000..7e655f575cb --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h @@ -0,0 +1,69 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDCYLINDERSERVICES_H +#define SCT_GEOMODEL_SCT_FWDCYLINDERSERVICES_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <vector> + +class SCT_FwdCylinderServices : public SCT_SharedComponentFactory +{ + +public: + + SCT_FwdCylinderServices(const std::string & name, double rmin, double rmax, double length); + ~SCT_FwdCylinderServices(); + + // + // Methods to return basic and derived parameters. + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + // Basic parameters + double m_innerRadius; + double m_outerRadius; + double m_length; + + // Parameters of daughters + std::vector<double> m_coolingLocAngle; + std::vector<double> m_lmtLocAngle; + std::vector<double> m_lmtCoolingLocAngle; + std::vector<double> m_fibreLocAngle; + std::vector<double> m_nPipeLocAngle; + std::vector<double> m_railLocAngle; + + double m_coolingDeltaR; + double m_lmtDeltaR; + double m_lmtCoolingDeltaR; + double m_fibreDeltaR; + double m_nPipeDeltaR; + double m_railDeltaR; + + double m_coolingRPhi; + double m_lmtRPhi; + double m_lmtCoolingRPhi; + double m_fibreRPhi; + double m_nPipeRPhi; + double m_railRPhi; + + std::string m_coolingMaterialName; + std::string m_lmtMaterialName; + std::string m_lmtCoolingMaterialName; + std::string m_fibreMaterialName; + std::string m_nPipeMaterialName; + std::string m_railMaterialName; + + double m_lmtCoolingZOffset; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDCYLINDERSERVICES_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h new file mode 100755 index 00000000000..8df7a7246f7 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDDISCFIXATION_H +#define SCT_GEOMODEL_SCT_FWDDISCFIXATION_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdDiscFixation : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdDiscFixation(const std::string & name); + + // + // Methods to return basic and derived parameters. + // + const GeoMaterial * material() const {return m_material;} + double radius() const {return m_radius;} + double thickness() const {return m_thickness;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + // Basic parameters + double m_radius; + double m_thickness; + const GeoMaterial * m_material; + std::string m_materialName; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDDISCFIXATION_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h new file mode 100755 index 00000000000..94bdedc770c --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDDISCPOWERTAPE_H +#define SCT_GEOMODEL_SCT_FWDDISCPOWERTAPE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdDiscPowerTape : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdDiscPowerTape(const std::string & name, int iRing); + + // + // Methods to return basic and derived parameters. + // + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_ringNumber; + + double m_thickness; + double m_innerRadius; + double m_outerRadius; + + const GeoMaterial * m_material; + std::string m_materialName; + + +}; + +#endif // SCT_GEOMODEL_SCT_FWDDISCPOWERTAPE_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h new file mode 100755 index 00000000000..97b6c4b80a1 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDDISCSUPPORT_H +#define SCT_GEOMODEL_SCT_FWDDISCSUPPORT_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdDiscSupport : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdDiscSupport(const std::string & name, int iWheel); + + // + // Methods to return basic and derived parameters. + // + // Retrieve basic parameters + // + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double thickness() const {return m_thickness;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_iWheel; + + // Basic parameters + double m_innerRadius; + double m_outerRadius; + double m_thickness; + const GeoMaterial * m_material; + std::string m_materialName; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDDISCSUPPORT_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h new file mode 100755 index 00000000000..4f4b933ed71 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDFSI_H +#define SCT_GEOMODEL_SCT_FWDFSI_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdFSI : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdFSI(const std::string & name, int type); + + // + // Methods to return basic and derived parameters. + // + const GeoMaterial * material() const {return m_material;} + double deltaR() const {return m_deltaR;} + double rphi() const {return m_rphi;} + double thickness() const {return m_thickness;} + double zOffset() const {return m_zOffset;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_type; + + // Basic parameters + double m_deltaR; + double m_rphi; + double m_thickness; + double m_zOffset; + const GeoMaterial * m_material; + std::string m_materialName; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDFSI_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h new file mode 100755 index 00000000000..db0069b7b6c --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h @@ -0,0 +1,60 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDHYBRID_H +#define SCT_GEOMODEL_SCT_FWDHYBRID_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + +class SCT_FwdHybrid : public SCT_SharedComponentFactory +{ +public: + SCT_FwdHybrid(const std::string & name, int ringType); + +public: + //int hybridPart() const {return m_hybridPart;} + + // inline methods + const GeoMaterial * material() const {return m_material;} + double outerWidth() const { return m_outerWidth; } + double innerWidth() const { return m_innerWidth; } + double length() const { return m_length; } + double thickness() const { return m_thickness; } + + double mountPointToOuterEdge() const { return m_mountPointToOuterEdge; } + double mountPointToInnerEdge() const { return m_mountPointToInnerEdge; } + + virtual GeoVPhysVol * build(); + +private: + void getParameters(); + + int m_ringType; + + double m_outerWidth; // Outer width of hybrid. (When module is placed on + // inner edge). ie the long side with wire bonds. + double m_innerWidth; // Inner width + double m_length1; + + double m_length; // Length (radially). + double m_thickness; + + double m_width2; // second part of hybrid - rectangular + double m_length2; + double m_thickness2; + + double m_mountPointToInnerEdge; + double m_mountPointToOuterEdge; + + const GeoMaterial * m_material; + std::string m_materialName; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDHYBRID_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h new file mode 100755 index 00000000000..968be7cd38a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h @@ -0,0 +1,97 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDMODULE_H +#define SCT_GEOMODEL_SCT_FWDMODULE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include "SCT_GeoModel/SCT_FwdSensor.h" + +#include <string> + +class SCT_Identifier; +class SCT_FwdModuleConnector; +class SCT_FwdHybrid; +class SCT_FwdSpine; +class SCT_FwdSubSpine; + +class GeoTransform; +class GeoVPhysVol; +class GeoPhysVol; + + +class SCT_FwdModule : public SCT_UniqueComponentFactory +{ +public: + + SCT_FwdModule(const std::string & name, int ringType); + ~SCT_FwdModule(); + + // Ring type + int ringType() const {return m_ringType;} + + //GeoVPhysVol* build(SCT_Identifier id, GeoTransform * position, GeoPhysVol * world) ; + virtual GeoVPhysVol* build(SCT_Identifier id) const; + + double stereoAngle() const {return m_stereoAngle;} + + double moduleShift() const {return m_moduleShift;} + + double length() const {return m_length;} + double outerWidth() const {return m_widthOuter;} + double innerWidth() const {return m_widthInner;} + double thickness() const {return m_thickness;} + + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + + double centerRadius() const {return 0.5 * (m_innerRadius + m_outerRadius);} + double sensorCenterRadius() const {return m_sensor->centerRadius();} + double powerTapeStart() const {return m_powerTapeStart;} + + double mainMountPointRadius() const {return m_mainMountPoint;} + double secMountPointRadius() const {return m_secMountPoint;} + double endModuleRadius() const {return m_endLocator;} + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + +// const std::string & m_name; + int m_ringType; + + double m_stereoAngle; // Magnitude of stereo angle + double m_length; + double m_widthOuter; + double m_widthInner; + double m_thickness; + double m_moduleShift; + double m_glueThickness; + double m_distBtwMountPoints; + double m_mountPointToCenter; + bool m_hybridIsOnInnerEdge; + int m_upperSide; + + double m_innerRadius; + double m_outerRadius; + double m_powerTapeStart; + + double m_mainMountPoint; + double m_secMountPoint; + double m_endLocator; + + bool m_connectorPresent; + +public: + // Child detector elements + SCT_FwdSensor * m_sensor; + const SCT_FwdModuleConnector * m_connector; + const SCT_FwdHybrid * m_hybrid; + const SCT_FwdSpine * m_spine; + const SCT_FwdSubSpine * m_subspineL; + const SCT_FwdSubSpine * m_subspineR; +}; + +#endif // SCT_GEOMODEL_SCT_FWDMODULE_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h new file mode 100755 index 00000000000..b0645070fb9 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDMODULECONNECTOR_H +#define SCT_GEOMODEL_SCT_FWDMODULECONNECTOR_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdModuleConnector : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdModuleConnector(const std::string & name, int ringType); + + // + // Methods to return basic and derived parameters. + // + const GeoMaterial * material() const {return m_material;} + double deltaR() const {return m_deltaR;} + double rphi() const {return m_rphi;} + double thickness() const {return m_thickness;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_ringType; + + double m_deltaR; + double m_rphi; + double m_thickness; + const GeoMaterial * m_material; + std::string m_materialName; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDMODULECONNECTOR_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h new file mode 100755 index 00000000000..17b33116b62 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDOPTOHARNESS_H +#define SCT_GEOMODEL_SCT_FWDOPTOHARNESS_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdOptoHarness : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdOptoHarness(const std::string & name, int iType); + + // + // Methods to return basic and derived parameters. + // + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double thickness() const {return m_thickness;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_type; + + double m_innerRadius; + double m_outerRadius; + double m_thickness; + const GeoMaterial * m_material; + std::string m_materialName; + + int m_index; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDOPTOHARNESS_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h new file mode 100755 index 00000000000..b1032bb2231 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDPPCONNECTOR_H +#define SCT_GEOMODEL_SCT_FWDPPCONNECTOR_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdPPConnector : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdPPConnector(const std::string & name); + + // + // Methods to return basic and derived parameters. + // + const GeoMaterial * material() const {return m_material;} + double deltaR() const {return m_deltaR;} + double rphi() const {return m_rphi;} + double thickness() const {return m_thickness;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + // Basic parameters + double m_deltaR; + double m_rphi; + double m_thickness; + const GeoMaterial * m_material; + std::string m_materialName; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDPPCONNECTOR_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h new file mode 100755 index 00000000000..2b931c3a0b5 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDPPCOOLING_H +#define SCT_GEOMODEL_SCT_FWDPPCOOLING_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdPPCooling : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdPPCooling(const std::string & name); + + // + // Methods to return basic and derived parameters. + // + const GeoMaterial * material() const {return m_material;} + double deltaR() const {return m_deltaR;} + double rphi() const {return m_rphi;} + double thickness() const {return m_thickness;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + // Basic parameters + double m_deltaR; + double m_rphi; + double m_thickness; + const GeoMaterial * m_material; + std::string m_materialName; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDPPCOOLING_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h new file mode 100755 index 00000000000..410e6063958 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDPATCHPANEL_H +#define SCT_GEOMODEL_SCT_FWDPATCHPANEL_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdPatchPanel : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdPatchPanel(const std::string & name, int type); + + // + // Methods to return basic and derived parameters. + // + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_midRadius - 0.5*m_deltaR;} + double outerRadius() const {return m_midRadius + 0.5*m_deltaR;} + double midRadius() const {return m_midRadius;} + double deltaR() const {return m_deltaR;} + double rphi() const {return m_rphi;} + double thickness() const {return m_thickness;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_type; + + // Basic parameters + double m_midRadius; + double m_deltaR; + double m_rphi; + double m_thickness; + const GeoMaterial * m_material; + std::string m_materialName; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDPATCHPANEL_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h new file mode 100755 index 00000000000..aface8df71d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDPOWERTAPE_H +#define SCT_GEOMODEL_SCT_FWDPOWERTAPE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdPowerTape : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdPowerTape(const std::string & name, + int numModules, + double innerRadius, + double startPos, + double endPos); + + + const GeoMaterial * material() const {return m_material;} + double crossSectArea() const {return m_crossSectArea;} + + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double thickness() const {return m_thickness;} + double length() const {return m_length;} + double zPosition() const {return m_zPosition;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + int m_numModules; + double m_crossSectArea; // Cross sectional area per module + double m_innerRadius; + double m_outerRadius; + double m_thickness; + double m_length; + double m_zPosition; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDPOWERTAPE_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h new file mode 100755 index 00000000000..8180c250384 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h @@ -0,0 +1,116 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDRING_H +#define SCT_GEOMODEL_SCT_FWDRING_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class SCT_FwdModule; +class SCT_FwdCoolingBlock; + +#include <vector> + +class GeoNameTag; +class GeoTransform; +class GeoLogVol; +class GeoPhysVol; + +class SCT_FwdRing : public SCT_UniqueComponentFactory +{ + +public: + SCT_FwdRing(const std::string & name, + const SCT_FwdModule * module, + int iWheel, + int iRing, + int ec); + + ~SCT_FwdRing(); + + // Ring type + //int ringType() const {return m_ringType;} + //int ringType() const {return m_module->ringType();} + + // + // Retrieve parameters + // + int numModules() const {return m_numModules;} + double moduleStagger() const {return m_moduleStagger;} + int identifier() const {return m_identifier;} + int ringSide() const {return m_ringSide;} + double ringOffset() const {return m_ringOffset;} + + double thickness() const {return m_thickness;} + double thicknessInner() const {return m_thicknessInner;} + double thicknessOuter() const {return m_thicknessOuter;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + + int stereoSign() const {return m_stereoSign;} + + bool discRotated() const {return m_discRotated;} + + virtual GeoVPhysVol * build(SCT_Identifier id) const; + + // Child elements + const SCT_FwdModule* module() const {return m_module;} + +private: + void makeModuleServices(); + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + + int m_iWheel; + int m_iRing; + int m_endcap; + + // Basic parameters + int m_numModules; + double m_moduleStagger; + double m_safety; + int m_identifier; + int m_ringSide; + int m_stereoSign; + double m_refStartAngle; + int m_refFirstStagger; + double m_ringOffset; + double m_discSupportThickness; + + // Derived parameters + double m_innerRadius; + double m_outerRadius; + double m_thickness; + double m_thicknessInner; + double m_thicknessOuter; + double m_startAngle; + int m_firstStagger; + bool m_discRotated; + int m_moduleZero; + + double m_moduleServicesHiRPos; + double m_moduleServicesLoRPos; + double m_moduleServicesHiZPos; + double m_moduleServicesLoZPos; + + double m_moduleServicesHiOuterZPos; + double m_moduleServicesLoOuterZPos; + + double m_maxModuleServicesBaseToRingCenter; + + // Child detector elements + const SCT_FwdModule* m_module; + SCT_FwdCoolingBlock * m_coolingBlockHiMain; + SCT_FwdCoolingBlock * m_coolingBlockHiSec; + SCT_FwdCoolingBlock * m_coolingBlockLoMain; + SCT_FwdCoolingBlock * m_coolingBlockLoSec; + + GeoPhysVol * m_moduleServicesHi; + GeoPhysVol * m_moduleServicesLo; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDRING_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h new file mode 100755 index 00000000000..2bce180c6b5 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDRINGCOOLING_H +#define SCT_GEOMODEL_SCT_FWDRINGCOOLING_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +class GeoMaterial; + +class SCT_FwdRingCooling : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdRingCooling(const std::string & name, int ringType); + + // + // Methods to return basic and derived parameters. + // + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double thickness() const {return m_thickness;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_ringType; + + double m_innerRadius; + double m_outerRadius; + double m_thickness; + const GeoMaterial * m_material; + std::string m_materialName; + + int m_numModules; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDRINGCOOLING_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h new file mode 100755 index 00000000000..3680577d39e --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h @@ -0,0 +1,123 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDSENSOR_H +#define SCT_GEOMODEL_SCT_FWDSENSOR_H + + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +// sensor types +/* +#define SENSOR_NT 0 +#define SENSOR_FT 1 +#define SENSOR_NB 2 +#define SENSOR_FB 3 +*/ + +#define SENSOR_BOTTOM 0 +#define SENSOR_TOP 1 + + +class GeoMaterial; +class GeoVPhysVol; +class GeoPhysVol; + +namespace InDetDD{class SiDetectorDesign;} + +class SCT_FwdSensor : public SCT_UniqueComponentFactory +{ +public: + SCT_FwdSensor(const std::string & name, int ringType); + + // Ring type + int ringType() const {return m_ringType;} + + + // Inner radius of physical sensor + double innerRadius() const {return m_innerRadius;} + + // Outer radius of physical sensor + double outerRadius() const {return m_outerRadius;} + + // Width of silicon at inner radius + double innerWidth() const {return m_innerWidth;} + + // Width of silicon at outer radius + double outerWidth() const {return m_outerWidth;} + + // Thickness of sensor + double thickness() const {return m_thickness;} + + // Length of physical sensor + double length() const {return m_outerRadius - m_innerRadius;} + + // Radius of center of sensor. + double centerRadius() const {return m_sensorRadius;} + double sensorOffset() const {return m_sensorOffset;} + + + double outerWidthN() const {return m_outerWidthN;} + double innerWidthN() const {return m_innerWidthN;} + double lengthN() const {return m_lengthN;} + double thicknessN() const {return m_thicknessN;} + + double outerWidthF() const {return m_outerWidthF;} + double innerWidthF() const {return m_innerWidthF;} + double lengthF() const {return m_lengthF;} + double thicknessF() const {return m_thicknessF;} + + + virtual GeoVPhysVol * build(SCT_Identifier id) const; + + GeoPhysVol * getInactive() {return m_inactive;} + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + void makeDesign(); + + int m_ringType; + + double m_thickness; // Thickness of sensor + double m_outerRadius; // Outer radius of physical sensor + double m_innerRadius; // Outer radius of physical sensor + double m_innerWidth; // Width of sensor at inner radius + double m_outerWidth; // Width of sensor at outer radius + + + double m_outerWidthN; // Outer physical width of near sensor. + double m_innerWidthN; // Inner width + double m_lengthN; // Length (radially). + double m_thicknessN; + double m_radiusN; + double m_activeHalfLengthNear; // Active half length + + double m_outerWidthF; // Outer physical width of Far sensor. + double m_innerWidthF; // Inner width + double m_lengthF; // Length (radially). + double m_thicknessF; + double m_radiusF; + double m_activeHalfLengthFar; // Active half length + + double m_sensorRadius; // Physics center (of double wafer) + + double m_sensorOffset; // Offset of det element center. + // Differs from m_sensorRadius for truncated middle detector + + const GeoMaterial * m_materialSensor; + const GeoMaterial * m_materialGlass; + + GeoPhysVol * m_inactive; + + InDetDD::SiDetectorDesign * m_design; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDSENSOR_H + + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h new file mode 100755 index 00000000000..4b53f2e35cc --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDSPINE_H +#define SCT_GEOMODEL_SCT_FWDSPINE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + +class SCT_FwdSpine : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdSpine(const std::string & name, int ringType); + +public: + + const GeoMaterial * material() const {return m_material;} + //Main spine: + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + + double moduleCenterToEnd() const {return m_moduleCenterToEnd;} + + virtual GeoVPhysVol * build(); + +private: + void getParameters(); + + int m_ringType; + + const GeoMaterial * m_material; + std::string m_materialName; + double m_thickness; + double m_width; + double m_length; + double m_moduleCenterToEnd; + double m_moduleCenterToEndTmp; +}; + +#endif // SCT_GEOMODEL_SCT_FWDSPINE_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h new file mode 100755 index 00000000000..504d2047d97 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h @@ -0,0 +1,66 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDSUBSPINE_H +#define SCT_GEOMODEL_SCT_FWDSUBSPINE_H + + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +#define SUBSPINE_LEFT 1 +#define SUBSPINE_RIGHT -1 + +class GeoMaterial; +class GeoVPhysVol; + +class SCT_FwdSubSpine : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdSubSpine(const std::string & name, int ringType, int spineSide); + +public: + const GeoMaterial * material() const {return m_material;} + + //Sub spines: + double innerThickness() const {return m_thickness1;} + double innerWidth() const {return m_width1;} + double innerLength() const {return m_length1;} + + double middleThickness() const {return m_thickness2;} + double middleWidth() const {return m_width2;} + double middleLength() const {return m_length2;} + + double outerThickness() const {return m_thickness3;} + double outerWidth() const {return m_width3;} + double outerLength() const {return m_length3;} + + virtual GeoVPhysVol * build(); + +private: + void getParameters(); + + int m_ringType; + int m_spineSide; + const GeoMaterial * m_material; + + double m_thickness1; + double m_width1; + double m_length1; + + double m_thickness2; + double m_width2; + double m_length2; + + double m_thickness3; + double m_width3; + double m_length3; + +}; + +#endif // SCT_GEOMODEL_SCT_FWDSUBSPINE_H + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h new file mode 100755 index 00000000000..f7eb1915e2a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDSUPPORTFRAME_H +#define SCT_GEOMODEL_SCT_FWDSUPPORTFRAME_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_FwdSupportFrame : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdSupportFrame(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double radialThickness() const {return m_thickness;} + double zMax() const {return m_zMax;} + double zMin() const {return m_zMin;} + + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + double zPosition() const {return 0.5*(m_zMin+m_zMax);} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + std::string m_materialName; + double m_innerRadius; + double m_thickness; + double m_zMin; + double m_zMax; + + double m_outerRadius; + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_FWDSUPPORTFRAME_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h new file mode 100755 index 00000000000..e71ceb1664a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDTHERMALSHIELDELEMENT_H +#define SCT_GEOMODEL_SCT_FWDTHERMALSHIELDELEMENT_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_FwdThermalShieldElement : public SCT_SharedComponentFactory +{ + +public: + SCT_FwdThermalShieldElement(const std::string & name, int iElement); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double zMax() const {return m_zMax;} + double zMin() const {return m_zMin;} + + double length() const {return m_length;} + double radialThickness() const {return m_outerRadius - m_innerRadius;} + double zPosition() const {return 0.5*(m_zMin+m_zMax);} + + +private: + + void getParameters(); + virtual GeoVPhysVol * build(); + + std::string m_materialName; + const GeoMaterial * m_material; + + int m_iElement; + double m_innerRadius; + double m_outerRadius; + double m_zMin; + double m_zMax; + + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_FWDTHERMALSHIELDELEMENT_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h new file mode 100755 index 00000000000..dfb194556a3 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h @@ -0,0 +1,111 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_FWDWHEEL_H +#define SCT_GEOMODEL_SCT_FWDWHEEL_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <vector> + + +class SCT_FwdRing; +class SCT_FwdDiscFixation; +class SCT_FwdDiscSupport; +class SCT_FwdPatchPanel; +class SCT_FwdPPConnector; +class SCT_FwdPPCooling; +class SCT_FwdModule; +class SCT_FwdFSI; + +class FSIDetails; + +class SCT_FwdWheel : public SCT_UniqueComponentFactory +{ + +public: + SCT_FwdWheel(const std::string & name, + int iWheel, + const std::vector<const SCT_FwdModule *> & modules, + int ec); + ~SCT_FwdWheel(); + + int wheelNum() const {return m_iWheel;} + + // Retrieve basic parameters + // + double zPosition() const {return m_zPosition;} + int numRings() const {return m_numRings;} + int ringType(int i) const {return m_ringType[i];} + //int ringStereoType(int i) const {return m_ringStereoType[i];} + const SCT_FwdRing* ring(int i) {return m_rings[i];} + + // + // Retrieve derived parameters + // + double thickness() const {return m_thickness;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + int totalModules() const {return m_totalModules;} + + virtual GeoVPhysVol * build(SCT_Identifier id) const; + + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + + int m_iWheel; + int m_endcap; + + // Basic parameters + int m_numRings; + double m_zPosition; + std::vector<int> m_ringType; + //std::vector<int> m_ringSide; + //std::vector<int> m_ringStereoType; + std::vector<int> m_patchPanelType; + std::vector<double> m_patchPanelLocAngle; + std::vector<bool> m_patchPanelRepeatQuadrant; + int m_numPatchPanelLocs; + int m_numPatchPanelTypes; + int m_numFSITypes; + int m_numWheels; + bool m_optoHarnessPresent; + bool m_pPConnectorPresent; + bool m_pPCoolingPresent; + bool m_discFixationPresent; + std::vector<double> m_discFixationLocAngle; + + // Derived parameters + double m_innerRadius; + double m_outerRadius; + double m_thickness; + double m_thicknessFront; + double m_thicknessBack; + int m_totalModules; + int m_rotateWheel; + double m_ringMaxRadius; + + double m_safety; + + // Child detector elements + std::vector<const SCT_FwdRing *> m_rings; + const SCT_FwdDiscSupport * m_discSupport; + std::vector<const SCT_FwdPatchPanel*> m_patchPanel; + const SCT_FwdPPConnector* m_pPConnector; + const SCT_FwdPPCooling* m_pPCooling; + std::vector<const SCT_FwdFSI*> m_fsiType; + const SCT_FwdDiscFixation* m_discFixation; + + const std::vector<const SCT_FwdModule*> & m_modules; + + + const std::vector<const FSIDetails *> * m_fsiVector; + + +}; + +#endif // SCT_GEOMODEL_SCT_FWDWHEEL_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h new file mode 100755 index 00000000000..7c10e5310d4 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GeoModel_SCT_GeneralParameters_H +#define SCT_GeoModel_SCT_GeneralParameters_H + +#include "CLHEP/Geometry/Transform3D.h" + +#include <map> +#include <string> + +class SCT_DataBase; +class TopLevelPlacements; + +class SCT_GeneralParameters { + +public: + + SCT_GeneralParameters(); + ~SCT_GeneralParameters(); + + // General + double safety() const; + + //Default conditions. + double temperature() const; + double biasVoltage() const; + double depletionVoltage() const; + + const HepGeom::Transform3D & partTransform(const std::string & partName) const; + bool partPresent(const std::string & partName) const; + +private: + + SCT_DataBase * m_rdb; + TopLevelPlacements * m_placements; + +}; + + +#endif // SCT_GeoModel_SCT_GeneralParameters_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeoModelAthenaComps.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeoModelAthenaComps.h new file mode 100644 index 00000000000..318ed60a415 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeoModelAthenaComps.h @@ -0,0 +1,36 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GeoModel_SCT_GeoModelAthenaComps_H +#define SCT_GeoModel_SCT_GeoModelAthenaComps_H + +#include "InDetGeoModelUtils/InDetDDAthenaComps.h" + +#include "GaudiKernel/ServiceHandle.h" +class ISiLorentzAngleSvc; +class SCT_ID; + + +/// Class to hold various Athena components +class SCT_GeoModelAthenaComps : public InDetDD::AthenaComps { + +public: + + SCT_GeoModelAthenaComps(); + + void setLorentzAngleSvc(const ServiceHandle<ISiLorentzAngleSvc> &); + void setIdHelper(const SCT_ID* idHelper); + + const ServiceHandle<ISiLorentzAngleSvc> & lorentzAngleSvc() const; + const SCT_ID* getIdHelper() const; + +private: + // Lorentz angle service + ServiceHandle<ISiLorentzAngleSvc> m_lorentzAngleSvc; + const SCT_ID* m_idHelper; + +}; + +#endif // SCT_GeoModel_SCT_GeoModelAthenaComps_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h new file mode 100755 index 00000000000..ee83e15f660 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h @@ -0,0 +1,67 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GeoModel_SCT_GeometryManager_H +#define SCT_GeoModel_SCT_GeometryManager_H + +#include "SCT_GeoModel/SCT_Options.h" + +namespace InDetDD{ + class SiCommonItems; + class DistortedMaterialManager; +} + +class SCT_BarrelParameters; +class SCT_BarrelModuleParameters; +class SCT_ForwardParameters; +class SCT_ForwardModuleParameters; +class SCT_GeneralParameters; +class SCT_GeoModelAthenaComps; + +class SCT_GeometryManager { + +public: + + // Constructor + SCT_GeometryManager(); + + // Destructor + ~SCT_GeometryManager(); + + // Access to run time options + const SCT_Options & options() const; + void setOptions(const SCT_Options & options); + + // Access to athena components + const SCT_GeoModelAthenaComps * athenaComps() const; + void setAthenaComps(const SCT_GeoModelAthenaComps * athenaComps); + + // To be passed to detector element. + InDetDD::SiCommonItems * commonItems() const; + void setCommonItems(InDetDD::SiCommonItems * commonItems); + + const SCT_BarrelParameters * barrelParameters() const; + const SCT_BarrelModuleParameters * barrelModuleParameters() const; + const SCT_ForwardParameters * forwardParameters() const; + const SCT_ForwardModuleParameters * forwardModuleParameters() const; + const SCT_GeneralParameters * generalParameters() const; + const InDetDD::DistortedMaterialManager * distortedMatManager() const; + +private: + + SCT_Options m_options; + const SCT_GeoModelAthenaComps * m_athenaComps; + InDetDD::SiCommonItems * m_commonItems; + + mutable const SCT_BarrelParameters * m_barrelParameters; + mutable const SCT_BarrelModuleParameters * m_barrelModuleParameters; + mutable const SCT_ForwardParameters * m_forwardParameters; + mutable const SCT_ForwardModuleParameters * m_forwardModuleParameters; + mutable const SCT_GeneralParameters * m_generalParameters; + mutable const InDetDD::DistortedMaterialManager * m_distortedMatManager; + +}; + + +#endif // SCT_GeoModel_SCT_GeometryManager_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h new file mode 100755 index 00000000000..06a9b5f2c29 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_HARNESS_H +#define SCT_GEOMODEL_SCT_HARNESS_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_Harness : public SCT_SharedComponentFactory +{ + +public: + SCT_Harness(const std::string & name, double length); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + std::string m_materialName; + double m_thickness; + double m_width; + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_HARNESS_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h new file mode 100755 index 00000000000..032fdc70867 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_Hybrid_H +#define SCT_GEOMODEL_SCT_Hybrid_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + +class SCT_Hybrid: public SCT_SharedComponentFactory + +{ +public: + SCT_Hybrid(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + double m_thickness; + double m_width; + double m_length; + +}; + +#endif // SCT_GEOMODEL_SCT_Hybrid_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h new file mode 100755 index 00000000000..c74fad15348 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h @@ -0,0 +1,59 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_IDENTIFIER_H +#define SCT_GEOMODEL_SCT_IDENTIFIER_H + +class Identifier; +class SCT_ID; + +class SCT_Identifier +{ +public: + + SCT_Identifier(int barrelEC = 0, + int layerDisk = 0, + int phiModule = 0, + int etaModule = 0, + int side = 0) + : m_barrelEC(barrelEC), + m_layerDisk(layerDisk), + m_phiModule(phiModule), + m_etaModule(etaModule), + m_side(side) + {}; + + + void setBarrelEC(int i) {m_barrelEC = i;} + int getBarrelEC() const {return m_barrelEC;} + + void setLayerDisk(int i) {m_layerDisk = i;} + int getLayerDisk() const {return m_layerDisk;} + + void setEtaModule(int i) {m_etaModule = i;} + int getEtaModule() const {return m_etaModule;} + + void setPhiModule(int i) {m_phiModule = i;} + int getPhiModule() const {return m_phiModule;} + + void setSide(int i) {m_side = i;} + int getSide() const {return m_side;} + + static void setIdHelper(const SCT_ID * idHelper) {s_idHelper = idHelper;} + + Identifier getWaferId(); + + // For debugging purposes. + void print(); + +private: + int m_barrelEC; + int m_layerDisk; + int m_phiModule; + int m_etaModule; + int m_side; + static const SCT_ID * s_idHelper; +}; + +#endif // SCT_GEOMODEL_SCT_IDENTIFIER_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h new file mode 100755 index 00000000000..afbdebae8ae --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h @@ -0,0 +1,81 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// 13rd Mar 2005 D.Naito +// 28th Mar 2005 S.Mima +// Wed 15th Jun 2005 D.Naito modified. +// +#ifndef SCT_GEOMODEL_SCT_INNERSIDE_H +#define SCT_GEOMODEL_SCT_INNERSIDE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" +#include "CLHEP/Vector/ThreeVector.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; +class GeoLogVol; +class GeoTransform; +class SCT_Identifier; +class SCT_Hybrid; +class SCT_Sensor; + +class SCT_InnerSide: public SCT_UniqueComponentFactory + +{ +public: + + SCT_InnerSide(const std::string & name); + + ~SCT_InnerSide(); + virtual GeoVPhysVol * build(SCT_Identifier id) const; + +public: + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + + CLHEP::Hep3Vector * env1RefPointVector() const {return m_env1RefPointVector;} + CLHEP::Hep3Vector * env2RefPointVector() const {return m_env2RefPointVector;} + // *** End of modified lines. ------------------ (00)********************************* + + + const SCT_Hybrid * hybrid() const {return m_hybrid;} + const SCT_Sensor * sensor() const {return m_sensor;} + + double hybridOffsetX() const {return m_hybridOffsetX;} + //double hybridOffsetY() const {return m_hybridOffsetY;} // 16:30 Wed 15th Jun 2005 D.Naito removed. + double hybridOffsetZ() const {return m_hybridOffsetZ;} + + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + + double m_thickness; + double m_width; + double m_length; + + double m_hybridOffsetX; + //double m_hybridOffsetY; // 16:30 Wed 15th Jun 2005 D.Naito removed. + double m_hybridOffsetZ; + double m_safety; + + SCT_Hybrid * m_hybrid; + SCT_Sensor * m_sensor; + + GeoTransform * m_hybridPos; + GeoTransform * m_sensorPos; + + // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (02)********************************* + // *** -->> (02)********************************* + CLHEP::Hep3Vector * m_env1RefPointVector; + CLHEP::Hep3Vector * m_env2RefPointVector; + // *** End of modified lines. ------------------ (02)********************************* + +}; + +#endif // SCT_GEOMODEL_SCT_INNERSIDE_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h new file mode 100755 index 00000000000..079026e9ea5 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h @@ -0,0 +1,58 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_INTERLINK_H +#define SCT_GEOMODEL_SCT_INTERLINK_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_InterLink : public SCT_SharedComponentFactory +{ + +public: + SCT_InterLink(const std::string & name); + +public: + // const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + // Following are for interlink + std::string m_materialName; + double m_innerRadius; + double m_outerRadius; + double m_length; + double m_dPhi; + double m_phiPos; + int m_nRepeat; + + // Following are for FSI flange + bool m_includeFSIFlange; + double m_innerRadiusFSIFlange; + double m_outerRadiusFSIFlange; + std::string m_materialNameFSIFlange; + + // Following are for B6 bearing + std::string m_materialNameBearing; + double m_innerRadiusBearing; + double m_outerRadiusBearing; + double m_lengthBearing; + double m_dPhiBearing; + double m_phiPosBearing; + int m_nRepeatBearing; + +}; + +#endif // SCT_GEOMODEL_SCT_INTERLINK_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h new file mode 100755 index 00000000000..4ed3ecea6e4 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h @@ -0,0 +1,116 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// CPW 17/8/06 +// Version using new model of services from A. Tricoli +// +#ifndef SCT_GEOMODEL_SCT_LAYER_H +#define SCT_GEOMODEL_SCT_LAYER_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; +class GeoLogVol; + +class SCT_Bracket; +class SCT_Clamp; +class SCT_CoolingEnd; +class SCT_Flange; +class SCT_Harness; +class SCT_Module; +class SCT_Ski; +class SCT_SkiAux; +class SCT_SkiPowerTape; +class SCT_SupportCyl; +class SCT_FSIEndJewel; +class SCT_FSIScorpion; +class SCT_FSIFibreMask; +class SCT_Identifier; + +class SCT_Layer: public SCT_UniqueComponentFactory +{ +public: + SCT_Layer(const std::string & name, + int iLayer, + const SCT_Module * module); + + ~SCT_Layer(); + + virtual GeoVPhysVol * build(SCT_Identifier id) const; + + +public: + int skisPerLayer() const {return m_skisPerLayer;} + double tilt() const {return m_tilt;} + int stereoSign() const {return m_stereoSign;} + double radius() const {return m_radius;} + + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_cylinderLength;} + + double skiPhiStart() const {return m_skiPhiStart;} + + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + + void activeEnvelopeExtent(double & rmin, double & rmax); + double calcSkiPhiOffset(); + + // Layer number + int m_iLayer; + + int m_skisPerLayer; + double m_tilt; + int m_stereoSign; + double m_radius; + double m_safety; + + double m_innerRadius; + double m_outerRadius; + double m_cylinderLength; + double m_activeLength; + + double m_innerRadiusActive; + double m_outerRadiusActive; + + double m_outerRadiusOfSupport; + + double m_skiPhiStart; + double m_skiAuxPhiStart; + + double m_bracketPhiOffset; + double m_phiRefModule; + + bool m_includeFSI; + int m_nRepeatEndJewel; + double m_phiEndJewel; + double m_zEndJewel; + int m_nRepeatScorpion; + double m_phiScorpion; + double m_zScorpion; + + const SCT_Module * m_module; + const SCT_Ski * m_ski; + const SCT_Clamp * m_clamp; + const SCT_CoolingEnd * m_coolingEnd; + const SCT_Bracket * m_bracket; + const SCT_Harness * m_harness; + const SCT_SkiPowerTape * m_skiPowerTape; + const SCT_SkiAux * m_skiAux; + const SCT_Flange * m_flange; + const SCT_SupportCyl * m_supportCyl; + const SCT_FSIEndJewel * m_endJewel; + const SCT_FSIScorpion * m_scorpion; + const SCT_FSIFibreMask * m_fibreMask; + +}; + +#endif // SCT_GEOMODEL_SCT_LAYER_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h new file mode 100755 index 00000000000..9cdb4ec633d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h @@ -0,0 +1,54 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_MATERIALMANAGER_H +#define SCT_MATERIALMANAGER_H + +// SCT_MaterialManager. This provides an interface to the InDetMaterialManager which in turn +// is an interface to GeoModel Material Manager with some additional functionality. + +class GeoMaterial; +class GeoElement; +class InDetMaterialManager; + +#include <string> + +class SCT_MaterialManager +{ + +public: + + SCT_MaterialManager(); + + static void reinit(); + + const GeoMaterial* getMaterial(const std::string & materialName) const; + const GeoElement* getElement(const std::string & elementName) const; + + const GeoMaterial* getMaterial(const std::string & originalMaterial, + double density, + const std::string & newName = ""); + const GeoMaterial *getMaterialForVolume(const std::string & materialName, double volume); + + + // Default gas material + const GeoMaterial* gasMaterial() const; + + // Allow changing gas material. (Will be air if never called) + // Will affect all instances. + static void setGasMaterial(const GeoMaterial* material); + static void setGasMaterial(const std::string & materialName); + + +private: + void loadMaterials(); + void addMaterial(GeoMaterial* material); + + static InDetMaterialManager *s_materialManager; + static const GeoMaterial* s_gasMaterial; + +}; + + +#endif // SCT_MATERIALMANAGER_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h new file mode 100755 index 00000000000..16bee4daa8a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h @@ -0,0 +1,105 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_MODULE_H +#define SCT_GEOMODEL_SCT_MODULE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; +class GeoLogVol; + +class SCT_InnerSide; +class SCT_OuterSide; +class SCT_BaseBoard; + +class SCT_Module: public SCT_UniqueComponentFactory + +{ +public: + + SCT_Module(const std::string & name); + + ~SCT_Module(); + virtual GeoVPhysVol * build(SCT_Identifier id) const; + +public: + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + + double env1Thickness() const {return m_env1Thickness;} + double env1Width() const {return m_env1Width;} + double env1Length() const {return m_env1Length;} + double env2Thickness() const {return m_env2Thickness;} + double env2Width() const {return m_env2Width;} + double env2Length() const {return m_env2Length;} + + CLHEP::Hep3Vector * env1RefPointVector() const {return m_env1RefPointVector;} + CLHEP::Hep3Vector * env2RefPointVector() const {return m_env2RefPointVector;} + + double sensorGap() const {return m_sensorGap;} + double stereoInner() const {return m_stereoInner;} + double stereoOuter() const {return m_stereoOuter;} + double stereoAngle() const {return m_stereoAngle;} + + double activeWidth() const {return m_activeWidth;} + + double baseBoardOffsetY() const {return m_baseBoardOffsetY;} + double baseBoardOffsetZ() const {return m_baseBoardOffsetZ;} + + const SCT_InnerSide * innerSide() const {return m_innerSide;} + const SCT_OuterSide * outerSide() const {return m_outerSide;} + const SCT_BaseBoard * baseBoard() const {return m_baseBoard;} + + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + + double m_thickness; + double m_width; + double m_length; + + double m_env1Thickness; + double m_env1Width; + double m_env1Length; + double m_env2Thickness; + double m_env2Width; + double m_env2Length; + + double m_activeWidth; + + double m_baseBoardOffsetY; + double m_baseBoardOffsetZ; + + double m_sensorGap; + double m_stereoInner; + double m_stereoOuter; + double m_stereoAngle; + //int m_stereoSign; + int m_upperSide; + double m_safety; + + const SCT_InnerSide * m_innerSide; + const SCT_OuterSide * m_outerSide; + const SCT_BaseBoard * m_baseBoard; + //const SCT_Sensor * m_sensor; // 14:00 Thu 14th Jul 2005 D.Naito removed. + + HepGeom::Transform3D * m_innerSidePos; + HepGeom::Transform3D * m_outerSidePos; + HepGeom::Translate3D * m_baseBoardPos; // 6th Apr 2005 S.Mima + + CLHEP::Hep3Vector * m_env1RefPointVector; + CLHEP::Hep3Vector * m_env2RefPointVector; + +}; + +#endif // SCT_GEOMODEL_SCT_MODULE_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Options.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Options.h new file mode 100755 index 00000000000..e20e1900bc6 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Options.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GeoModel_SCT_Options_H +#define SCT_GeoModel_SCT_Options_H + +// Class for any run time options. + + +class SCT_Options +{ + +public: + SCT_Options(); + bool g3Compatible() const; + bool versionDC1() const; + bool versionDC2() const; + bool alignable() const; + bool alignAtModuleLevel() const; + + void setG3Compatible(bool flag = true); + void setDC1Geometry(); + void setDC2Geometry(); + void setAlignable(bool flag = true); + void setAlignAtModuleLevel(bool flag = true); + + +private: + + bool m_g3Compatible; + bool m_dc1Geometry; + bool m_dc2Geometry; + bool m_alignable; + bool m_alignModule; + + +}; + + +#endif // SCT_GeoModel_SCT_Options_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h new file mode 100755 index 00000000000..2154eae619f --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h @@ -0,0 +1,72 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_OUTERSIDE_H +#define SCT_GEOMODEL_SCT_OUTERSIDE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" +#include "CLHEP/Vector/ThreeVector.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; +class GeoLogVol; +class GeoTransform; + +class SCT_Identifier; +class SCT_Hybrid; +class SCT_Pigtail; +class SCT_Sensor; + +class SCT_OuterSide: public SCT_UniqueComponentFactory + +{ +public: + + SCT_OuterSide(const std::string & name); + + ~SCT_OuterSide(); + virtual GeoVPhysVol * build(SCT_Identifier id) const; + +public: + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + + CLHEP::Hep3Vector * env1RefPointVector() const {return m_env1RefPointVector;} + CLHEP::Hep3Vector * env2RefPointVector() const {return m_env2RefPointVector;} + + const SCT_Hybrid * hybrid() const {return m_hybrid;} + const SCT_Pigtail * pigtail() const {return m_pigtail;} + const SCT_Sensor * sensor() const {return m_sensor;} + + double hybridOffsetX() const {return m_hybridOffsetX;} + double hybridOffsetZ() const {return m_hybridOffsetZ;} + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + + double m_thickness; + double m_width; + double m_length; + + double m_hybridOffsetX; + double m_hybridOffsetZ; + double m_safety; + + SCT_Hybrid * m_hybrid; + SCT_Pigtail * m_pigtail; + SCT_Sensor * m_sensor; + + GeoTransform * m_hybridPos; + GeoTransform * m_pigtailPos; + GeoTransform * m_sensorPos; + CLHEP::Hep3Vector * m_env1RefPointVector; + CLHEP::Hep3Vector * m_env2RefPointVector; + +}; + +#endif // SCT_GEOMODEL_SCT_OUTERSIDE_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h new file mode 100755 index 00000000000..a7f8c685f00 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_Pigtail_H +#define SCT_GEOMODEL_SCT_Pigtail_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + +class SCT_Pigtail: public SCT_SharedComponentFactory + +{ +public: + SCT_Pigtail(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + double m_thickness; + double m_width; + double m_length; + +}; + +#endif // SCT_GEOMODEL_SCT_Pigtail_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h new file mode 100755 index 00000000000..5a8b6355486 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_PIXELATTACHMENT_H +#define SCT_GEOMODEL_SCT_PIXELATTACHMENT_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_PixelAttachment : public SCT_SharedComponentFactory +{ + +public: + SCT_PixelAttachment(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double zMax() const {return m_zMax;} + double zMin() const {return m_zMin;} + + double length() const {return m_length;} + double radialThickness() const {return m_outerRadius - m_innerRadius;} + double zPosition() const {return 0.5*(m_zMin+m_zMax);} + + +private: + + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + + double m_innerRadius; + double m_outerRadius; + double m_zMin; + double m_zMax; + + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_PIXELATTACHMENT_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h new file mode 100755 index 00000000000..ce77d46dfe5 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_POWERTAPE_H +#define SCT_GEOMODEL_SCT_POWERTAPE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; + + +class SCT_PowerTape: public SCT_SharedComponentFactory + +{ + +public: + SCT_PowerTape(const std::string & name, double length); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + double m_thickness; + double m_width; + double m_length; + +}; + +#endif // SCT_GEOMODEL_SCT_POWERTAPE_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h new file mode 100755 index 00000000000..735437710d9 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_SENSOR_H +#define SCT_GEOMODEL_SCT_SENSOR_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; +class GeoVPhysVol; +namespace InDetDD{class SiDetectorDesign;} + +class SCT_Sensor: public SCT_UniqueComponentFactory +{ +public: + SCT_Sensor(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + + virtual GeoVPhysVol * build(SCT_Identifier id) const; + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + void makeDesign(); + + const GeoMaterial * m_material; + double m_thickness; + double m_width; + double m_length; + + InDetDD::SiDetectorDesign * m_design; + +}; + +#endif // SCT_GEOMODEL_SCT_SENSOR_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h new file mode 100755 index 00000000000..71491fd9bc3 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h @@ -0,0 +1,143 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_SKI_H +#define SCT_GEOMODEL_SCT_SKI_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" + +#include <string> +#include <vector> + +class GeoMaterial; +class GeoVPhysVol; +class GeoLogVol; +class GeoNameTag; +class GeoTransform; + +class SCT_Identifier; +class SCT_Module; +class SCT_Dogleg; +class SCT_CoolingBlock; +class SCT_CoolingPipe; + +class SCT_Ski: public SCT_UniqueComponentFactory + +{ +public: + SCT_Ski(const std::string & name, + const SCT_Module * module, + int stereoSign, + double tilt, + double length); + + ~SCT_Ski(); + virtual GeoVPhysVol * build(SCT_Identifier id) const; + +public: + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + + double zPos(int i) const {return m_zPos[i];} + int identifier(int i) const {return m_id[i];} + double radialSep() const {return m_radialSep;} + int firstStagger() const {return m_firstStagger;} + int modulesPerSki() const {return m_modulesPerSki;} + + double tilt() const {return m_tilt;} + int stereoSign() const {return m_stereoSign;} + + const SCT_Module * module() const {return m_module;} + const SCT_Dogleg * dogleg() const {return m_dogleg;} + const SCT_CoolingBlock * coolingBlock() const {return m_coolingBlock;} + const SCT_CoolingPipe * coolingPipe() const {return m_coolingPipe;} + + GeoTransform * getRefPointTransform() const {return m_refPointTransform;} + CLHEP::Hep3Vector * env1RefPointVector() const {return m_env1RefPointVector;} + CLHEP::Hep3Vector * env2RefPointVector() const {return m_env2RefPointVector;} + double env1Thickness() const {return m_env1Thickness;} + double env1Width() const {return m_env1Width;} + double env2Thickness() const {return m_env2Thickness;} + double env2Width() const {return m_env2Width;} + double coolingBlockOffsetX() const {return m_coolingBlockOffsetX;} + double coolingBlockOffsetY() const {return m_coolingBlockOffsetY;} + double coolingBlockOffsetZ() const {return m_coolingBlockOffsetZ;} + double coolingPipeOffsetX() const {return m_coolingPipeOffsetX;} + double coolingPipeOffsetY() const {return m_coolingPipeOffsetY;} + + double doglegOffsetX() const {return m_doglegOffsetX;} + double doglegOffsetY() const {return m_doglegOffsetY;} + +private: + // Copy and assignment operations not supported, so are private + SCT_Ski(const SCT_Ski& ski); + SCT_Ski& operator = (const SCT_Ski& ski); + + void getParameters(); + virtual const GeoLogVol * preBuild(); + + double m_radialSep; + int m_firstStagger; + int m_modulesPerSki; + double m_safety; + + std::vector<double> m_zPos; + std::vector<int> m_id; + + int m_stereoSign; + double m_tilt; + + double m_length; + double m_width; + double m_thickness; + + + // These are currently all set to zero. + double m_doglegPhiOffset; + double m_doglegRadialOffset; + double m_coolingBlockPhiOffset; + double m_coolingBlockRadialOffset; + double m_coolingPipeRadialOffset; + double m_coolingPipePhiOffset; + + // There are cooling block & cooling pipe offset parameters. + double m_coolingBlockOffsetX; + double m_coolingBlockOffsetY; + double m_coolingBlockOffsetZ; + double m_coolingPipeOffsetX; + double m_coolingPipeOffsetY; + + double m_doglegOffsetX; + double m_doglegOffsetY; + + const SCT_Module* m_module; + const SCT_Dogleg* m_dogleg; + const SCT_CoolingBlock* m_coolingBlock; + const SCT_CoolingPipe* m_coolingPipe; + + GeoTransform * m_refPointTransform; + GeoTransform * m_coolingPipePos; + + //! For calculations of envelopes of SCT_DetailLayer. + CLHEP::Hep3Vector * m_env1RefPointVector; + //! For calculations of envelopes of SCT_DetailLayer. + CLHEP::Hep3Vector * m_env2RefPointVector; + + double m_env1Thickness; + double m_env1Width; + double m_env2Thickness; + double m_env2Width; + + std::vector<GeoNameTag *> m_nameTag; + std::vector<HepGeom::Transform3D> m_modulePos; + std::vector<GeoTransform *> m_doglegPos; + std::vector<GeoTransform *> m_coolingBlockPos; + +}; + +#endif // SCT_GEOMODEL_SCT_SKI_H diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h new file mode 100755 index 00000000000..8445a0ccf7a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h @@ -0,0 +1,84 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_SKIAUX_H +#define SCT_GEOMODEL_SCT_SKIAUX_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class SCT_Ski; +// 14th Aug 2005 S.Mima modified. +//class SCT_Bracket; +class SCT_Bracket; +class SCT_Harness; +class SCT_SkiPowerTape; + + +class SCT_SkiAux : public SCT_SharedComponentFactory +{ + +public: + + + SCT_SkiAux(const std::string & name, + const SCT_Ski * ski, + // 14th Aug 2005 S.Mima modified. + //const SCT_Bracket * bracket, + const SCT_Bracket * bracket, + const SCT_Harness * harness, + const SCT_SkiPowerTape * skiPowerTape, + double innerRadius, + double bracketPhiOffset, + double powerTapePhiOffset, + double divisionAngle); + + // + // Retrieve basic/derived parameters + // + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + double sectorStartAngle() const {return m_sectorStartAngle;} + double sectorAngle() const {return m_sectorAngle;} + + double bracketPhiOffset() const {return m_bracketPhiOffset;} + double powerTapePhiOffset() const {return m_powerTapePhiOffset;} + + + // Retrieve child elements + const SCT_Ski * ski() const {return m_ski;} + // 14th Aug 2005 S.Mima modified. + // const SCT_Bracket * bracket() const {return m_bracket;} + const SCT_Bracket * bracket() const {return m_bracket;} + const SCT_Harness * harness() const {return m_harness;} + const SCT_SkiPowerTape* skiPowerTape() const {return m_skiPowerTape;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + // Basic/derived parameters + double m_innerRadius; + double m_outerRadius; + double m_length; + double m_bracketPhiOffset; + double m_powerTapePhiOffset; + double m_sectorStartAngle; + double m_sectorAngle; + + // Child detector elements + const SCT_Ski * m_ski; + // 14th Aug 2005 S.Mima modified. + // const SCT_Bracket * m_bracket; + const SCT_Bracket * m_bracket; + const SCT_Harness * m_harness; + const SCT_SkiPowerTape * m_skiPowerTape; + +}; + +#endif // SCT_GEOMODEL_SCT_SKIAUX_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h new file mode 100755 index 00000000000..c536ca0de7d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_SKIPOWERTAPE_H +#define SCT_GEOMODEL_SCT_SKIPOWERTAPE_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class SCT_Ski; + +class SCT_SkiPowerTape : public SCT_SharedComponentFactory +{ + +public: + + SCT_SkiPowerTape(const std::string & name, + const SCT_Ski * ski, + double length); + + // + // Methods to return basic and derived parameters. + // + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + double powerTapeThickness() const {return m_powerTapeThickness;} + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + // Basic and Derived parameters + double m_length; + double m_width; + double m_thickness; + double m_powerTapeThickness; + + // Child detector elements + const SCT_Ski * m_ski; + + // 15th Aug 2005 S.Mima modified. + // Power Tape Z Offset from Bracket + double m_powerTapeStartPointOffset; +}; + +#endif // SCT_GEOMODEL_SCT_SKIPOWERTAPE_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h new file mode 100755 index 00000000000..d8ed217cbed --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_SPIDER_H +#define SCT_GEOMODEL_SCT_SPIDER_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_Spider : public SCT_SharedComponentFactory +{ + +public: + SCT_Spider(const std::string & name); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + const GeoMaterial * m_material; + std::string m_materialName; + double m_innerRadius; + double m_outerRadius; + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_SPIDER_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h new file mode 100755 index 00000000000..3e8778c558d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_GEOMODEL_SCT_SUPPORTCYL_H +#define SCT_GEOMODEL_SCT_SUPPORTCYL_H + +#include "SCT_GeoModel/SCT_ComponentFactory.h" + +#include <string> + +class GeoMaterial; + +class SCT_SupportCyl : public SCT_SharedComponentFactory +{ + +public: + SCT_SupportCyl(const std::string & name, int iLayer, double length); + +public: + const GeoMaterial * material() const {return m_material;} + double innerRadius() const {return m_innerRadius;} + double outerRadius() const {return m_outerRadius;} + double length() const {return m_length;} + + +private: + void getParameters(); + virtual GeoVPhysVol * build(); + + int m_iLayer; + + const GeoMaterial * m_material; + std::string m_materialName; + double m_innerRadius; + double m_outerRadius; + double m_length; +}; + +#endif // SCT_GEOMODEL_SCT_SUPPORTCYL_H + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/cmt/requirements b/InnerDetector/InDetDetDescr/SCT_GeoModel/cmt/requirements new file mode 100755 index 00000000000..2fbedf2f81a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/cmt/requirements @@ -0,0 +1,32 @@ +package SCT_GeoModel +author Grant Gorfine <Grant.Gorfine@cern.ch> +author Pat Ward <cpw1@hep.phy.cam.ac.uk> + +use AtlasPolicy AtlasPolicy-* +use GaudiInterface GaudiInterface-* External +use AtlasCLHEP AtlasCLHEP-* External +use AthenaKernel AthenaKernel-* Control + +use GeoModelKernel GeoModelKernel-* DetectorDescription/GeoModel +use GeoModelUtilities GeoModelUtilities-* DetectorDescription/GeoModel +use InDetGeoModelUtils InDetGeoModelUtils-* InnerDetector/InDetDetDescr +use InDetReadoutGeometry InDetReadoutGeometry-* InnerDetector/InDetDetDescr +use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL + +private +use StoreGate StoreGate-* Control +use CLIDSvc CLIDSvc-* Control +use SGTools SGTools-* Control +use DetDescrConditions DetDescrConditions-* DetectorDescription/DetDescrCond +use GeometryDBSvc GeometryDBSvc-* DetectorDescription +use Identifier Identifier-* DetectorDescription +use InDetIdentifier InDetIdentifier-* InnerDetector/InDetDetDescr +use InDetCondServices InDetCondServices-* InnerDetector/InDetConditions +use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel + +public + +apply_pattern dual_use_library files=*.cxx + + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/doc/mainpage.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/doc/mainpage.h new file mode 100755 index 00000000000..6e64769ccc4 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/doc/mainpage.h @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/** + +@mainpage SCT_GeoModel Package + +@authors Grant Gorfine + +@section SCT_GeoModelIntro Introduction + +This package contains the factories for building the GeoModel Detector +Description of the SCT. It builds both the material geometry using the +GeoModelKernel and the readout geometry using classes in +InDetReadoutGeometry. + +The creation of the geometry is initiated by the DetectorTool +(SCT_DetectorTool) which is called from GeoModelSvc. The DetectorTool +calls a top level factory (eg SCT_DetectorFactory) which starts the +building process. + +The version of geometry is controlled by the Detector Description tag which +can be specified at various levels (ATLAS, InnerDetector or SCT node). + +See https://uimon.cern.ch/twiki/bin/view/Atlas/InDetGeometryVersions for current versions supported. + +See the InDetDetDescrExample package for examples of how to load the geometry +and access detector elements. + +@section SCT_GeoModelClassOverview Class Overview + +The package contains several helper factories which build the different components of the SCT. +Some of the other classes are described here: + + - SCT_DetectorTool: Tool called by GeoModelSvc to start the building process + - SCT_DetectorFactory: Top level factory for SCT. It in turn calls the component factories. + - SCT_DetectorFactoryCosmic: Top level factory for building SCT barrel for Cosmic run in SR1 building. + - SCT_ComponentFactory: %Base class for all component factories. + - SCT_GeometryManager: General manager. + - SCT_Identifier: Helper class for building up the ATLAS Identifier + - SCT_DataBase: Access the Detector Description database + - SCT_xxxParameters: Interfaces for primary numbers. + - SCT_MaterialManager: Interface to the material manager. + - SCT_Options: Class to contain various building options. + - SCT_DefaultConditions: Class to store default conditions data. + +@section SCT_GeoModelReq Requirements + +@include requirements + +*/ diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx new file mode 100755 index 00000000000..8a8276f1cd7 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx @@ -0,0 +1,299 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Barrel.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" +#include "SCT_GeoModel/SCT_Identifier.h" + +#include "SCT_GeoModel/SCT_Layer.h" +#include "SCT_GeoModel/SCT_Module.h" +#include "SCT_GeoModel/SCT_Sensor.h" +#include "SCT_GeoModel/SCT_InterLink.h" +#include "SCT_GeoModel/SCT_Spider.h" +#include "SCT_GeoModel/SCT_PixelAttachment.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "InDetGeoModelUtils/ExtraMaterial.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoTubs.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include <iostream> + +SCT_Barrel::SCT_Barrel(const std::string & name) + : SCT_UniqueComponentFactory(name) +{ + getParameters(); + m_logVolume = preBuild(); +} + + +void +SCT_Barrel::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_innerRadius = parameters->barrelInnerRadius(); + m_outerRadius = parameters->barrelOuterRadius(); + m_length = parameters->barrelLength(); + m_numLayers = parameters->numLayers(); + + // Used in old geometry + m_thermalShieldEndWallThickness = parameters->thermalShieldEndCapThickness(); + + // Clearannce in z between layer and interlink. + m_zClearance = 1*CLHEP::mm; + + // Layer internal structure and services depend on geometry version + m_isOldGeometry = parameters->isOldGeometry(); + + // Set numerology + detectorManager()->numerology().setNumLayers(m_numLayers); + +} + +const GeoLogVol * +SCT_Barrel::preBuild() +{ + // Create the barrel volume + // Tube envelope containing the barrel. + SCT_MaterialManager materials; + const GeoTube * barrelEnvelopeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + GeoLogVol * barrelLog = + new GeoLogVol(getName(), barrelEnvelopeShape, materials.gasMaterial()); + return barrelLog; +} + +GeoVPhysVol * +SCT_Barrel::build(SCT_Identifier id) const +{ + + GeoFullPhysVol * barrel = new GeoFullPhysVol(m_logVolume); + + // Old geometries are no longer supported - give up now if one is requested + if(m_isOldGeometry) { + msg(MSG::FATAL) << "Old barrel geometry versions are not supported" << endreq; + return barrel; + } + + // There is only one type of module. So we create it just the once and pass it to the layers. + SCT_Module module("Module"); + + // Create the interlinks + SCT_InterLink interLink("InterLink"); + + // Calculte the length of the layer cylinder. This is the barrel length less the thermal + // shield and interlink width. + // This is only used for 'OldGeometry". In new geometry, layer length is set internally, + // and is equal to support cylinder length + double layerLength = m_length - 2*m_thermalShieldEndWallThickness - 2*interLink.length(); + + // We reduce to allow some alignment clearance + layerLength -= 2*m_zClearance; + + for (int iLayer = 0; iLayer < m_numLayers; iLayer++) { + + // Create the layers + + layerLength = 0.; + SCT_Layer layer("Layer"+intToString(iLayer), iLayer, &module); + barrel->add(new GeoNameTag("Layer#"+intToString(iLayer))); + barrel->add(new GeoIdentifierTag(iLayer)); // Identifier layer= iLayer + id.setLayerDisk(iLayer); + GeoAlignableTransform * transform = new GeoAlignableTransform(HepGeom::Transform3D()); + barrel->add(transform); + GeoVPhysVol * layerPV = layer.build(id); + barrel->add(layerPV); + // Store alignable transform + detectorManager()->addAlignableTransform(2, id.getWaferId(), transform, layerPV); + layerLength = std::max(layerLength,layer.length()); + } + + // Build and place the interlinks + double interLinkZPos = 0.; + interLinkZPos = 0.5 * layerLength + m_zClearance + 0.5 * interLink.length(); + barrel->add(new GeoTransform(HepGeom::TranslateZ3D(+interLinkZPos))); + barrel->add(interLink.getVolume()); + barrel->add(new GeoTransform(HepGeom::TranslateZ3D(-interLinkZPos))); + barrel->add(interLink.getVolume()); + + // Build and place the cooling spiders + double spiderZPos = 0.; + SCT_Spider spider("Spider"); + spiderZPos = interLinkZPos + 0.5*interLink.length() + 0.5*spider.length(); + barrel->add(new GeoTransform(HepGeom::TranslateZ3D(+spiderZPos))); + barrel->add(spider.getVolume()); + barrel->add(new GeoTransform(HepGeom::TranslateZ3D(-spiderZPos))); + barrel->add(spider.getVolume()); + + // Build and place the thermal shield. + buildThermalShield(barrel); + + // Build and place the EMI shield (inner thermal shield). + buildEMIShield(barrel); + + // Build and place SCT to Pixel attachment + SCT_PixelAttachment pixelAttachment("AttachmentPixelToSCT"); + barrel->add(new GeoTransform(HepGeom::TranslateZ3D(+pixelAttachment.zPosition()))); // +ve z + barrel->add(pixelAttachment.getVolume()); + barrel->add(new GeoTransform(HepGeom::TranslateZ3D(-pixelAttachment.zPosition()))); // -ve z + barrel->add(pixelAttachment.getVolume()); + + // Extra Material + InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager()); + xMat.add(barrel, "SCTBarrel"); + + return barrel; + +} + +void SCT_Barrel::buildThermalShield(GeoFullPhysVol * parent) const +{ + + // The thermal shield is now in 3 parts: + // (a) outer cylinder + // (b) bulkheads + // (c) end panels + // The inner cylinder is called 'EMI shield' for backwards compatibility + + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + SCT_MaterialManager materials; + + double cylinderOuterRadius = parameters->thermalShieldOuterRadius(); + double cylinderInnerRadius = parameters->thermalShieldInnerRadius(); + double cylinderLength = parameters->cylinderLength(); + double bulkheadInnerRadius = parameters->thermalShieldBulkheadInnerRadius(); + double bulkheadOuterRadius = parameters->thermalShieldBulkheadOuterRadius(); + double bulkheadThickness = parameters->thermalShieldEndCapCylThickness(); + double endPanelInnerRadius = parameters->thermalShieldEndPanelInnerRadius(); + double endPanelOuterRadius = parameters->thermalShieldEndPanelOuterRadius(); + double endPanelThickness = parameters->thermalShieldEndCapThickness(); + double endPanelZMax = parameters->thermalShieldEndZMax(); + + std::string cylinderMaterialName = parameters->thermalShieldMaterialCyl(); + std::string bulkheadMaterialName = parameters->thermalShieldMaterialOuterSect(); + std::string endPanelMaterialName = parameters->thermalShieldMaterialInnerSect(); + + + // The outer cylinder part of thermal shield. + const GeoTube * cylinderShape = new GeoTube(cylinderInnerRadius, cylinderOuterRadius, 0.5*cylinderLength); + const GeoMaterial* cylinderMaterial = materials.getMaterialForVolume(cylinderMaterialName,cylinderShape->volume()); + const GeoLogVol * cylinderLog = new GeoLogVol("ThShieldOuterCyl", cylinderShape, cylinderMaterial); + GeoPhysVol * cylinder = new GeoPhysVol(cylinderLog); + parent->add(cylinder); + + // The bulkheads + const GeoTube * bulkheadShape = new GeoTube(bulkheadInnerRadius, bulkheadOuterRadius, 0.5*bulkheadThickness); + const GeoMaterial* bulkheadMaterial = materials.getMaterialForVolume(bulkheadMaterialName,bulkheadShape->volume()); + const GeoLogVol * bulkheadLog = new GeoLogVol("ThShieldBulkhead", bulkheadShape, bulkheadMaterial); + GeoPhysVol * bulkhead = new GeoPhysVol(bulkheadLog); + GeoTransform * bulkheadPosPlus = new GeoTransform(HepGeom::TranslateZ3D(+(endPanelZMax-endPanelThickness-0.5*bulkheadThickness))); + GeoTransform * bulkheadPosMinus = new GeoTransform(HepGeom::TranslateZ3D(-(endPanelZMax-endPanelThickness-0.5*bulkheadThickness))); + parent->add(bulkheadPosPlus); + parent->add(bulkhead); + parent->add(bulkheadPosMinus); + parent->add(bulkhead); + + // The end panels + const GeoTube * endPanelShape = new GeoTube(endPanelInnerRadius, endPanelOuterRadius, 0.5*endPanelThickness); + const GeoMaterial* endPanelMaterial = materials.getMaterialForVolume(endPanelMaterialName,endPanelShape->volume()); + const GeoLogVol * endPanelLog = new GeoLogVol("ThShieldEndPanel", endPanelShape, endPanelMaterial); + GeoPhysVol * endPanel = new GeoPhysVol(endPanelLog); + GeoTransform * endPanelPosPlus = new GeoTransform(HepGeom::TranslateZ3D(+(endPanelZMax-0.5*endPanelThickness))); + GeoTransform * endPanelPosMinus = new GeoTransform(HepGeom::TranslateZ3D(-(endPanelZMax-0.5*endPanelThickness))); + parent->add(endPanelPosPlus); + parent->add(endPanel); + parent->add(endPanelPosMinus); + parent->add(endPanel); + +} + +void SCT_Barrel::buildEMIShield(GeoFullPhysVol * parent) const +{ + + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + SCT_MaterialManager materials; + + // Parameters of cylinder + double innerRadius = parameters->emiShieldInnerRadius(); + double deltaR = parameters->emiShieldDeltaR(); + double outerRadius = innerRadius + deltaR; + double length = 2 * parameters->emiShieldZMax(); + std::string materialName = parameters->emiShieldMaterial(); + + // Parameters of Electrical Shield Joint + double jointDeltaR = 0; + double jointRPhi = 0; + std::string jointMaterialName; + if(!m_isOldGeometry) { + jointDeltaR = parameters->emiJointDeltaR(); + jointRPhi = parameters->emiJointRPhi(); + jointMaterialName = parameters->emiJointMaterial(); + } + + // Parameters of Pixel Attachment - needed for cut-out + double pixelAttachmentLength = parameters->pixelAttachmentDeltaZ(); + double pixelAttachmentZpos = parameters->pixelAttachmentZMin() + 0.5 * pixelAttachmentLength; + + // Build cylinder (with cut-outs) + const GeoShape * emiShieldShape = 0; + const GeoMaterial * material; + const GeoTube * emiShieldTube = new GeoTube(innerRadius, outerRadius, 0.5*length); + // std::cout << "EMI tube volume = " << emiShieldTube->volume() << std::endl; + if (m_isOldGeometry) { + emiShieldShape = emiShieldTube; + material = materials.getMaterial(materialName); + } else { + const GeoTube* cutOut = new GeoTube(innerRadius, outerRadius, 0.5*pixelAttachmentLength); + // std::cout << "Cut-out volume = " << cutOut->volume() << std::endl; + const GeoShape* emiTemp = (GeoShape*)&(emiShieldTube->subtract(*cutOut << HepGeom::TranslateZ3D(pixelAttachmentZpos))); + emiShieldShape = (GeoShape*)&emiTemp->subtract(*cutOut << HepGeom::TranslateZ3D(-pixelAttachmentZpos)); + double emiVolume = emiShieldTube->volume() - 2. * cutOut->volume(); + // std::cout << "EMI final volume = " << emiVolume << std::endl; + material = materials.getMaterialForVolume(materialName, emiVolume); + } + const GeoLogVol * emiShieldLog = new GeoLogVol("EMIShield", emiShieldShape, material); + GeoPhysVol * emiShield = new GeoPhysVol(emiShieldLog); + parent->add(emiShield); + + // Build electrical shield joints (with cut-outs) + if (!m_isOldGeometry) { + double dphi = jointRPhi / outerRadius; + const GeoTubs* emiJointTubs = new GeoTubs(outerRadius, outerRadius+jointDeltaR, 0.5*length, + -0.5 * dphi * CLHEP::radian, dphi * CLHEP::radian); + // std::cout << "EMIJoint tubs volume = " << emiJointTubs->volume() << std::endl; + const GeoTubs* jointCutOut = new GeoTubs(outerRadius, outerRadius+jointDeltaR, 0.5*pixelAttachmentLength, + -0.5 * dphi * CLHEP::radian, dphi * CLHEP::radian); + // std::cout << "Cut-out volume = " << jointCutOut->volume() << std::endl; + const GeoShape* jointTemp = (GeoShape*)&(emiJointTubs->subtract(*jointCutOut << HepGeom::TranslateZ3D(pixelAttachmentZpos))); + const GeoShape* emiJointShape = (GeoShape*)&jointTemp->subtract(*jointCutOut << HepGeom::TranslateZ3D(-pixelAttachmentZpos)); + double jointVolume = emiJointTubs->volume() - 2. * jointCutOut->volume(); + // std::cout << "EMIJoint final volume = " << jointVolume << std::endl; + const GeoMaterial * jointMaterial = materials.getMaterialForVolume(jointMaterialName, jointVolume); + const GeoLogVol * emiJointLog = new GeoLogVol("EMIShieldJoint", emiJointShape, jointMaterial); + GeoPhysVol * emiJoint = new GeoPhysVol(emiJointLog); + // Place 3 copies + for (int i=0; i<3; i++) { + double angle = (90. + i * 120.) * CLHEP::degree; + parent->add(new GeoTransform(HepGeom::RotateZ3D(angle))); + parent->add(emiJoint); + } + } +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx new file mode 100755 index 00000000000..a20f80123a4 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx @@ -0,0 +1,257 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_BarrelModuleParameters.h" +#include "SCT_GeoModel/SCT_GeometryManager.h" + +#include "SCT_GeoModel/SCT_DataBase.h" + +#include "RDBAccessSvc/IRDBRecord.h" + +#include "CLHEP/Units/SystemOfUnits.h" + +#include <cmath> + +using std::abs; + +// +// A few hard wired numbers (some of which should go in NOVA) +// +/* +const double SCT_MODULE_HYBRID_OFFSET = 5.0 * CLHEP::mm; // Planar distance from center of sensor to edge of hybrid. +const int STEREO_UPPER_SIGN = -1; // Sign of stereo rotation of upper sensor with axis going + // from lower to upper + +const double PITCH = 80 * micrometer; +const double HALF_ACTIVE_STRIP_LENGTH = 31 * CLHEP::mm; +const double NOMINAL_WAFER_LENGTH = 63.960 * CLHEP::mm; +const double REF_DISTANCE_BETWEEN_FIDUCIALS = 2.19 * CLHEP::mm; +const double DISTANCE_CORNER_MARK_TO_CENTER = 31.750 * CLHEP::mm; +const double DISTANCE_CORNER_MARK_TO_FIDUCIAL = 0.8 * CLHEP::mm; +const double DISTANCE_CENTER_TO_CENTER = 2 * (DISTANCE_CORNER_MARK_TO_CENTER - + DISTANCE_CORNER_MARK_TO_FIDUCIAL) + + REF_DISTANCE_BETWEEN_FIDUCIALS; +*/ + +SCT_BarrelModuleParameters::SCT_BarrelModuleParameters() +{ + m_rdb = SCT_DataBase::instance(); +} + +// +// Barrel Sensors +// +double +SCT_BarrelModuleParameters::sensorThickness() const +{ + return m_rdb->brlSensor()->getDouble("THICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::sensorWidth() const +{ + return m_rdb->brlSensor()->getDouble("WIDTH") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::sensorLength() const +{ + return m_rdb->brlSensor()->getDouble("WAFERLENGTH") * CLHEP::mm; +} + +int +SCT_BarrelModuleParameters::sensorNumWafers() const +{ + return m_rdb->brlSensor()->getInt("NUMWAFERS"); +} + +std::string +SCT_BarrelModuleParameters::sensorMaterial() const +{ + return m_rdb->brlSensor()->getString("MATERIAL"); +} + +double +SCT_BarrelModuleParameters::sensorDistCenterToCenter() const +{ + return 2 * m_rdb->brlSensor()->getDouble("CENTERTOFIDUCIAL") * CLHEP::mm + + m_rdb->brlSensor()->getDouble("FIDUCIALSEP") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::sensorStripLength() const +{ + return 2 * m_rdb->brlSensor()->getDouble("ACTIVEHALFLENGTH") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::sensorStripPitch() const +{ + return m_rdb->brlSensor()->getDouble("STRIPPITCH") * CLHEP::mm; +} + +int +SCT_BarrelModuleParameters::sensorNumStrips() const +{ + return m_rdb->brlSensor()->getInt("NUMSTRIPS"); +} + + +int +SCT_BarrelModuleParameters::sensorNumReadoutStrips() const +{ + return m_rdb->brlSensor()->getInt("NUMREADOUTSTRIPS"); +} + +int +SCT_BarrelModuleParameters::sensorStripShift() const +{ + return m_rdb->brlSensor()->getInt("STRIPSHIFT"); +} + + + +// +// Barrel BaseBoard +// +double +SCT_BarrelModuleParameters::baseBoardThickness() const +{ + return m_rdb->brlModule()->getDouble("BASEBOARDTHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::baseBoardWidth() const +{ + return m_rdb->brlModule()->getDouble("BASEBOARDWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::baseBoardLength() const +{ + return m_rdb->brlModule()->getDouble("BASEBOARDLENGTH") * CLHEP::mm; +} + +std::string +SCT_BarrelModuleParameters::baseBoardMaterial() const +{ + return m_rdb->brlModule()->getString("BASEBOARDMATERIAL"); +} + +double +SCT_BarrelModuleParameters::baseBoardOffsetY() const +{ + return m_rdb->brlModule()->getDouble("BASEBOARDOFFSETY") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::baseBoardOffsetZ() const +{ + return m_rdb->brlModule()->getDouble("BASEBOARDOFFSETZ") * CLHEP::mm; +} + +// +// Barrel Hybrid +// +double +SCT_BarrelModuleParameters::hybridThickness() const +{ + return m_rdb->brlModule()->getDouble("HYBRIDTHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::hybridWidth() const +{ + return m_rdb->brlModule()->getDouble("HYBRIDWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::hybridLength() const +{ + return m_rdb->brlModule()->getDouble("HYBRIDLENGTH") * CLHEP::mm; +} + +std::string +SCT_BarrelModuleParameters::hybridMaterial() const +{ + return m_rdb->brlModule()->getString("HYBRIDMATERIAL"); +} + +double +SCT_BarrelModuleParameters::hybridOffsetX() const +{ + return m_rdb->brlModule()->getDouble("HYBRIDOFFSETX") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::hybridOffsetZ() const +{ + return m_rdb->brlModule()->getDouble("HYBRIDOFFSETZ") * CLHEP::mm; +} + +// +// Barrel Pigtail +// +double +SCT_BarrelModuleParameters::pigtailThickness() const +{ + return m_rdb->brlModule()->getDouble("PIGTAILTHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::pigtailWidth() const +{ + return m_rdb->brlModule()->getDouble("PIGTAILWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelModuleParameters::pigtailLength() const +{ + return m_rdb->brlModule()->getDouble("PIGTAILLENGTH") * CLHEP::mm; +} + +std::string +SCT_BarrelModuleParameters::pigtailMaterial() const +{ + return m_rdb->brlModule()->getString("PIGTAILMATERIAL"); +} + + + +// +// Barrel Module +// +int +SCT_BarrelModuleParameters::moduleStereoUpperSign() const +{ + return m_rdb->brlModule()->getInt("STEREOUPPERSIGN"); +} + +int +SCT_BarrelModuleParameters::moduleUpperSideNumber() const +{ + // Old geometries have lower module side = 0 and upper = 1 + if (m_rdb->brlModule()->isFieldNull("SIDEUPPER")) { + return 1; + } + return m_rdb->brlModule()->getInt("SIDEUPPER"); +} + + +double +SCT_BarrelModuleParameters::moduleStereoAngle() const +{ + return m_rdb->brlModule()->getDouble("STEREOANGLE") * CLHEP::milliradian; +} + + +double +SCT_BarrelModuleParameters::moduleSensorToSensorGap() const +{ + return m_rdb->brlModule()->getDouble("SENSORTOSENSORGAP") * CLHEP::mm; +} + + + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx new file mode 100755 index 00000000000..8347fe542b0 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx @@ -0,0 +1,869 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_BarrelParameters.h" +#include "SCT_GeoModel/SCT_GeometryManager.h" + +#include "SCT_GeoModel/SCT_DataBase.h" + +#include "RDBAccessSvc/IRDBRecord.h" + + +#include "CLHEP/Units/SystemOfUnits.h" + +#include <cmath> +#include <iostream> + + +SCT_BarrelParameters::SCT_BarrelParameters() +{ + m_rdb = SCT_DataBase::instance(); +} + + +// +// Barrel Ski +// +int +SCT_BarrelParameters::skiFirstStagger() const +{ + return m_rdb->brlSki()->getInt("SKIFIRSTSTAGGER"); +} + +double +SCT_BarrelParameters::skiRadialSep() const +{ + return m_rdb->brlSki()->getDouble("SKIRADIALSEP") * CLHEP::mm; +} + +int +SCT_BarrelParameters::modulesPerSki() const +{ + return m_rdb->brlSkiZSize(); +} + +double +SCT_BarrelParameters::skiZPosition(int index) const +{ + return m_rdb->brlSkiZ(index)->getDouble("ZPOSITION") * CLHEP::mm; +} + +int +SCT_BarrelParameters::skiModuleIdentifier(int index) const +{ + return m_rdb->brlSkiZ(index)->getInt("MODULEID"); +} + +// +// Barrel Layer +// +double +SCT_BarrelParameters::tilt(int iLayer) const +{ + return m_rdb->brlLayer(iLayer)->getDouble("TILT") * CLHEP::degree; +} + +int +SCT_BarrelParameters::layerStereoSign(int iLayer) const +{ + return m_rdb->brlLayer(iLayer)->getInt("STEREOSIGN"); +} + + +double +SCT_BarrelParameters::radius(int iLayer) const +{ + return m_rdb->brlLayer(iLayer)->getDouble("RADIUS") * CLHEP::mm; +} + +int +SCT_BarrelParameters::skisPerLayer(int iLayer) const +{ + return m_rdb->brlLayer(iLayer)->getInt("SKISPERLAYER"); +} + +double +SCT_BarrelParameters::layerBracketPhiOffset(int iLayer) const +{ + return m_rdb->brlLayer(iLayer)->getDouble("BRACKETPHIOFFSET") * CLHEP::deg; +} + +double +SCT_BarrelParameters::layerPhiOfRefModule(int iLayer) const +{ + // For backward compatibility, if field is null return (90 - tilt) + // as ref module is horizontal in old versions. + if (m_rdb->brlLayer(iLayer)->isFieldNull("PHIOFREFMODULE")) { + return 90*CLHEP::deg - tilt(iLayer); + } + return m_rdb->brlLayer(iLayer)->getDouble("PHIOFREFMODULE") * CLHEP::deg; +} + + +// +// Barrel Bracket +// +double +SCT_BarrelParameters::bracketThickness() const +{ + return m_rdb->brlSki()->getDouble("BRACKETTHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::bracketWidth() const +{ + return m_rdb->brlSki()->getDouble("BRACKETWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::bracketLength() const +{ + return m_rdb->brlSki()->getDouble("BRACKETLENGTH") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::bracketMaterial() const +{ + return m_rdb->brlSki()->getString("BRACKETMATERIAL"); +} + +// +// Barrel Dogleg +// +double +SCT_BarrelParameters::doglegThickness() const +{ + return m_rdb->brlSki()->getDouble("DOGLEGTHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::doglegWidth() const +{ + return m_rdb->brlSki()->getDouble("DOGLEGWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::doglegLength() const +{ + return m_rdb->brlSki()->getDouble("DOGLEGLENGTH") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::doglegMaterial() const +{ + return m_rdb->brlSki()->getString("DOGLEGMATERIAL"); +} + +double +SCT_BarrelParameters::doglegOffsetX() const +{ + return m_rdb->brlSki()->getDouble("DOGLEGOFFSETX") * CLHEP::mm; +} + +double +SCT_BarrelParameters::doglegOffsetY() const +{ + return m_rdb->brlSki()->getDouble("DOGLEGOFFSETY") * CLHEP::mm; +} + +// +// Barrel CoolingBlock +// +double +SCT_BarrelParameters::coolingBlockThickness() const +{ + return m_rdb->brlSki()->getDouble("COOLINGBLOCKTHICK") * CLHEP::mm; +} + +double +SCT_BarrelParameters::coolingBlockWidth() const +{ + return m_rdb->brlSki()->getDouble("COOLINGBLOCKWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::coolingBlockLength() const +{ + return m_rdb->brlSki()->getDouble("COOLINGBLOCKLENGTH") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::coolingBlockMaterial() const +{ + return m_rdb->brlSki()->getString("COOLINGBLOCKMATERIAL"); +} + +double +SCT_BarrelParameters::coolingBlockOffsetX() const +{ + return m_rdb->brlSki()->getDouble("COOLINGBLOCKOFFSETX") * CLHEP::mm; +} + +double +SCT_BarrelParameters::coolingBlockOffsetY() const +{ + return m_rdb->brlSki()->getDouble("COOLINGBLOCKOFFSETY") * CLHEP::mm; +} + +double +SCT_BarrelParameters::coolingBlockOffsetZ() const +{ + return m_rdb->brlSki()->getDouble("COOLINGBLOCKOFFSETZ") * CLHEP::mm; +} + +// +// Barrel CoolingPipe +// +double +SCT_BarrelParameters::coolingPipeRadius() const +{ + return m_rdb->brlSki()->getDouble("COOLINGPIPERADIUS") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::coolingPipeMaterial() const +{ + return m_rdb->brlSki()->getString("COOLINGPIPEMATERIAL"); +} + +double +SCT_BarrelParameters::coolingPipeOffsetX() const +{ + return m_rdb->brlSki()->getDouble("COOLINGPIPEOFFSETX") * CLHEP::mm; +} + +double +SCT_BarrelParameters::coolingPipeOffsetY() const +{ + return m_rdb->brlSki()->getDouble("COOLINGPIPEOFFSETY") * CLHEP::mm; +} + + +// +// Barrel PowerTape +// +double +SCT_BarrelParameters::powerTapeThickness() const +{ + return m_rdb->brlSki()->getDouble("POWERTAPETHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::powerTapeWidth() const +{ + return m_rdb->brlSki()->getDouble("POWERTAPEWIDTH") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::powerTapeMaterial() const +{ + return m_rdb->brlSki()->getString("POWERTAPEMATERIAL"); +} + +double +SCT_BarrelParameters::powerTapeStartPointOffset() const +{ + return m_rdb->brlSki()->getDouble("POWERTAPESTARTOFFSET") * CLHEP::mm; +} + +// +// Barrel Harness +// +double +SCT_BarrelParameters::harnessThickness() const +{ + return m_rdb->brlSki()->getDouble("HARNESSTHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::harnessWidth() const +{ + return m_rdb->brlSki()->getDouble("HARNESSWIDTH") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::harnessMaterial() const +{ + return m_rdb->brlSki()->getString("HARNESSMATERIAL"); +} + +// +// Barrel SupportCyl +// +double +SCT_BarrelParameters::supportCylInnerRadius(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getDouble("SUPPORTCYLINNERRAD") * CLHEP::mm; +} + +double +SCT_BarrelParameters::supportCylOuterRadius(int iLayer) const +{ + return supportCylInnerRadius(iLayer) + supportCylDeltaR(iLayer); +} + +double +SCT_BarrelParameters::supportCylDeltaR(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getDouble("SUPPORTCYLDELTAR") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::supportCylMaterial(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getString("SUPPORTCYLMATERIAL"); +} + + +// +// Barrel Flange +// +double +SCT_BarrelParameters::flangeDeltaZ(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getDouble("FLANGEDELTAZ") * CLHEP::mm; +} + +double +SCT_BarrelParameters::flangeDeltaR(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getDouble("FLANGEDELTAR") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::flangeMaterial(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getString("FLANGEMATERIAL"); +} + +// +// Barrel Clamp +// +double +SCT_BarrelParameters::clampDeltaZ(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getDouble("CLAMPDELTAZ") * CLHEP::mm; +} + +double +SCT_BarrelParameters::clampDeltaR(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getDouble("CLAMPDELTAR") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::clampMaterial(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getString("CLAMPMATERIAL"); +} + +// +// Barrel Cooling Inlet/outlets +// +double +SCT_BarrelParameters::coolingEndDeltaR(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getDouble("COOLINGENDDELTAR") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::coolingEndMaterial(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getString("COOLINGENDMATERIAL"); +} + +// +// Barrel CloseOut +// +double +SCT_BarrelParameters::closeOutDeltaZ(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getDouble("CLOSEOUTDELTAZ") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::closeOutMaterial(int iLayer) const +{ + return m_rdb->brlServPerLayer(iLayer)->getString("CLOSEOUTMATERIAL"); +} + +// +// Barrel InterLink and B6 bearing +// +double +SCT_BarrelParameters::interLinkDeltaZ() const +{ + return m_rdb->brlServices()->getDouble("INTERLINKDELTAZ") * CLHEP::mm; +} + +double +SCT_BarrelParameters::interLinkInnerRadius() const +{ + return m_rdb->brlServices()->getDouble("INTERLINKINNERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::interLinkOuterRadius() const +{ + return m_rdb->brlServices()->getDouble("INTERLINKOUTERRADIUS") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::interLinkMaterial() const +{ + return m_rdb->brlServices()->getString("INTERLINKMATERIAL"); +} + +double +SCT_BarrelParameters::interLinkDeltaPhi() const +{ + if (m_rdb->brlServices()->isFieldNull("INTERLINKDPHI")) { + return 360.*CLHEP::deg; + } + return m_rdb->brlServices()->getDouble("INTERLINKDPHI") * CLHEP::deg; +} + +double +SCT_BarrelParameters::interLinkPhiPos() const +{ + if (m_rdb->brlServices()->isFieldNull("INTERLINKPHIPOS")) { + return 0.; + } + return m_rdb->brlServices()->getDouble("INTERLINKPHIPOS") * CLHEP::deg; +} + +int +SCT_BarrelParameters::interLinkNRepeat() const +{ + if (m_rdb->brlServices()->isFieldNull("INTERLINKNREPEAT")) { + return 1; + } + return m_rdb->brlServices()->getInt("INTERLINKNREPEAT"); +} + +double +SCT_BarrelParameters::bearingDeltaPhi() const +{ + if (m_rdb->brlServices()->isFieldNull("BEARINGDPHI")) { + return 0.; + } + return m_rdb->brlServices()->getDouble("BEARINGDPHI") * CLHEP::deg; +} + +double +SCT_BarrelParameters::bearingPhiPos() const +{ + if (m_rdb->brlServices()->isFieldNull("BEARINGPHIPOS")) { + return 0.; + } + return m_rdb->brlServices()->getDouble("BEARINGPHIPOS") * CLHEP::deg; +} + +int +SCT_BarrelParameters::bearingNRepeat() const +{ + if (m_rdb->brlServices()->isFieldNull("BEARINGNREPEAT")) { + return 0; + } + return m_rdb->brlServices()->getInt("BEARINGNREPEAT"); +} + +std::string +SCT_BarrelParameters::bearingMaterial() const +{ + if (m_rdb->brlServices()->isFieldNull("BEARINGMATERIAL")) { + return " "; + } + return m_rdb->brlServices()->getString("BEARINGMATERIAL"); +} + +// +// Barrel FSI and FSI flange +// +bool +SCT_BarrelParameters::includeFSI() const +{ + if (m_rdb->brlFSISize() > 0) {return true;} + return false; +} + +double +SCT_BarrelParameters::fsiFlangeInnerRadius() const +{ + return m_rdb->brlFSI()->getDouble("FLANGEINNERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::fsiFlangeOuterRadius() const +{ + return m_rdb->brlFSI()->getDouble("FLANGEOUTERRADIUS") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::fsiFlangeMaterial() const +{ + return m_rdb->brlFSI()->getString("FLANGEMATERIAL"); +} + +double +SCT_BarrelParameters::fsiFibreMaskDeltaR() const +{ + return m_rdb->brlFSI()->getDouble("FIBREMASKDELTAR") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::fsiFibreMaskMaterial() const +{ + return m_rdb->brlFSI()->getString("FIBREMASKMATERIAL"); +} + +double +SCT_BarrelParameters::fsiEndJewelRadialWidth() const +{ + return m_rdb->brlFSI()->getDouble("ENDJEWELRADIALWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::fsiEndJewelRPhiWidth() const +{ + return m_rdb->brlFSI()->getDouble("ENDJEWELRPHIWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::fsiEndJewelLength() const +{ + return m_rdb->brlFSI()->getDouble("ENDJEWELLENGTH") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::fsiEndJewelMaterial() const +{ + return m_rdb->brlFSI()->getString("ENDJEWELMATERIAL"); +} + +int +SCT_BarrelParameters::fsiEndJewelNRepeat(int iLayer) const +{ + return m_rdb->brlFSILocation(iLayer)->getInt("ENDJEWELNREPEAT"); +} + +double +SCT_BarrelParameters::fsiEndJewelPhi(int iLayer) const +{ + return m_rdb->brlFSILocation(iLayer)->getDouble("ENDJEWELPHI") * CLHEP::degree; +} + +double +SCT_BarrelParameters::fsiEndJewelZ(int iLayer) const +{ + return m_rdb->brlFSILocation(iLayer)->getDouble("ENDJEWELZ") * CLHEP::mm; +} + +double +SCT_BarrelParameters::fsiScorpionRadialWidth() const +{ + return m_rdb->brlFSI()->getDouble("SCORPIONRADIALWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::fsiScorpionRPhiWidth() const +{ + return m_rdb->brlFSI()->getDouble("SCORPIONRPHIWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::fsiScorpionLength() const +{ + return m_rdb->brlFSI()->getDouble("SCORPIONLENGTH") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::fsiScorpionMaterial() const +{ + return m_rdb->brlFSI()->getString("SCORPIONMATERIAL"); +} + +int +SCT_BarrelParameters::fsiScorpionNRepeat(int iLayer) const +{ + return m_rdb->brlFSILocation(iLayer)->getInt("SCORPIONNREPEAT"); +} + +double +SCT_BarrelParameters::fsiScorpionPhi(int iLayer) const +{ + return m_rdb->brlFSILocation(iLayer)->getDouble("SCORPIONPHI") * CLHEP::degree; +} + +double +SCT_BarrelParameters::fsiScorpionZ(int iLayer) const +{ + return m_rdb->brlFSILocation(iLayer)->getDouble("SCORPIONZ") * CLHEP::mm; +} + + +// +// Barrel Cooling Spider +// +double +SCT_BarrelParameters::spiderDeltaZ() const +{ + return m_rdb->brlServices()->getDouble("SPIDERDELTAZ") * CLHEP::mm; +} + +double +SCT_BarrelParameters::spiderInnerRadius() const +{ + return m_rdb->brlServices()->getDouble("SPIDERINNERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::spiderOuterRadius() const +{ + return m_rdb->brlServices()->getDouble("SPIDEROUTERRADIUS") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::spiderMaterial() const +{ + return m_rdb->brlServices()->getString("SPIDERMATERIAL"); +} + +// +// Barrel Thermal Shield +// +double +SCT_BarrelParameters::thermalShieldInnerRadius() const +{ + return m_rdb->brlThermalShield()->getDouble("INNERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldOuterRadius() const +{ + return m_rdb->brlThermalShield()->getDouble("OUTERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldEndZMax() const +{ + return m_rdb->brlThermalShield()->getDouble("ENDZMAX") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldCylTotalThickness() const +{ + return m_rdb->brlThermalShield()->getDouble("CYLTOTALTHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldCylInnerWallThickness() const +{ + return m_rdb->brlThermalShield()->getDouble("CYLINNERWALLTHICK") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldCylOuterWallThickness() const +{ + return m_rdb->brlThermalShield()->getDouble("CYLOUTERWALLTHICK") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldSpacerZWidth() const +{ + return m_rdb->brlThermalShield()->getDouble("SPACERZWIDTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldFirstSpacerZMin() const +{ + return m_rdb->brlThermalShield()->getDouble("FIRSTSPACERZMIN") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldEndCapCylThickness() const +{ + return m_rdb->brlThermalShield()->getDouble("ENDCAPCYLTHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldEndCapThickness() const +{ + return m_rdb->brlThermalShield()->getDouble("ENDCAPTHICKNESS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldBulkheadInnerRadius() const +{ + return m_rdb->brlThermalShield()->getDouble("BULKHEADINNERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldBulkheadOuterRadius() const +{ + return m_rdb->brlThermalShield()->getDouble("BULKHEADOUTERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldEndPanelInnerRadius() const +{ + return m_rdb->brlThermalShield()->getDouble("ENDPANELINNERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::thermalShieldEndPanelOuterRadius() const +{ + return m_rdb->brlThermalShield()->getDouble("ENDPANELOUTERRADIUS") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::thermalShieldMaterialSpacer() const +{ + return m_rdb->brlThermalShield()->getString("MATERIALSPACER"); +} + +std::string +SCT_BarrelParameters::thermalShieldMaterialCyl() const +{ + return m_rdb->brlThermalShield()->getString("MATERIALCYL"); +} + +std::string +SCT_BarrelParameters::thermalShieldMaterialOuterSect() const +{ + return m_rdb->brlThermalShield()->getString("MATERIALOUTERSECT"); +} + +std::string +SCT_BarrelParameters::thermalShieldMaterialInnerSect() const +{ + return m_rdb->brlThermalShield()->getString("MATERIALINNERSECT"); +} + +// +// Barrel EMI Shield +// +double +SCT_BarrelParameters::emiShieldInnerRadius() const +{ + return m_rdb->brlServices()->getDouble("EMIINNERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::emiShieldDeltaR() const +{ + return m_rdb->brlServices()->getDouble("EMIDELTAR") * CLHEP::mm; +} + +double +SCT_BarrelParameters::emiShieldZMax() const +{ + return m_rdb->brlServices()->getDouble("EMIZMAX") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::emiShieldMaterial() const +{ + return m_rdb->brlServices()->getString("EMIMATERIAL"); +} + +double +SCT_BarrelParameters::emiJointDeltaR() const +{ + return m_rdb->brlServices()->getDouble("EMIJOINTDELTAR") * CLHEP::mm; +} + +double +SCT_BarrelParameters::emiJointRPhi() const +{ + return m_rdb->brlServices()->getDouble("EMIJOINTRPHI") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::emiJointMaterial() const +{ + return m_rdb->brlServices()->getString("EMIJOINTMATERIAL"); +} + + + +// +// Attachment of pixel to SCT. +// +double +SCT_BarrelParameters::pixelAttachmentInnerRadius() const +{ + return m_rdb->brlServices()->getDouble("PIXELATTACHINNERRAD") * CLHEP::mm; +} + +double +SCT_BarrelParameters::pixelAttachmentOuterRadius() const +{ + return m_rdb->brlServices()->getDouble("PIXELATTACHOUTERRAD") * CLHEP::mm; +} + +double +SCT_BarrelParameters::pixelAttachmentZMin() const +{ + return m_rdb->brlServices()->getDouble("PIXELATTACHZMIN") * CLHEP::mm; +} + +double +SCT_BarrelParameters::pixelAttachmentDeltaZ() const +{ + return m_rdb->brlServices()->getDouble("PIXELATTACHDELTAZ") * CLHEP::mm; +} + +std::string +SCT_BarrelParameters::pixelAttachmentMaterial() const +{ + return m_rdb->brlServices()->getString("PIXELATTACHMATERIAL"); +} + +// +// Barrel General +// +int +SCT_BarrelParameters::numLayers() const +{ + return m_rdb->brlGeneral()->getInt("NUMLAYERS"); +} + +double +SCT_BarrelParameters::barrelInnerRadius() const +{ + return m_rdb->brlGeneral()->getDouble("INNERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::barrelOuterRadius() const +{ + return m_rdb->brlGeneral()->getDouble("OUTERRADIUS") * CLHEP::mm; +} + +double +SCT_BarrelParameters::barrelLength() const +{ + return m_rdb->brlGeneral()->getDouble("LENGTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::cylinderLength() const +{ + return m_rdb->brlGeneral()->getDouble("CYLINDERLENGTH") * CLHEP::mm; +} + +double +SCT_BarrelParameters::activeLength() const +{ + return m_rdb->brlGeneral()->getDouble("ACTIVELENGTH") * CLHEP::mm; +} + +bool +SCT_BarrelParameters::isOldGeometry() const +{ + if (m_rdb->brlGeneral()->isFieldNull("CYLINDERLENGTH")) {return true;} + return false; +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx new file mode 100755 index 00000000000..36239690d34 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx @@ -0,0 +1,55 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_BaseBoard.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelModuleParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" + +SCT_BaseBoard::SCT_BaseBoard(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + +void +SCT_BaseBoard::getParameters() +{ + const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->baseBoardMaterial()); + m_safety = generalParameters->safety(); + m_thickness = parameters->baseBoardThickness(); + m_width = parameters->baseBoardWidth(); + m_length = parameters->baseBoardLength(); + +} + +GeoVPhysVol * +SCT_BaseBoard::build() +{ + // Make BaseBoard. Just a simple box. + const GeoBox * simpleBaseBoardShape = new GeoBox(0.5*m_thickness, + 0.5*m_width, + 0.5*m_length); + + const GeoLogVol * simpleBaseBoardLog = + new GeoLogVol(getName(), simpleBaseBoardShape, m_material); + + GeoPhysVol * simpleBaseBoard = new GeoPhysVol(simpleBaseBoardLog); + + return simpleBaseBoard; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx new file mode 100755 index 00000000000..1b31c5abc0f --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx @@ -0,0 +1,55 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// 14th Aug 2005 S.Mima modified. +// +#include "SCT_GeoModel/SCT_Bracket.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_Bracket::SCT_Bracket(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_Bracket::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->bracketMaterial()); + m_thickness = parameters->bracketThickness(); + m_length = parameters->bracketLength(); + m_width = parameters->bracketWidth(); +} + +GeoVPhysVol * +SCT_Bracket::build() +{ + + // Build the Bracket. Just a simple box. + // Width is in phi-direction. + // Length is in z-direction. + + const GeoBox * bracketShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length); + const GeoLogVol *bracketLog = + new GeoLogVol(getName(), bracketShape, m_material); + GeoPhysVol * bracket = new GeoPhysVol(bracketLog); + + return bracket; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx new file mode 100755 index 00000000000..f32066bda0c --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx @@ -0,0 +1,54 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Clamp.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_Clamp::SCT_Clamp(const std::string & name, int iLayer, + double innerRadius) + : SCT_SharedComponentFactory(name), m_iLayer(iLayer), + m_innerRadius(innerRadius) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_Clamp::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_materialName = parameters->clampMaterial(m_iLayer); + m_length = parameters->clampDeltaZ(m_iLayer); + m_radialWidth = parameters->clampDeltaR(m_iLayer); + + m_outerRadius = m_innerRadius + m_radialWidth; +} + +GeoVPhysVol * +SCT_Clamp::build() +{ + // Make the clamp. A simple tube. + SCT_MaterialManager materials; + + const GeoTube * clampShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + m_material = materials.getMaterialForVolume(m_materialName, clampShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol * clampLog = new GeoLogVol(getName(), clampShape, m_material); + + GeoPhysVol * clamp = new GeoPhysVol(clampLog); + + return clamp; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx new file mode 100755 index 00000000000..3058263df5c --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx @@ -0,0 +1,51 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_CloseOut.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_CloseOut::SCT_CloseOut(const std::string & name, int iLayer) + : SCT_SharedComponentFactory(name), m_iLayer(iLayer) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_CloseOut::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->closeOutMaterial(m_iLayer)); + m_length = parameters->closeOutDeltaZ(m_iLayer); + + // Same inner and outer radius of support cylinder. + m_outerRadius = parameters->supportCylOuterRadius(m_iLayer); + m_innerRadius = parameters->supportCylInnerRadius(m_iLayer); + +} + +GeoVPhysVol * +SCT_CloseOut::build() +{ + // Make the closeOut. A simple tube. + const GeoTube * closeOutShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + const GeoLogVol * closeOutLog = new GeoLogVol(getName(), closeOutShape, m_material); + + GeoPhysVol * closeOut = new GeoPhysVol(closeOutLog); + + return closeOut; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx new file mode 100755 index 00000000000..330e67bef7a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_ComponentFactory.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include <sstream> +#include <string> + +using InDetDD::SCT_DetectorManager; + +SCT_DetectorManager * SCT_ComponentFactory::s_detectorManager = 0; +const SCT_GeometryManager * SCT_ComponentFactory::s_geometryManager = 0; + +double SCT_ComponentFactory::s_epsilon = 1.0e-6 * CLHEP::mm; + +SCT_ComponentFactory::SCT_ComponentFactory(const std::string & name) + : m_name(name) +{} + +SCT_ComponentFactory::~SCT_ComponentFactory() +{} + + +void +SCT_ComponentFactory::setDetectorManager(SCT_DetectorManager * manager) +{ + s_detectorManager = manager; +} + +void +SCT_ComponentFactory::setGeometryManager(SCT_GeometryManager * manager) +{ + s_geometryManager = manager; +} + +std::string +SCT_ComponentFactory::intToString(int i) +{ + std::ostringstream str; + str << i; + return str.str(); +} + + + +double +SCT_ComponentFactory::epsilon() const +{ + return s_epsilon; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx new file mode 100755 index 00000000000..c79fee013c9 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx @@ -0,0 +1,54 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_CoolingBlock.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_CoolingBlock::SCT_CoolingBlock(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_CoolingBlock::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_materialName = parameters->coolingBlockMaterial(); + m_thickness = parameters->coolingBlockThickness(); + m_length = parameters->coolingBlockLength(); + m_width = parameters->coolingBlockWidth(); +} + +GeoVPhysVol * +SCT_CoolingBlock::build() +{ + + // Build the CoolingBlock. Just a simple box. + // Width is in phi-direction. + // Length is in z-direction. + + SCT_MaterialManager materials; + + const GeoBox * coolingBlockShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length); + m_material = materials.getMaterialForVolume(m_materialName, coolingBlockShape->volume()); + const GeoLogVol *coolingBlockLog = + new GeoLogVol(getName(), coolingBlockShape, m_material); + GeoPhysVol * coolingBlock = new GeoPhysVol(coolingBlockLog); + + return coolingBlock; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx new file mode 100755 index 00000000000..984ded34d4a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx @@ -0,0 +1,55 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_CoolingEnd.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_CoolingEnd::SCT_CoolingEnd(const std::string & name, int iLayer, + double innerRadius, + double length) + : SCT_SharedComponentFactory(name), m_iLayer(iLayer), + m_innerRadius(innerRadius), + m_length(length) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_CoolingEnd::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_materialName = parameters->coolingEndMaterial(m_iLayer); + m_radialWidth = parameters->clampDeltaR(m_iLayer); + + m_outerRadius = m_innerRadius + m_radialWidth; +} + +GeoVPhysVol * +SCT_CoolingEnd::build() +{ + // Make volume representing cooling inlets, outlets and U-bends. A simple tube. + SCT_MaterialManager materials; + + const GeoTube * coolShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + m_material = materials.getMaterialForVolume(m_materialName, coolShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol * coolLog = new GeoLogVol(getName(), coolShape, m_material); + + GeoPhysVol * cool = new GeoPhysVol(coolLog); + + return cool; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx new file mode 100755 index 00000000000..71ecc0369c6 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_CoolingPipe.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_CoolingPipe::SCT_CoolingPipe(const std::string & name, double length) + : SCT_SharedComponentFactory(name), m_length(length) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_CoolingPipe::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_materialName = parameters->coolingPipeMaterial(); + m_pipeRadius = parameters->coolingPipeRadius(); +} + +GeoVPhysVol * +SCT_CoolingPipe::build() +{ + + // Build the CoolingPipe. + SCT_MaterialManager materials; + + const GeoTube * coolingPipeShape = new GeoTube(0., m_pipeRadius, 0.5*m_length); + m_material = materials.getMaterialForVolume(m_materialName, coolingPipeShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol *coolingPipeLog = + new GeoLogVol(getName(), coolingPipeShape, m_material); + GeoPhysVol * coolingPipe = new GeoPhysVol(coolingPipeLog); + + return coolingPipe; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx new file mode 100755 index 00000000000..120ce83ca39 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx @@ -0,0 +1,298 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_DataBase.h" + +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "RDBAccessSvc/IRDBRecord.h" + +#include "GeoModelInterfaces/IGeoModelSvc.h" +#include "GeoModelUtilities/DecodeVersionKey.h" + +#include "SCT_GeoModel/SCT_GeoModelAthenaComps.h" + +#include <iostream> + +SCT_DataBase * SCT_DataBase::s_instance = 0; +const SCT_GeoModelAthenaComps * SCT_DataBase::s_athenaComps = 0; + +SCT_DataBase * SCT_DataBase::instance() +{ + if (s_athenaComps) { + if (!s_instance) s_instance = new SCT_DataBase; + } else { + std::cout << "SCT_Data ERROR. Cannot create instance without SCT_GeoModelAthenaComps object!" << std::endl; + } + return s_instance; +} + +void SCT_DataBase::reinit() +{ + delete s_instance; + s_instance = 0; +} + +const SCT_GeoModelAthenaComps * +SCT_DataBase::athenaComps() const +{ + return s_athenaComps; +} + +void +SCT_DataBase::setAthenaComps(const SCT_GeoModelAthenaComps * athenaComps) +{ + s_athenaComps = athenaComps; +} + +SCT_DataBase::SCT_DataBase() + +{ + + IGeoModelSvc * geoModel = s_athenaComps->geoModelSvc(); + + // Get version tag and node for SCT + DecodeVersionKey versionKey(geoModel, "SCT"); + std::string versionTag = versionKey.tag(); + std::string versionNode = versionKey.node(); + + // Get version tag and node for InnerDetector. + DecodeVersionKey indetVersionKey(geoModel, "InnerDetector"); + + // Access the RDB + IRDBAccessSvc* rdbSvc = s_athenaComps->rdbAccessSvc(); + + // SCT version tag + m_sctVersionTag = rdbSvc->getChildTag("SCT", versionKey.tag(), versionKey.node(), false); + + +///////////////////////////////////////////////////////// +// +// Gets the structures +// +///////////////////////////////////////////////////////// + + msg(MSG::INFO) << "Retrieving Record Sets from database ..." << endreq; + msg(MSG::DEBUG) << " Using version tag: " << versionTag << endreq; + msg(MSG::DEBUG) << " at node: " << versionNode << endreq; + msg(MSG::DEBUG) << " SCT Version: " << m_sctVersionTag << endreq; + + // ATLS - not sure I use it. + // General atlas parameters + + // + // SCT General + // + + // SCT TopLevel + m_topLevel = rdbSvc->getRecordsetPtr("SctTopLevel", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctTopLevel Fetched" << endreq; + + // Weight Table + m_weightTable = rdbSvc->getRecordsetPtr("SctWeights", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctWeights Fetched" << endreq; + + // Extra Scaling Table. This is used for extra material studies. For nominal material the table should be empty. + // NB this is at InnerDetector level node. + m_scalingTable = rdbSvc->getRecordsetPtr("SctMatScaling", indetVersionKey.tag(), indetVersionKey.node()); + msg(MSG::DEBUG) << "Table SctMatScaling Fetched" << endreq; + + // Default conditions + m_conditions = rdbSvc->getRecordsetPtr("SctConditions", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctConditions Fetched" << endreq; + + // + // SCT Barrel + // + m_brlSensor = rdbSvc->getRecordsetPtr("SctBrlSensor", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlSensor Fetched" << endreq; + + m_brlModule = rdbSvc->getRecordsetPtr("SctBrlModule", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlModule Fetched" << endreq; + + m_brlSki = rdbSvc->getRecordsetPtr("SctBrlSki", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlSki Fetched" << endreq; + + m_brlSkiZ = rdbSvc->getRecordsetPtr("SctBrlSkiZ", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlSkiZ Fetched" << endreq; + + m_brlLayer = rdbSvc->getRecordsetPtr("SctBrlLayer", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlLayer Fetched" << endreq; + + m_brlServices = rdbSvc->getRecordsetPtr("SctBrlServices", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlServices Fetched" << endreq; + + m_brlServPerLayer = rdbSvc->getRecordsetPtr("SctBrlServPerLayer", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlServPerLayer Fetched" << endreq; + + m_brlThermalShield = rdbSvc->getRecordsetPtr("SctBrlThermalShield", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlThermalShield Fetched" << endreq; + + m_brlGeneral = rdbSvc->getRecordsetPtr("SctBrlGeneral", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlGeneral Fetched" << endreq; + + m_brlFSI = rdbSvc->getRecordsetPtr("SctBrlFSI", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlFSI Fetched" << endreq; + + m_brlFSILocation = rdbSvc->getRecordsetPtr("SctBrlFSILocation", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctBrlFSILocation Fetched" << endreq; + + m_fwdSensor = rdbSvc->getRecordsetPtr("SctFwdSensor", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdSensor Fetched" << endreq; + + m_fwdHybrid = rdbSvc->getRecordsetPtr("SctFwdHybrid", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdHybrid Fetched" << endreq; + + m_fwdSpine = rdbSvc->getRecordsetPtr("SctFwdSpine", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdSpine Fetched" << endreq; + + m_fwdModule = rdbSvc->getRecordsetPtr("SctFwdModule", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdModule Fetched" << endreq; + + m_fwdModuleConnector = rdbSvc->getRecordsetPtr("SctFwdModuleConnector", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdModuleConnector Fetched" << endreq; + + // + // SCT Forward + // + m_fwdRing = rdbSvc->getRecordsetPtr("SctFwdRing", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdRing Fetched" << endreq; + + m_fwdWheel = rdbSvc->getRecordsetPtr("SctFwdWheel", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdWheel Fetched" << endreq; + + m_fwdWheelRingMap = rdbSvc->getRecordsetPtr("SctFwdWheelRingMap", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdWheelRingMap Fetched" << endreq; + + m_fwdDiscSupport = rdbSvc->getRecordsetPtr("SctFwdDiscSupport", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdDiscSupport Fetched" << endreq; + + m_fwdPatchPanelLoc = rdbSvc->getRecordsetPtr("SctFwdPatchPanelLoc", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdPatchPanelLoc Fetched" << endreq; + + m_fwdPatchPanel = rdbSvc->getRecordsetPtr("SctFwdPatchPanel", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdPatchPanel Fetched" << endreq; + + m_fwdPPConnector = rdbSvc->getRecordsetPtr("SctFwdPPConnector", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdPPConnector Fetched" << endreq; + + m_fwdPPCooling = rdbSvc->getRecordsetPtr("SctFwdPPCooling", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdPPCooling Fetched" << endreq; + + m_fwdCoolingBlock = rdbSvc->getRecordsetPtr("SctFwdCoolingBlock", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdCoolingBlock Fetched" << endreq; + + m_fwdRingServices = rdbSvc->getRecordsetPtr("SctFwdRingServices", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdRingServices Fetched" << endreq; + + m_fwdServices = rdbSvc->getRecordsetPtr("SctFwdServices", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdServices Fetched" << endreq; + + m_fwdFSILocation = rdbSvc->getRecordsetPtr("SctFwdFSILocation", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdFSILocation Fetched" << endreq; + + m_fwdFSIType = rdbSvc->getRecordsetPtr("SctFwdFSIType", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdFSIType Fetched" << endreq; + + m_fwdFSI = rdbSvc->getRecordsetPtr("SctFwdFSI", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdFSI Fetched" << endreq; + + m_fwdThermalShield = rdbSvc->getRecordsetPtr("SctFwdThermalShield", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdThermalShield Fetched" << endreq; + + m_fwdGeneral = rdbSvc->getRecordsetPtr("SctFwdGeneral", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdGeneral Fetched" << endreq; + + m_fwdOptoHarness = rdbSvc->getRecordsetPtr("SctFwdOptoHarness", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdOptoHarness Fetched" << endreq; + + m_fwdDiscFixation = rdbSvc->getRecordsetPtr("SctFwdDiscFixation", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdDiscFixation Fetched" << endreq; + + m_fwdCylServ = rdbSvc->getRecordsetPtr("SctFwdCylServ", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdCyServ Fetched" << endreq; + + m_fwdCylServLoc = rdbSvc->getRecordsetPtr("SctFwdCylServLoc", versionTag, versionNode); + msg(MSG::DEBUG) << "Table SctFwdCylServLoc Fetched" << endreq; + + +} + + +IRDBRecordset_ptr SCT_DataBase::weightTable() const {return m_weightTable;} + +IRDBRecordset_ptr SCT_DataBase::scalingTable() const {return m_scalingTable;} + +//const IRDBRecord* SCT_DataBase::atls() const {return *m_atls)[0];} +IRDBRecordset_ptr SCT_DataBase::topLevelTable() const {return m_topLevel;} + +IRDBRecordset_ptr SCT_DataBase::conditionsTable() const {return m_conditions;} +const IRDBRecord* SCT_DataBase::conditions() const {return (*m_conditions)[0];} + +const IRDBRecord* SCT_DataBase::brlSensor() const {return (*m_brlSensor)[0];} +const IRDBRecord* SCT_DataBase::brlModule() const {return (*m_brlModule)[0];} + +const IRDBRecord* SCT_DataBase::brlSki() const {return (*m_brlSki)[0];} +const IRDBRecord* SCT_DataBase::brlSkiZ(int i) const {return (*m_brlSkiZ)[i];} +int SCT_DataBase::brlSkiZSize() const {return m_brlSkiZ->size();} +const IRDBRecord* SCT_DataBase::brlLayer(int i) const {return (*m_brlLayer)[i];} +const IRDBRecord* SCT_DataBase::brlServices() const {return (*m_brlServices)[0];} +const IRDBRecord* SCT_DataBase::brlServPerLayer(int i) const {return (*m_brlServPerLayer)[i];} +const IRDBRecord* SCT_DataBase::brlThermalShield() const {return (*m_brlThermalShield)[0];} +const IRDBRecord* SCT_DataBase::brlGeneral() const {return (*m_brlGeneral)[0];} +const IRDBRecord* SCT_DataBase::brlFSI() const {return (*m_brlFSI)[0];} +int SCT_DataBase::brlFSISize() const {return m_brlFSI->size();} +const IRDBRecord* SCT_DataBase::brlFSILocation(int i) const {return (*m_brlFSILocation)[i];} + +const IRDBRecord* SCT_DataBase::fwdSensor(int i) const {return (*m_fwdSensor)[i];} +const IRDBRecord* SCT_DataBase::fwdHybrid() const {return (*m_fwdHybrid)[0];} +const IRDBRecord* SCT_DataBase::fwdSpine(int i) const {return (*m_fwdSpine)[i];} +const IRDBRecord* SCT_DataBase::fwdModule(int i) const {return (*m_fwdModule)[i];} +int SCT_DataBase::fwdModuleSize() const {return m_fwdModule->size();} +IRDBRecordset_ptr SCT_DataBase::fwdModuleConnectorTable() const {return m_fwdModuleConnector;} +const IRDBRecord* SCT_DataBase::fwdModuleConnector() const {return (*m_fwdModuleConnector)[0];} + +const IRDBRecord* SCT_DataBase::fwdRing(int i) const {return (*m_fwdRing)[i];} +int SCT_DataBase::fwdRingSize() const {return m_fwdRing->size();} +const IRDBRecord* SCT_DataBase::fwdWheel(int i) const {return (*m_fwdWheel)[i];} +const IRDBRecord* SCT_DataBase::fwdWheelRingMap(int i) const {return (*m_fwdWheelRingMap)[i];} +int SCT_DataBase::fwdWheelRingMapSize() const {return m_fwdWheelRingMap->size();} +const IRDBRecord* SCT_DataBase::fwdDiscSupport() const {return (*m_fwdDiscSupport)[0];} +const IRDBRecord* SCT_DataBase::fwdPatchPanelLoc(int i) const {return (*m_fwdPatchPanelLoc)[i];} +int SCT_DataBase::fwdPatchPanelLocSize() const {return m_fwdPatchPanelLoc->size();} +const IRDBRecord* SCT_DataBase::fwdPatchPanel(int i) const {return (*m_fwdPatchPanel)[i];} +int SCT_DataBase::fwdPatchPanelSize() const {return m_fwdPatchPanel->size();} +const IRDBRecord* SCT_DataBase::fwdPPConnector() const {return (*m_fwdPPConnector)[0];} +int SCT_DataBase::fwdPPConnectorSize() const {return m_fwdPPConnector->size();} +const IRDBRecord* SCT_DataBase::fwdPPCooling() const {return (*m_fwdPPCooling)[0];} +int SCT_DataBase::fwdPPCoolingSize() const {return m_fwdPPCooling->size();} +const IRDBRecord* SCT_DataBase::fwdCoolingBlock(int i) const {return (*m_fwdCoolingBlock)[i];} +const IRDBRecord* SCT_DataBase::fwdRingServices(int i) const {return (*m_fwdRingServices)[i];} +const IRDBRecord* SCT_DataBase::fwdServices() const {return (*m_fwdServices)[0];} +const IRDBRecord* SCT_DataBase::fwdFSILocation(int i) const {return (*m_fwdFSILocation)[i];} +int SCT_DataBase::fwdFSILocationSize() const {return m_fwdFSILocation->size();} +const IRDBRecord* SCT_DataBase::fwdFSIType(int i) const {return (*m_fwdFSIType)[i];} +int SCT_DataBase::fwdFSITypeSize() const {return m_fwdFSIType->size();} +const IRDBRecord* SCT_DataBase::fwdFSI(int i) const {return (*m_fwdFSI)[i];} +int SCT_DataBase::fwdFSISize() const {return m_fwdFSI->size();} +const IRDBRecord* SCT_DataBase::fwdThermalShield(int i) const {return (*m_fwdThermalShield)[i];} +int SCT_DataBase::fwdThermalShieldSize() const {return m_fwdThermalShield->size();} +const IRDBRecord* SCT_DataBase::fwdGeneral() const {return (*m_fwdGeneral)[0];} +IRDBRecordset_ptr SCT_DataBase::fwdOptoHarnessTable() const {return m_fwdOptoHarness;} +const IRDBRecord* SCT_DataBase::fwdOptoHarness(int i) const {return (*m_fwdOptoHarness)[i];} +const IRDBRecord* SCT_DataBase::fwdDiscFixation() const {return (*m_fwdDiscFixation)[0];} +IRDBRecordset_ptr SCT_DataBase::fwdDiscFixationTable() const {return m_fwdDiscFixation;} +const IRDBRecord* SCT_DataBase::fwdCylServ(int i) const {return (*m_fwdCylServ)[i];} +int SCT_DataBase::fwdCylServSize() const {return m_fwdCylServ->size();} +const IRDBRecord* SCT_DataBase::fwdCylServLoc(int i) const {return (*m_fwdCylServLoc)[i];} +int SCT_DataBase::fwdCylServLocSize() const {return m_fwdCylServLoc->size();} + +const std::string & SCT_DataBase::versionTag() const { + return m_sctVersionTag; +} + +MsgStream& SCT_DataBase::msg (MSG::Level lvl) const +{ + return s_athenaComps->msg(lvl); +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx new file mode 100755 index 00000000000..d7e9e102de8 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx @@ -0,0 +1,320 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// SCT_DetectorFactory: This is the top level node +// + + +#include "SCT_GeoModel/SCT_DetectorFactory.h" +#include "SCT_GeoModel/SCT_Identifier.h" +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" +#include "InDetReadoutGeometry/Version.h" +#include "InDetReadoutGeometry/SiCommonItems.h" +#include "InDetReadoutGeometry/InDetDD_Defs.h" +#include "InDetReadoutGeometry/SCT_ModuleSideDesign.h" + +#include "SCT_GeoModel/SCT_Barrel.h" +#include "SCT_GeoModel/SCT_Forward.h" +#include "SCT_GeoModel/SCT_DataBase.h" +#include "SCT_GeoModel/SCT_GeoModelAthenaComps.h" + +// +// GeoModel include files: +// +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoVPhysVol.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "GeoModelInterfaces/StoredMaterialManager.h" +#include "GeoModelInterfaces/IGeoModelSvc.h" +#include "GeoModelUtilities/DecodeVersionKey.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "RDBAccessSvc/IRDBRecord.h" +# +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/ISvcLocator.h" + +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/Rotation.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +#include <iostream> +#include <iomanip> +#include <string> + +using InDetDD::SCT_DetectorManager; +using InDetDD::SiCommonItems; + +SCT_DetectorFactory::SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaComps, + const SCT_Options & options) + : InDetDD::DetectorFactoryBase(athenaComps) +{ + + // Create the detector manager + m_detectorManager = new SCT_DetectorManager(detStore()); + + // + // Create the geometry manager. + // + + m_geometryManager = new SCT_GeometryManager(); + m_geometryManager->setOptions(options); + m_geometryManager->setAthenaComps(athenaComps); + + // Pass the Athena components the data base access class + SCT_DataBase::setAthenaComps(athenaComps); + + // Create SiCommonItems. These are items that are shared by all elements + SiCommonItems * commonItems = new SiCommonItems(athenaComps->getIdHelper()); + commonItems->setLorentzAngleSvc(athenaComps->lorentzAngleSvc()); + m_geometryManager->setCommonItems(commonItems); + + + // Set Version information + // Get the geometry tag + DecodeVersionKey versionKey(geoModelSvc(), "SCT"); + IRDBRecordset_ptr switchSet + = rdbAccessSvc()->getRecordsetPtr("SctSwitches", versionKey.tag(), versionKey.node()); + const IRDBRecord *switches = (*switchSet)[0]; + + std::string layout = "Final"; + std::string description; + if (!switches->isFieldNull("LAYOUT")) { + layout = switches->getString("LAYOUT"); + } + if (!switches->isFieldNull("DESCRIPTION")) { + description = switches->getString("DESCRIPTION"); + } + + std::string versionTag = rdbAccessSvc()->getChildTag("SCT", versionKey.tag(), versionKey.node(), false); + std::string versionName = switches->getString("VERSIONNAME"); + int versionMajorNumber = 3; + int versionMinorNumber = 6; + int versionPatchNumber = 0; + InDetDD::Version version(versionTag, + versionName, + layout, + description, + versionMajorNumber, + versionMinorNumber, + versionPatchNumber); + m_detectorManager->setVersion(version); + + // Initailize some static variables in various classes/ + SCT_ComponentFactory::setDetectorManager(m_detectorManager); + SCT_ComponentFactory::setGeometryManager(m_geometryManager); + + SCT_Identifier::setIdHelper(athenaComps->getIdHelper()); + +} + + +SCT_DetectorFactory::~SCT_DetectorFactory() +{ + // NB the detector manager (m_detectorManager)is stored in the detector store by the + // Tool and so we don't delete it. + delete m_geometryManager; + +} + +void SCT_DetectorFactory::create(GeoPhysVol *world) +{ + + msg(MSG::INFO) << "Building SCT Detector." << endreq; + msg(MSG::INFO) << " " << m_detectorManager->getVersion().fullDescription() << endreq; + + // The name tag here is what is used by the GeoModel viewer. + GeoNameTag *topLevelNameTag = new GeoNameTag("SCT"); + + // Change precision. + int oldPrecision = std::cout.precision(6); + + // The tree tops get added to world. We name it "indet" though. + GeoPhysVol *indet = world; + + // Set default gas throughout detector. + // Air is the default if this is not set. + // SCT_MaterialManager::setGasMaterial("std::Air"); + + const SCT_GeneralParameters * sctGeneral = m_geometryManager->generalParameters(); + + HepGeom::Transform3D sctTransform = sctGeneral->partTransform("SCT"); + + std::string barrelLabel = "Barrel"; + std::string forwardPlusLabel = "EndcapA"; + std::string forwardMinusLabel = "EndcapC"; + + bool barrelPresent = sctGeneral->partPresent(barrelLabel); + bool forwardPlusPresent = sctGeneral->partPresent(forwardPlusLabel); + bool forwardMinusPresent = sctGeneral->partPresent(forwardMinusLabel); + + + + // + // The Barrel + // + if (barrelPresent) { + + msg(MSG::DEBUG) << "Building the SCT Barrel." << endreq; + + m_detectorManager->numerology().addBarrel(0); + + // Create the SCT Barrel + SCT_Barrel sctBarrel("SCT_Barrel"); + + SCT_Identifier id; + id.setBarrelEC(0); + GeoVPhysVol * barrelPV = sctBarrel.build(id); + GeoAlignableTransform * barrelTransform = new GeoAlignableTransform(sctTransform * sctGeneral->partTransform(barrelLabel)); + + //indet->add(new GeoNameTag("SCT_Barrel")); + indet->add(topLevelNameTag); + indet->add(new GeoIdentifierTag(0)); + indet->add(barrelTransform); + indet->add(barrelPV); + m_detectorManager->addTreeTop(barrelPV); + + // Store alignable transform + m_detectorManager->addAlignableTransform(3, id.getWaferId(), barrelTransform, barrelPV); + + } + + // + // The Positive Z Endcap (EndcapA) + // + if (forwardPlusPresent) { + + msg(MSG::DEBUG) << "Building the SCT Endcap A (positive z)." << endreq; + + m_detectorManager->numerology().addEndcap(2); + + // Create the Forward + SCT_Forward sctForwardPlus("SCT_ForwardA", +2); + + SCT_Identifier idFwdPlus; + idFwdPlus.setBarrelEC(2); + GeoVPhysVol * forwardPlusPV = sctForwardPlus.build(idFwdPlus); + HepGeom::Transform3D fwdTransformPlus(sctTransform + * sctGeneral->partTransform(forwardPlusLabel) + * HepGeom::TranslateZ3D(sctForwardPlus.zCenter())); + GeoAlignableTransform * fwdGeoTransformPlus = new GeoAlignableTransform(fwdTransformPlus); + + //indet->add(new GeoNameTag("SCT_ForwardPlus")); + indet->add(topLevelNameTag); + indet->add(new GeoIdentifierTag(2)); + indet->add(fwdGeoTransformPlus); + indet->add(forwardPlusPV); + m_detectorManager->addTreeTop(forwardPlusPV); + + // Store alignable transform + m_detectorManager->addAlignableTransform(3, idFwdPlus.getWaferId(), fwdGeoTransformPlus, forwardPlusPV); + } + + // + // The Negative Z Endcap (EndcapC) + // + + if (forwardMinusPresent) { + + msg(MSG::DEBUG) << "Building the SCT Endcap C (negative z)." << endreq; + + m_detectorManager->numerology().addEndcap(-2); + + SCT_Forward sctForwardMinus("SCT_ForwardC",-2); + + SCT_Identifier idFwdMinus; + idFwdMinus.setBarrelEC(-2); + GeoVPhysVol * forwardMinusPV = sctForwardMinus.build(idFwdMinus); + + HepGeom::Transform3D rot; + rot = HepGeom::RotateY3D(180 * CLHEP::degree); + + HepGeom::Transform3D fwdTransformMinus(sctTransform + * sctGeneral->partTransform(forwardMinusLabel) + * rot + * HepGeom::TranslateZ3D(sctForwardMinus.zCenter())); + GeoAlignableTransform * fwdGeoTransformMinus = new GeoAlignableTransform(fwdTransformMinus); + + //indet->add(new GeoNameTag("SCT_ForwardMinus")); + indet->add(topLevelNameTag); + indet->add(new GeoIdentifierTag(-2)); + indet->add(fwdGeoTransformMinus); + indet->add(forwardMinusPV); + m_detectorManager->addTreeTop(forwardMinusPV); + + + // Store alignable transform + m_detectorManager->addAlignableTransform(3, idFwdMinus.getWaferId(), fwdGeoTransformMinus, forwardMinusPV); + } + + // Set the neighbours + m_detectorManager->initNeighbours(); + + // Set maximum number of strips in numerology. + for (int iDesign = 0; iDesign < m_detectorManager->numDesigns(); iDesign++) { + m_detectorManager->numerology().setMaxNumPhiCells(m_detectorManager->getSCT_Design(iDesign)->cells()); + } + + // Register the keys and the level corresponding to the key + // and whether it expects a global or local shift. + // level 0: sensor, level 1: module, level 2, layer/disc, level 3: whole barrel/enccap + + m_detectorManager->addFolder("/Indet/Align"); + + m_detectorManager->addChannel("/Indet/Align/ID",3,InDetDD::global); + m_detectorManager->addChannel("/Indet/Align/SCT",2,InDetDD::global); + + if (barrelPresent) { + m_detectorManager->addChannel("/Indet/Align/SCTB1",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTB2",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTB3",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTB4",1,InDetDD::local); + } + if (forwardPlusPresent) { + m_detectorManager->addChannel("/Indet/Align/SCTEA1",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEA2",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEA3",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEA4",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEA5",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEA6",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEA7",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEA8",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEA9",1,InDetDD::local); + } + if (forwardMinusPresent) { + m_detectorManager->addChannel("/Indet/Align/SCTEC1",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEC2",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEC3",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEC4",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEC5",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEC6",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEC7",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEC8",1,InDetDD::local); + m_detectorManager->addChannel("/Indet/Align/SCTEC9",1,InDetDD::local); + } + + // Return precision to its original value + std::cout.precision(oldPrecision); + +} + + +const SCT_DetectorManager * SCT_DetectorFactory::getDetectorManager() const +{ + return m_detectorManager; +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx new file mode 100755 index 00000000000..9b9bec38f93 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx @@ -0,0 +1,329 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_DetectorTool.h" +#include "SCT_GeoModel/SCT_DetectorFactory.h" +#include "SCT_GeoModel/SCT_DetectorFactoryCosmic.h" +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_DataBase.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" +#include "SCT_GeoModel/SCT_Options.h" +#include "SCT_GeoModel/SCT_GeoModelAthenaComps.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" +#include "DetDescrConditions/AlignableTransformContainer.h" +#include "InDetCondServices/ISiLorentzAngleSvc.h" + +#include "GeoModelUtilities/GeoModelExperiment.h" +#include "GeoModelInterfaces/IGeoModelSvc.h" +#include "GeoModelUtilities/DecodeVersionKey.h" +#include "StoreGate/StoreGateSvc.h" +#include "StoreGate/DataHandle.h" +#include "GeometryDBSvc/IGeometryDBSvc.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" + +#include "CLIDSvc/tools/ClassID_traits.h" +#include "SGTools/DataProxy.h" + +using InDetDD::SCT_DetectorManager; +using InDetDD::SiDetectorManager; + +// +// Constructor +// +SCT_DetectorTool::SCT_DetectorTool( const std::string& type, + const std::string& name, + const IInterface* parent ) + : GeoModelTool( type, name, parent ), + m_detectorName("SCT"), + m_initialLayout(false), + m_alignable(true), + m_cosmic(false), + m_manager(0), + m_athenaComps(0), + m_geoModelSvc("GeoModelSvc",name), + m_rdbAccessSvc("RDBAccessSvc",name), + m_geometryDBSvc("InDetGeometryDBSvc",name), + m_lorentzAngleSvc("SCTLorentzAngleSvc", name) + +{ + // Get parameter values from jobOptions file + declareProperty("DetectorName", m_detectorName); + declareProperty("InitialLayout", m_initialLayout=false); + declareProperty("Alignable", m_alignable); + declareProperty("RDBAccessSvc", m_rdbAccessSvc); + declareProperty("GeometryDBSvc", m_geometryDBSvc); + declareProperty("GeoModelSvc", m_geoModelSvc); + declareProperty("LorentzAngleSvc", m_lorentzAngleSvc); +} + +// +// Destructor +// +SCT_DetectorTool::~SCT_DetectorTool() +{ + delete m_athenaComps; +} + +// +// Create the Geometry via the factory corresponding to this tool +// + +StatusCode +SCT_DetectorTool::create( StoreGateSvc* detStore ) +{ + + StatusCode result = StatusCode::SUCCESS; + + // Reinit various singleton type objects. + SCT_DataBase::reinit(); + SCT_MaterialManager::reinit(); + + // Get the detector configuration. + StatusCode sc = m_geoModelSvc.retrieve(); + if (sc.isFailure()) { + msg(MSG::FATAL) << "Could not locate GeoModelSvc" << endreq; + return (StatusCode::FAILURE); + } + + + DecodeVersionKey versionKey(&*m_geoModelSvc, "SCT"); + + // Issue error if AUTO. + if (versionKey.tag() == "AUTO"){ + msg(MSG::ERROR) << "AUTO Atlas version. Please select a version." << endreq; + } + + + msg(MSG::INFO) << "Building SCT with Version Tag: "<< versionKey.tag() << " at Node: " << versionKey.node() << endreq; + + sc = m_rdbAccessSvc.retrieve(); + if (sc.isFailure()) { + msg(MSG::FATAL) << "Could not locate RDBAccessSvc" << endreq; + return (StatusCode::FAILURE); + } + + // Print the SCT version tag: + std::string sctVersionTag; + sctVersionTag = m_rdbAccessSvc->getChildTag("SCT", versionKey.tag(), versionKey.node(), false); + msg(MSG::INFO) << "SCT Version: " << sctVersionTag << " Package Version: " << PACKAGE_VERSION << endreq; + + + // Check if version is empty. If so, then the SCT cannot be built. This may or may not be intentional. We + // just issue an INFO message. + if (sctVersionTag.empty()) { + msg(MSG::INFO) << "No SCT Version. SCT will not be built." << endreq; + + } else { + + std::string versionName; + + if (versionKey.custom()) { + + msg(MSG::WARNING) << "SCT_DetectorTool: Detector Information coming from a custom configuration!!" << endreq; + } else { + + if(msgLvl(MSG::DEBUG)) { + msg(MSG::DEBUG) << "SCT_DetectorTool: Detector Information coming from the database and job options IGNORED." << endreq; + msg(MSG::DEBUG) << "Keys for SCT Switches are " << versionKey.tag() << " " << versionKey.node() << endreq; + } + IRDBRecordset_ptr switchSet = m_rdbAccessSvc->getRecordsetPtr("SctSwitches", versionKey.tag(), versionKey.node()); + const IRDBRecord *switches = (*switchSet)[0]; + + m_detectorName = switches->getString("DETECTORNAME"); + + m_cosmic = false; + if (!switches->isFieldNull("COSMICLAYOUT")) { + m_cosmic = switches->getInt("COSMICLAYOUT"); + } + + if (!switches->isFieldNull("VERSIONNAME")) { + versionName = switches->getString("VERSIONNAME"); + } + + // m_initialLayout = switches->getInt("INITIALLAYOUT"); + + + } + + if (versionName.empty()) { + if (m_cosmic) { + versionName = "SR1"; + } + } + { + if(msgLvl(MSG::DEBUG)) { + msg(MSG::DEBUG) << "Creating the SCT" << endreq; + msg(MSG::DEBUG) << "SCT Geometry Options: " << endreq; + msg(MSG::DEBUG) << " InitialLayout: " << (m_initialLayout ? "true" : "false") + << endreq; + msg(MSG::DEBUG) << " Alignable: " << (m_alignable ? "true" : "false") + << endreq; + msg(MSG::DEBUG) << " CosmicLayout: " << (m_cosmic ? "true" : "false") + << endreq; + msg(MSG::DEBUG) << " VersionName: " << versionName + << endreq; + } + + SCT_Options options; + + options.setAlignable(m_alignable); + + + m_manager = 0; + + // + // Locate the top level experiment node + // + GeoModelExperiment * theExpt; + if (StatusCode::SUCCESS != detStore->retrieve( theExpt, "ATLAS" )) { + msg(MSG::ERROR) + << "Could not find GeoModelExperiment ATLAS" + << endreq; + return (StatusCode::FAILURE); + } + + // Retrieve the Geometry DB Interface + sc = m_geometryDBSvc.retrieve(); + if (sc.isFailure()) { + msg(MSG::FATAL) << "Could not locate Geometry DB Interface: " << m_geometryDBSvc.name() << endreq; + return (StatusCode::FAILURE); + } + + // Pass athena services to factory, etc + m_athenaComps = new SCT_GeoModelAthenaComps; + m_athenaComps->setDetStore(detStore); + m_athenaComps->setGeoModelSvc(&*m_geoModelSvc); + m_athenaComps->setGeometryDBSvc(&*m_geometryDBSvc); + m_athenaComps->setRDBAccessSvc(&*m_rdbAccessSvc); + m_athenaComps->setLorentzAngleSvc(m_lorentzAngleSvc); + const SCT_ID* idHelper; + if (detStore->retrieve(idHelper, "SCT_ID").isFailure()) { + msg(MSG::FATAL) << "Could not get SCT ID helper" << endreq; + return StatusCode::FAILURE; + } else { + m_athenaComps->setIdHelper(idHelper); + } + + // + // LorentzAngleService + // + if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) + << "Lorentz angle service passed to InDetReadoutGeometry with name: " << m_lorentzAngleSvc.name() << endreq; + + + //try { + // + // This strange way of casting is to avoid an + // utterly brain damaged compiler warning. + // + GeoPhysVol *world=&*theExpt->getPhysVol(); + + SCT_DetectorFactory theSCT(m_athenaComps, options); + theSCT.create(world); + m_manager = theSCT.getDetectorManager(); + + if (!m_manager) { + msg(MSG::ERROR) << "SCT_DetectorManager not created" << endreq; + return( StatusCode::FAILURE ); + } + + // Get the manager from the factory and store it in the detector store. + // m_detector is non constant so I can not set it to a const pointer. + // m_detector = theSCT.getDetectorManager(); + + if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Registering SCT_DetectorManager. " << endreq; + + result = detStore->record(m_manager, m_manager->getName()); + + if (result.isFailure() ) { + msg(MSG::ERROR) << "Could not register SCT_DetectorManager" << endreq; + return( StatusCode::FAILURE ); + } + theExpt->addManager(m_manager); + + // Create a symLink to the SiDetectorManager base class + const SiDetectorManager * siDetManager = m_manager; + result = detStore->symLink(m_manager, siDetManager); + if (result.isFailure() ) { + msg(MSG::ERROR) << "Could not make link between SCT_DetectorManager and SiDetectorManager" << endreq; + return( StatusCode::FAILURE ); + } + + } + + // + // LorentzAngleService + // We retrieve it to make sure it is initialized during geometry initialization. + // + if (!m_lorentzAngleSvc.empty()) { + sc = m_lorentzAngleSvc.retrieve(); + if (!sc.isFailure()) { + msg(MSG::INFO) << "Lorentz angle service retrieved: " << m_lorentzAngleSvc << endreq; + } else { + msg(MSG::INFO) << "Could not retrieve Lorentz angle service:" << m_lorentzAngleSvc << endreq; + } + } else { + msg(MSG::INFO) << "Lorentz angle service not requested." << endreq; + } + } + + // Delete unneeded singleton objects + SCT_DataBase::reinit(); + SCT_MaterialManager::reinit(); + + return result; +} + +StatusCode +SCT_DetectorTool::clear(StoreGateSvc* detStore) +{ + SG::DataProxy* _proxy = detStore->proxy(ClassID_traits<InDetDD::SCT_DetectorManager>::ID(),m_manager->getName()); + if(_proxy) { + _proxy->reset(); + m_manager = 0; + } + return StatusCode::SUCCESS; +} + +StatusCode +SCT_DetectorTool::registerCallback( StoreGateSvc* detStore) +{ + + if (m_alignable) { + std::string folderName = "/Indet/Align"; + if (detStore->contains<AlignableTransformContainer>(folderName)) { + if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Registering callback on AlignableTransformContainer with folder " << folderName << endreq; + const DataHandle<AlignableTransformContainer> atc; + return detStore->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool *>(this), atc, folderName); + } else { + msg(MSG::ERROR) << "Unable to register callback on AlignableTransformContainer with folder " + << folderName << ", Alignment disabled!" << endreq; + return StatusCode::FAILURE; + } + } else { + msg(MSG::INFO) << "Alignment disabled. No callback registered" << endreq; + // We return failure otherwise it will try and register + // a GeoModelSvc callback associated with this callback. + + return StatusCode::FAILURE; + } +} + +StatusCode +SCT_DetectorTool::align(IOVSVC_CALLBACK_ARGS_P(I,keys)) +{ + if (!m_manager) { + msg(MSG::WARNING) << "Manager does not exist" << endreq; + return StatusCode::FAILURE; + } + if (m_alignable) { + return m_manager->align(I,keys); + } else { + if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Alignment disabled. No alignments applied" << endreq; + return StatusCode::SUCCESS; + } +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx new file mode 100755 index 00000000000..ebf9e4fefee --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx @@ -0,0 +1,56 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// 14th Aug 2005 S.Mima modified. +// +#include "SCT_GeoModel/SCT_Dogleg.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_Dogleg::SCT_Dogleg(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_Dogleg::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->doglegMaterial()); + m_thickness = parameters->doglegThickness(); + m_length = parameters->doglegLength(); + m_width = parameters->doglegWidth(); +} + +GeoVPhysVol * +SCT_Dogleg::build() +{ + + // Build the Dogleg. Just a simple box. + // Width is in z-direction. + // Length is in phi-direction. + // NB. This is opposite to other elements I use. + + const GeoBox * doglegShape = new GeoBox(0.5*m_thickness, 0.5*m_length, 0.5*m_width); + const GeoLogVol *doglegLog = + new GeoLogVol(getName(), doglegShape, m_material); + GeoPhysVol * dogleg = new GeoPhysVol(doglegLog); + + return dogleg; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx new file mode 100755 index 00000000000..0a56ad8214e --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx @@ -0,0 +1,53 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FSIEndJewel.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_FSIEndJewel::SCT_FSIEndJewel(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FSIEndJewel::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + SCT_MaterialManager materials; + + m_materialName = parameters->fsiEndJewelMaterial(); + m_radialWidth = parameters->fsiEndJewelRadialWidth(); + m_rPhiWidth = parameters->fsiEndJewelRPhiWidth(); + m_length = parameters->fsiEndJewelLength(); +} + +GeoVPhysVol * +SCT_FSIEndJewel::build() +{ + + // Build the barrel FSI end jewel. Just a simple box. + // Length is in z-direction. + SCT_MaterialManager materials; + + const GeoBox * jewelShape = new GeoBox(0.5*m_radialWidth, 0.5*m_rPhiWidth, 0.5*m_length); + m_material = materials.getMaterialForVolume(m_materialName, jewelShape->volume()); + const GeoLogVol *jewelLog = + new GeoLogVol(getName(), jewelShape, m_material); + GeoPhysVol * jewel = new GeoPhysVol(jewelLog); + + return jewel; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx new file mode 100755 index 00000000000..d714b0b5e71 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FSIFibreMask.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_FSIFibreMask::SCT_FSIFibreMask(const std::string & name, int iLayer, double length) + : SCT_SharedComponentFactory(name), m_iLayer(iLayer), m_length(length) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FSIFibreMask::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_materialName = parameters->fsiFibreMaskMaterial(); + m_outerRadius = parameters->supportCylInnerRadius(m_iLayer); + m_innerRadius = m_outerRadius - parameters->fsiFibreMaskDeltaR(); + +} + +GeoVPhysVol * +SCT_FSIFibreMask::build() +{ + // Make the support cyliner. A simple tube. + SCT_MaterialManager materials; + + const GeoTube * fibreMaskShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + m_material = materials.getMaterialForVolume(m_materialName+intToString(m_iLayer), fibreMaskShape->volume()); + const GeoLogVol * fibreMaskLog = new GeoLogVol(getName(), fibreMaskShape, m_material); + + GeoPhysVol * fibreMask = new GeoPhysVol(fibreMaskLog); + + return fibreMask; +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx new file mode 100755 index 00000000000..2866d37face --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +#include "SCT_GeoModel/SCT_FSIHelper.h" +#include "SCT_GeoModel/SCT_DataBase.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include <iostream> + +FSILocation:: FSILocation(std::string name, + double radius, + double phi, + int side) + : m_name(name), + m_radius(radius), + m_phi(phi), + m_side(side) +{} + + +FSIDetails::FSIDetails(const FSILocation * location, + int simType, + const std::string & simTypeString, + const std::string & locationType, + const std::string & actualType) + : m_location(location), + m_simType(simType), + m_simTypeStr(simTypeString), + m_locType(locationType), + m_actualType(actualType) +{} + + +FSIHelper::FSIHelper(SCT_DataBase * rdb) + : m_rdb(rdb) +{ + int numWheels = m_rdb->fwdGeneral()->getInt("NUMWHEELS"); + m_wheelLocMap.resize(numWheels); + fill(); +} + +FSIHelper::~FSIHelper() +{ + std::map<std::string, FSILocation *>::iterator iter; + for (iter = m_locationTypes.begin(); iter != m_locationTypes.end(); ++iter) { + delete iter->second; + } + + for(unsigned int i = 0; i < m_wheelLocMap.size(); i++) { + if (m_wheelLocMap[i]) { + for (unsigned int j = 0; j < m_wheelLocMap[i]->size(); j++) { + delete (*m_wheelLocMap[i])[j]; + } + delete m_wheelLocMap[i]; + } + } +} + + +void +FSIHelper::fill() +{ + // Loop through location types + for (int iLocIndex = 0; iLocIndex < m_rdb->fwdFSILocationSize(); iLocIndex++) { + std::string locType = m_rdb->fwdFSILocation(iLocIndex)->getString("LOCTYPE"); + double radius = m_rdb->fwdFSILocation(iLocIndex)->getDouble("LOCR") * CLHEP::mm; + double rphi = m_rdb->fwdFSILocation(iLocIndex)->getDouble("LOCPHI") * CLHEP::deg; + int side = m_rdb->fwdFSILocation(iLocIndex)->getInt("SIDE"); + FSILocation * location = new FSILocation(locType, radius, rphi, side); + m_locationTypes[locType] = location; + } + + // Loop through all fsi's + for (int index = 0; index < m_rdb->fwdFSISize(); index++) { + unsigned int iWheel = m_rdb->fwdFSI(index)->getInt("WHEEL") - 1; + int simType = m_rdb->fwdFSI(index)->getInt("SIMTYPE"); + std::string simTypeString = m_rdb->fwdFSIType(simType)->getString("TYPENAME"); + int simTypeCheck = m_rdb->fwdFSIType(simType)->getInt("SIMTYPE"); + std::string locationType = m_rdb->fwdFSI(index)->getString("LOCTYPE"); + std::string actualType = m_rdb->fwdFSI(index)->getString("ACTUALTYPE"); + + if (simTypeCheck != simType) std::cout << "Error in simType to index match in table SctFwdFSIType" << std::endl; + + FSILocation * location = m_locationTypes[locationType]; + if (!location) std::cout << "Error filling FSI information. No FSI of type " << locationType << " found" << std::endl; + FSIDetails * fsi = new FSIDetails(location, simType, simTypeString, locationType, actualType); + + if (iWheel >= m_wheelLocMap.size()) + std::cout << "Error in FSIHelper: wheel number is out of range: " << iWheel << std::endl; + + if (!m_wheelLocMap[iWheel]) { + m_wheelLocMap[iWheel] = new std::vector<const FSIDetails *>; + } + m_wheelLocMap[iWheel]->push_back(fsi); + + } +} + + +const std::vector<const FSIDetails *> & +FSIHelper::fsiVector(int iWheel) const +{ + return *(m_wheelLocMap[iWheel]); +} + + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx new file mode 100755 index 00000000000..ed7cdb1a6bd --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx @@ -0,0 +1,53 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FSIScorpion.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_FSIScorpion::SCT_FSIScorpion(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FSIScorpion::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + SCT_MaterialManager materials; + + m_materialName = parameters->fsiScorpionMaterial(); + m_radialWidth = parameters->fsiScorpionRadialWidth(); + m_rPhiWidth = parameters->fsiScorpionRPhiWidth(); + m_length = parameters->fsiScorpionLength(); +} + +GeoVPhysVol * +SCT_FSIScorpion::build() +{ + + // Build the barrel FSI scorpion. Just a simple box. + // Length is in z-direction. + SCT_MaterialManager materials; + + const GeoBox * scorpionShape = new GeoBox(0.5*m_radialWidth, 0.5*m_rPhiWidth, 0.5*m_length); + m_material = materials.getMaterialForVolume(m_materialName, scorpionShape->volume()); + const GeoLogVol *scorpionLog = + new GeoLogVol(getName(), scorpionShape, m_material); + GeoPhysVol * scorpion = new GeoPhysVol(scorpionLog); + + return scorpion; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx new file mode 100755 index 00000000000..dfac1d8135b --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx @@ -0,0 +1,60 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Flange.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_Flange::SCT_Flange(const std::string & name, int iLayer) + : SCT_SharedComponentFactory(name), m_iLayer(iLayer) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_Flange::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_materialName = parameters->flangeMaterial(m_iLayer); + m_length = parameters->flangeDeltaZ(m_iLayer); + m_radialWidth = parameters->flangeDeltaR(m_iLayer); + + if(parameters->isOldGeometry()) { + // Same outer radius as support cylinder + m_outerRadius = parameters->supportCylOuterRadius(m_iLayer); + } + else { + // Outer radius is inner radius of support cylinder + m_outerRadius = parameters->supportCylInnerRadius(m_iLayer); + } + m_innerRadius = m_outerRadius - m_radialWidth; +} + +GeoVPhysVol * +SCT_Flange::build() +{ + // Make the flange. A simple tube. + SCT_MaterialManager materials; + + const GeoTube * flangeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + m_material = materials.getMaterialForVolume(m_materialName, flangeShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol * flangeLog = new GeoLogVol(getName(), flangeShape, m_material); + + GeoPhysVol * flange = new GeoPhysVol(flangeLog); + + return flange; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx new file mode 100755 index 00000000000..5e1d857868f --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx @@ -0,0 +1,283 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Forward.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" +#include "SCT_GeoModel/SCT_ForwardModuleParameters.h" + +#include "SCT_GeoModel/SCT_FwdWheel.h" +#include "SCT_GeoModel/SCT_FwdModule.h" +#include "SCT_GeoModel/SCT_FwdRing.h" +#include "SCT_GeoModel/SCT_FwdRingCooling.h" +#include "SCT_GeoModel/SCT_FwdSupportFrame.h" +#include "SCT_GeoModel/SCT_FwdCoolingPipe.h" +#include "SCT_GeoModel/SCT_FwdPowerTape.h" +#include "SCT_GeoModel/SCT_FwdCylinderServices.h" +#include "SCT_GeoModel/SCT_FwdThermalShieldElement.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "InDetGeoModelUtils/ExtraMaterial.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include <sstream> +#include <cmath> + +SCT_Forward::SCT_Forward(const std::string & name, int ec) + : SCT_UniqueComponentFactory(name), + m_endcap(ec) +{ + getParameters(); + m_logVolume = preBuild(); +} + +SCT_Forward::~SCT_Forward() +{ + for (size_t i = 0; i < m_wheels.size(); i++) delete m_wheels[i]; + for (size_t i = 0; i < m_modules.size(); i++) delete m_modules[i]; +} + +void +SCT_Forward::getParameters() +{ + + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardModuleParameters * moduleParameters = geometryManager()->forwardModuleParameters(); + + //m_numRingTypes = parameters->fwdNumRingTypes(); + m_numModuleTypes = moduleParameters->fwdModuleNumTypes(); + m_numWheels = parameters->fwdNumWheels(); + m_innerRadius = parameters->fwdInnerRadius(); + m_outerRadius = parameters->fwdOuterRadius(); + m_zMin = parameters->fwdZMin(); + m_zMax = parameters->fwdZMax(); + m_trtGapPos = parameters->fwdTrtGapPos(); + m_coolingPipeRadius = parameters->fwdCoolingPipeRadius(); + m_numThermalShieldElements = parameters->fwdNumThermalShieldElements(); + m_cylinderServicesPresent = parameters->fwdCylinderServicePresent(); + + // Outer radius of cylinder services is given by inner radius of OTE + if(m_cylinderServicesPresent) { + for (int iElement = 0; iElement < m_numThermalShieldElements; iElement++){ + if(parameters->fwdThermalShieldMaterial(iElement) == "sct::FwdOTE") { + m_outerRadiusCylinderServices = parameters->fwdThermalShieldInnerRadius(iElement); + } + } + } + + // Length of forward envelope + m_length = m_zMax - m_zMin; + + + // Set numerology + detectorManager()->numerology().setNumDisks(m_numWheels); + + +} + + + +const GeoLogVol * +SCT_Forward::preBuild() +{ + // Create the elements we need for the forward + + // We make all the module types here. There is a outer, middle, truncated middle and inner type module. + for (int iModuleType = 0; iModuleType < m_numModuleTypes; iModuleType++){ + m_modules.push_back(new SCT_FwdModule("FwdModule"+intToString(iModuleType), iModuleType)); + } + + for (int iWheel = 0; iWheel < m_numWheels; iWheel++){ + // Build Wheels + std::ostringstream name; name << "Wheel" << iWheel << ((m_endcap > 0) ? "A" : "C"); + //std::cout << getName() << ", iWheel = " << iWheel << ", " << name.str() << ", m_endcap = " << m_endcap << std::endl; + const SCT_FwdWheel * wheel = new SCT_FwdWheel(name.str(), iWheel, m_modules, m_endcap); + m_wheels.push_back(wheel); + } + + + // Make one end of the Forward tracker + // Tube envelope containing the forward + SCT_MaterialManager materials; + const GeoTube * forwardEnvelopeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + const GeoLogVol * forwardLog = + new GeoLogVol(getName(), forwardEnvelopeShape, materials.gasMaterial()); + + return forwardLog; +} + +GeoVPhysVol * +SCT_Forward::build(SCT_Identifier id) const +{ + GeoFullPhysVol * forward = new GeoFullPhysVol(m_logVolume); + + for (int iWheel = 0; iWheel < m_numWheels; iWheel++){ + + // Build Wheels + // std::cout << "iWheel = " << iWheel << std::endl; + //std::ostringstream name; name << "Wheel" << iWheel << ((m_endcap > 0) ? "A" : "C"); + //const SCT_FwdWheel * wheel = new SCT_FwdWheel(name.str(), iWheel, m_modules, m_endcap); + //m_wheels.push_back(wheel); + + const SCT_FwdWheel * wheel = m_wheels[iWheel]; + std::ostringstream wheelName; wheelName << "Wheel#" << iWheel; + double zpos = wheel->zPosition() - zCenter(); + // std::cout << "Adding wheel " << iWheel << ", z = " << m_wheels[iWheel]->zPosition() + // << " at " << zpos << ", thickness = " << wheel->thickness() << std::endl; + forward->add(new GeoNameTag(wheelName.str())); + forward->add(new GeoIdentifierTag(iWheel)); + GeoAlignableTransform * transform = new GeoAlignableTransform(HepGeom::TranslateZ3D(zpos)); + forward->add(transform); + id.setLayerDisk(iWheel); + GeoVPhysVol * wheelPV = wheel->build(id); + forward->add(wheelPV); + + // Store the alignable transform + detectorManager()->addAlignableTransform(2, id.getWaferId(), transform, wheelPV); + } + + // + // Place SupportFrame + // + SCT_FwdSupportFrame supportFrame("SupportFrame"); + double supportFrameZPos = supportFrame.zPosition() - zCenter(); + forward->add(new GeoTransform(HepGeom::TranslateZ3D(supportFrameZPos))); + forward->add(supportFrame.getVolume()); + + // Make and Place Cylinder Services + + if(m_cylinderServicesPresent) { + + // New phi-dependent services + SCT_FwdCylinderServices cylinderServices("CylinderServices", + supportFrame.outerRadius(), + m_outerRadiusCylinderServices, + supportFrame.length()); + forward->add(new GeoTransform(HepGeom::TranslateZ3D(supportFrameZPos))); + forward->add(cylinderServices.getVolume()); + + } else { + + // Old cylindrical services + // + // Make cooling pipes. These extend from the wheel to the TRT Gap. + // + { + // End position of the pipes. + double endPos = m_trtGapPos; + + // Calculate radius to start placing cooling pipes. This is equal to the + // outer radius of the support frame + the pipe radius (The pipe radius is to just + // give a small gap - it is not really necessary) + double innerRadiusCooling = supportFrame.outerRadius() + m_coolingPipeRadius; + + // Inner radius of cylinder representing pipes. Gets incremented for each wheel. + double rStart = innerRadiusCooling; + + for (int iWheel = 0; iWheel < m_numWheels; iWheel++){ + // Start position of the pipes. + double startPos = m_wheels[iWheel]->zPosition(); + + // Assume one cooling circuit per quadrant of each ring. ie 8 pipes per ring. + int numPipes = 8 * m_wheels[iWheel]->numRings(); + + // Label Cooling pipe with W# at end of string + // std::ostringstream label; label << "CoolingPipeW" << iWheel + 1; + //SCT_FwdCoolingPipe * coolingPipe = new SCT_FwdCoolingPipe(label.str(), numPipes, rStart, startPos, endPos); + SCT_FwdCoolingPipe coolingPipe("OffDiskCoolingPipeW"+intToString(iWheel), + numPipes, rStart, startPos, endPos); + //std::cout << "Cooling pipe rmin,rmax: " << coolingPipe.innerRadius() << ", " << coolingPipe.outerRadius() << std::endl; + + // Place the cooling pipes + double coolingPipeZPos = coolingPipe.zPosition() - zCenter(); + forward->add(new GeoTransform(HepGeom::TranslateZ3D(coolingPipeZPos))); + forward->add(coolingPipe.getVolume()); + + // Set rStart for next cooling pipe equal to outer radius of this cooling pipe. + rStart = coolingPipe.outerRadius(); + + } + } + + // + // Make Power Tapes. These extend from the wheel to the TRT Gap. + // + { + + // End position of the power tapes. + double endPos = m_trtGapPos; + + // Calculate radius to start placing power tapes. This is half way bewteen outer radius + // of support fram and outer radius of forward envelope. + // The -1 mm is to avoid a clash with the thermal shield. + double innerRadiusPowerTapes = 0.5*(supportFrame.outerRadius() + m_outerRadius) - 1*CLHEP::mm; + + // Inner radius of cylinder representing power tapes. Gets incremented for each wheel. + double rStart = innerRadiusPowerTapes; + + for (int iWheel = 0; iWheel < m_numWheels; iWheel++){ + + // Start position of the power tapes. + double startPos = m_wheels[iWheel]->zPosition(); + + // Get total number of modules in wheel + int numModules = m_wheels[iWheel]->totalModules(); + + // Label power tape with W# at end of string + //std::ostringstream label; label << "PowerTapeW" << iWheel + 1; + //SCT_FwdPowerTape * powerTape = new SCT_FwdPowerTape(label.str(), numModules, rStart, startPos, endPos); + SCT_FwdPowerTape powerTape("OffDiskPowerTapeW"+intToString(iWheel), + numModules, rStart, startPos, endPos); + //std::cout << "PowerTape rmin,rmax: " << powerTape.innerRadius() << ", " << powerTape.outerRadius() << std::endl; + + + // Place Power Tapes + double powerTapeZPos = powerTape.zPosition() - zCenter(); + forward->add(new GeoTransform(HepGeom::TranslateZ3D(powerTapeZPos))); + forward->add(powerTape.getVolume()); + + // Set rStart for next power tape equal to outer radius of this power tape. + rStart = powerTape.outerRadius(); + } // end loop over wheels + } + } + + // + // Place Thermal Shield Elements + // + for (int iElement = 0; iElement < m_numThermalShieldElements; iElement++){ + SCT_FwdThermalShieldElement thermalShieldElement("FwdThermalShieldElement"+intToString(iElement), + iElement); + double elementZPos = thermalShieldElement.zPosition() - zCenter(); + forward->add(new GeoTransform(HepGeom::TranslateZ3D(elementZPos))); + forward->add(thermalShieldElement.getVolume()); + } + + // Extra Material + InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager()); + xMat.add(forward, "SCTEndcap", zCenter()); + if (m_endcap > 0) { + xMat.add(forward, "SCTEndcapA", zCenter()); + } else { + xMat.add(forward, "SCTEndcapC", zCenter()); + } + + + return forward; +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx new file mode 100755 index 00000000000..639f97ce487 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx @@ -0,0 +1,391 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_ForwardModuleParameters.h" + +#include "SCT_GeoModel/SCT_DataBase.h" + +#include "RDBAccessSvc/IRDBRecordset.h" +#include "RDBAccessSvc/IRDBRecord.h" + +#include "CLHEP/Units/SystemOfUnits.h" + +#include <cmath> + + +SCT_ForwardModuleParameters::SCT_ForwardModuleParameters() +{ + m_rdb = SCT_DataBase::instance(); +} + +// +// Forward Sensor +// +int +SCT_ForwardModuleParameters::fwdSensorNumWafers(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getInt("NUMWAFERS"); +} + +double +SCT_ForwardModuleParameters::fwdSensorThickness(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("THICKNESS") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorInnerWidthNear(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("INNERWIDTHNEAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorInnerWidthFar(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("INNERWIDTHFAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorOuterWidthNear(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("OUTERWIDTHNEAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorOuterWidthFar(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("OUTERWIDTHFAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorLengthNear(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("LENGTHNEAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorLengthFar(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("LENGTHFAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorRadiusNear(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("RADIUSNEAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorRadiusFar(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("RADIUSFAR") * CLHEP::mm; +} + +std::string +SCT_ForwardModuleParameters::fwdSensorMaterialNear(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getString("MATERIALNEAR"); +} + +std::string +SCT_ForwardModuleParameters::fwdSensorMaterialFar(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getString("MATERIALFAR"); +} + +bool +SCT_ForwardModuleParameters::fwdSensorActiveNear(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getInt("ACTIVENEAR"); +} + +bool +SCT_ForwardModuleParameters::fwdSensorActiveFar(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getInt("ACTIVEFAR"); +} + +double +SCT_ForwardModuleParameters::fwdSensorActiveHalfLengthNear(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("ACTIVEHALFLENGTHNEAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorActiveHalfLengthFar(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("ACTIVEHALFLENGTHFAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSensorAngularPitch(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getDouble("ANGULARPITCH") * CLHEP::radian; +} + +int +SCT_ForwardModuleParameters::fwdSensorNumStrips(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getInt("NUMSTRIPS"); +} + +int +SCT_ForwardModuleParameters::fwdSensorNumReadoutStrips(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getInt("NUMREADOUTSTRIPS"); +} + +int +SCT_ForwardModuleParameters::fwdSensorStripShift(int iModuleType) const +{ + return m_rdb->fwdSensor(iModuleType)->getInt("STRIPSHIFT"); +} + + +// +// Forward Hybrid +// +double +SCT_ForwardModuleParameters::fwdHybridThickness() const +{ + return m_rdb->fwdHybrid()->getDouble("THICKNESS") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdHybridInnerWidth() const +{ + return m_rdb->fwdHybrid()->getDouble("INNERWIDTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdHybridOuterWidth() const +{ + return m_rdb->fwdHybrid()->getDouble("OUTERWIDTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdHybridLength() const +{ + return m_rdb->fwdHybrid()->getDouble("LENGTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdHybridLengthToCorner() const +{ + return m_rdb->fwdHybrid()->getDouble("LENGTHTOCORNER") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdHybridMountPointToInnerEdge() const +{ + return m_rdb->fwdHybrid()->getDouble("MOUNTPOINTTOINEDGE") * CLHEP::mm; +} + +std::string +SCT_ForwardModuleParameters::fwdHybridMaterial() const +{ + return m_rdb->fwdHybrid()->getString("MATERIAL"); +} + +// +// Forward Spine +// +double +SCT_ForwardModuleParameters::fwdSpineThickness(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("THICKNESS") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSpineWidth(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("WIDTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSpineEndToModuleCenter(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("ENDTOMODULECENTER") * CLHEP::mm; +} + + +double +SCT_ForwardModuleParameters::fwdSpineEndLocatorToEndMount(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("ENDLOCATORTOENDMOUNT") * CLHEP::mm; +} + + +std::string +SCT_ForwardModuleParameters::fwdSpineMaterial(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getString("MATERIAL"); +} + +// +// Forward SubSpine +// + +double +SCT_ForwardModuleParameters::fwdSubSpineInnerWidth(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("SUBINNERWIDTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSubSpineInnerLength(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("SUBINNERLENGTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSubSpineInnerRefDist(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("SUBINNERREFDIST") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSubSpineMiddleWidth(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("SUBMIDDLEWIDTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSubSpineMiddleLength(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("SUBMIDDLELENGTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSubSpineMiddleRefDist(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("SUBMIDDLEREFDIST") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSubSpineOuterWidth(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("SUBOUTERWIDTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSubSpineOuterLength(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("SUBOUTERLENGTH") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdSubSpineOuterRefDist(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getDouble("SUBOUTERREFDIST") * CLHEP::mm; +} + +std::string +SCT_ForwardModuleParameters::fwdSubSpineMaterial(int iModuleType) const +{ + return m_rdb->fwdSpine(iModuleType)->getString("SUBMATERIAL"); +} + + + +// +// Forward Module +// +int +SCT_ForwardModuleParameters::fwdModuleNumTypes() const +{ + return m_rdb->fwdModuleSize(); +} + +double +SCT_ForwardModuleParameters::fwdModuleStereoAngle(int iModuleType) const +{ + return m_rdb->fwdModule(iModuleType)->getDouble("STEREOANGLE") * CLHEP::milliradian; +} + +int +SCT_ForwardModuleParameters::fwdModuleStereoUpperSign(int iModuleType) const +{ + return m_rdb->fwdModule(iModuleType)->getInt("STEREOUPPERSIGN"); +} + +int +SCT_ForwardModuleParameters::fwdModuleUpperSideNumber(int iModuleType) const +{ + // Old geometries have lower module side = 0 and upper = 1 + if (m_rdb->fwdModule(iModuleType)->isFieldNull("SIDEUPPER")) { + return 1; + } + return m_rdb->fwdModule(iModuleType)->getInt("SIDEUPPER"); +} + +double +SCT_ForwardModuleParameters::fwdModuleGlueThickness(int iModuleType) const +{ + return m_rdb->fwdModule(iModuleType)->getDouble("GLUETHICKNESS") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdModuleMountPoint(int iModuleType) const +{ + return m_rdb->fwdModule(iModuleType)->getDouble("MOUNTPOINT") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdModuleDistBtwMountPoints(int iModuleType) const +{ + return m_rdb->fwdModule(iModuleType)->getDouble("DISTBTWMOUNTPOINTS") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdModuleHybridEdgeToSpine(int iModuleType) const +{ + return m_rdb->fwdModule(iModuleType)->getDouble("HYBRIDEDGETOSPINE")*CLHEP::mm; +} + +bool +SCT_ForwardModuleParameters::fwdHybridIsOnInnerEdge(int iModuleType) const +{ + return m_rdb->fwdModule(iModuleType)->getInt("HYBRIDISONINNEREDGE"); +} + +// +// Module Connectors +// +bool +SCT_ForwardModuleParameters::fwdModuleConnectorPresent() const +{ + if(m_rdb->fwdModuleConnectorTable()->size() > 0) { + return true; + } + else { + return false; + } +} + +double +SCT_ForwardModuleParameters::fwdModuleConnectorDeltaR() const +{ + return m_rdb->fwdModuleConnector()->getDouble("DELTAR") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdModuleConnectorRPhi() const +{ + return m_rdb->fwdModuleConnector()->getDouble("RPHI") * CLHEP::mm; +} + +double +SCT_ForwardModuleParameters::fwdModuleConnectorThickness() const +{ + return m_rdb->fwdModuleConnector()->getDouble("THICKNESS") * CLHEP::mm; +} + +std::string +SCT_ForwardModuleParameters::fwdModuleConnectorMaterial() const +{ + return m_rdb->fwdModuleConnector()->getString("MATERIAL"); +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx new file mode 100755 index 00000000000..aee7cfb42ce --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx @@ -0,0 +1,776 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_DataBase.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "RDBAccessSvc/IRDBRecord.h" + +#include "SCT_GeoModel/SCT_FSIHelper.h" + +#include "CLHEP/Units/SystemOfUnits.h" + +#include <iostream> +#include <cmath> + +SCT_ForwardParameters::SCT_ForwardParameters() + : m_fsiHelper(0) +{ + m_rdb = SCT_DataBase::instance(); +} + +SCT_ForwardParameters::~SCT_ForwardParameters() +{ + delete m_fsiHelper; +} + +// +// Forward Ring +// +int +SCT_ForwardParameters::fwdRingNumModules(int iRing) const +{ + return m_rdb->fwdRing(iRing)->getInt("NUMMODULES"); +} + +double +SCT_ForwardParameters::fwdRingModuleStagger(int iRing) const +{ + return m_rdb->fwdRing(iRing)->getDouble("MODULESTAGGER") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdRingPhiOfRefModule(int iRing) const +{ + return m_rdb->fwdRing(iRing)->getDouble("PHIOFREFMODULE") * CLHEP::deg; +} + + +int +SCT_ForwardParameters::fwdRingUsualRingSide(int iRing) const +{ + return m_rdb->fwdRing(iRing)->getInt("USUALRINGSIDE"); +} + +double +SCT_ForwardParameters::fwdRingDistToDiscCenter(int iRing) const +{ + return m_rdb->fwdRing(iRing)->getDouble("RINGTODISCCENTER") * CLHEP::mm; +} + + + +// +// Forward Wheel +// +double +SCT_ForwardParameters::fwdWheelZPosition(int iWheel) const +{ + return m_rdb->fwdWheel(iWheel)->getDouble("ZPOSITION") * CLHEP::mm; +} + +// Returns +/-1 +int +SCT_ForwardParameters::fwdWheelStereoType(int iWheel) const +{ + return m_rdb->fwdWheel(iWheel)->getInt("STEREOTYPE"); +} + +int +SCT_ForwardParameters::fwdWheelNumRings(int iWheel) const +{ + return m_rdb->fwdWheel(iWheel)->getInt("NUMRINGS"); +} + + +int +SCT_ForwardParameters::fwdWheelRingMapIndex(int iWheel, int iRing, int ec) const +{ + // In SCT_GeoModel the wheel number is generally 0-8. + // In the table "SctFwdWheelRingMap" the wheel number is 1 to 9. + + // The postive and negative endcap are not identical. If the negative + // endcap is different from the positive endcap there will be in an entry + // with the wheel number negative. For the negative endcap we first look for + // an entry with -ve wheel number. If no entry wee try the positive endcap. + + int iWheelDB = iWheel + 1; + + // If it is in the -ve endcap we first look for an entry with -ve wheel number + int index = -1; + if (ec < 0) { + index = fwdWheelRingMapIndexDB(-iWheelDB, iRing); + if (index >= 0) return index; + } + // Look for it in the positive endcap + index = fwdWheelRingMapIndexDB(iWheelDB, iRing); + if (index < 0) { + std::cout << "Wheel (numbering from 1)" << iWheelDB << ", Ring " << iRing + << " not in table SctFwdWheelRingMap" << std::endl; + } + return index; +} + +// Get index in SctFwdWheelRing table for wheel/ring combination +// It just loops through the table until it finds a match. +// This is not particularly efficient but its fine for the purpose. +// Returns -1 if not found. + +int +SCT_ForwardParameters::fwdWheelRingMapIndexDB(int iWheelDB, int iRing) const +{ + + for (int i=0; i < m_rdb->fwdWheelRingMapSize(); i++) { + if ((m_rdb->fwdWheelRingMap(i)->getInt("WHEELNUM") == iWheelDB) && + (m_rdb->fwdWheelRingMap(i)->getInt("RINGNUM") == iRing)) + { + return i; + break; + } + } + return -1; +} + +int +SCT_ForwardParameters::fwdRingStaggerOfRefModule(int iWheel, int iRing, int ec) const +{ + int index = fwdWheelRingMapIndex(iWheel, iRing, ec); + if (index < 0) return 0; + return m_rdb->fwdWheelRingMap(index)->getInt("STAGGEROFREFMODULE"); +} + + +int +SCT_ForwardParameters::fwdWheelRingSide(int iWheel, int iRing, int ec) const +{ + int index = fwdWheelRingMapIndex(iWheel, iRing, ec); + if (index < 0) return 0; + return m_rdb->fwdWheelRingMap(index)->getInt("SIDE"); +} + + +int +SCT_ForwardParameters::fwdWheelModuleType(int iWheel, int iRing, int ec) const +{ + int index = fwdWheelRingMapIndex(iWheel, iRing, ec); + if (index < 0) return 0; + return m_rdb->fwdWheelRingMap(index)->getInt("MODULETYPE"); +} + + +// +// Forward DiscSupport +// + +double +SCT_ForwardParameters::fwdDiscSupportInnerRadius() const +{ + return m_rdb->fwdDiscSupport()->getDouble("INNERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdDiscSupportOuterRadius() const +{ + return m_rdb->fwdDiscSupport()->getDouble("OUTERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdDiscSupportThickness() const +{ + return m_rdb->fwdDiscSupport()->getDouble("THICKNESS") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdDiscSupportMaterial() const +{ + return m_rdb->fwdDiscSupport()->getString("MATERIAL"); +} + +// +// Forward PatchPanel +// +int +SCT_ForwardParameters::fwdNumPatchPanelLocs() const +{ + return m_rdb->fwdPatchPanelLocSize(); +} + +int +SCT_ForwardParameters::fwdPatchPanelType(int iLoc) const +{ + return m_rdb->fwdPatchPanelLoc(iLoc)->getInt("TYPENUM"); +} + +double +SCT_ForwardParameters::fwdPatchPanelLocAngle(int iLoc) const +{ + return m_rdb->fwdPatchPanelLoc(iLoc)->getDouble("LOCANGLE") * CLHEP::degree; +} + +bool +SCT_ForwardParameters::fwdPatchPanelRepeatQuadrant(int iLoc) const +{ + return m_rdb->fwdPatchPanelLoc(iLoc)->getInt("REPEATQUADRANT"); +} + +int +SCT_ForwardParameters::fwdNumPatchPanelTypes() const +{ + return m_rdb->fwdPatchPanelSize(); +} + +double +SCT_ForwardParameters::fwdPatchPanelThickness(int iType) const +{ + return m_rdb->fwdPatchPanel(iType)->getDouble("THICKNESS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdPatchPanelMidRadius(int iType) const +{ + return m_rdb->fwdPatchPanel(iType)->getDouble("MIDRADIUS") * CLHEP::mm; +} + + +double +SCT_ForwardParameters::fwdPatchPanelDeltaR(int iType) const +{ + return m_rdb->fwdPatchPanel(iType)->getDouble("DELTAR") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdPatchPanelRPhi(int iType) const +{ + return m_rdb->fwdPatchPanel(iType)->getDouble("RPHI") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdPatchPanelMaterial(int iType) const +{ + return m_rdb->fwdPatchPanel(iType)->getString("MATERIAL"); +} + +// +// Forward PatchPanel Connector +// +bool +SCT_ForwardParameters::fwdPPConnectorPresent() const +{ + if (m_rdb->fwdPPCoolingSize() > 0) { + return true; + } + else { + return false; + } +} + +double +SCT_ForwardParameters::fwdPPConnectorThickness() const +{ + return m_rdb->fwdPPConnector()->getDouble("THICKNESS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdPPConnectorDeltaR() const +{ + return m_rdb->fwdPPConnector()->getDouble("DELTAR") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdPPConnectorRPhi() const +{ + return m_rdb->fwdPPConnector()->getDouble("RPHI") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdPPConnectorMaterial() const +{ + return m_rdb->fwdPPConnector()->getString("MATERIAL"); +} + +// +// Forward PatchPanel Cooling +// +bool +SCT_ForwardParameters::fwdPPCoolingPresent() const +{ + if (m_rdb->fwdPPCoolingSize() > 0) { + return true; + } + else { + return false; + } +} + +double +SCT_ForwardParameters::fwdPPCoolingThickness() const +{ + return m_rdb->fwdPPCooling()->getDouble("THICKNESS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdPPCoolingDeltaR() const +{ + return m_rdb->fwdPPCooling()->getDouble("DELTAR") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdPPCoolingRPhi() const +{ + return m_rdb->fwdPPCooling()->getDouble("RPHI") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdPPCoolingMaterial() const +{ + return m_rdb->fwdPPCooling()->getString("MATERIAL"); +} + +// +// Cooling Block +// +int +SCT_ForwardParameters::fwdCoolingBlockHiLo(int iType) const +{ + return m_rdb->fwdCoolingBlock(iType)->getInt("HILO"); +} + +int +SCT_ForwardParameters::fwdCoolingBlockMainOrSecondary(int iType) const +{ + // true is main, false is secondary + return m_rdb->fwdCoolingBlock(iType)->getInt("MAINSECONDARY"); +} + +double +SCT_ForwardParameters::fwdCoolingBlockDeltaR(int iType) const +{ + return m_rdb->fwdCoolingBlock(iType)->getDouble("DELTAR") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdCoolingBlockRPhi(int iType) const +{ + return m_rdb->fwdCoolingBlock(iType)->getDouble("RPHI") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdCoolingBlockThickness(int iType) const +{ + return m_rdb->fwdCoolingBlock(iType)->getDouble("THICKNESS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdCoolingBlockOffsetFromDisc(int iType) const +{ + return m_rdb->fwdCoolingBlock(iType)->getDouble("OFFSETFROMDISC") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdCoolingBlockMaterial(int iType) const +{ + return m_rdb->fwdCoolingBlock(iType)->getString("MATERIAL"); +} + + +// +// Forward DiscPowerTape +// +double +SCT_ForwardParameters::fwdDiscPowerTapeInnerRadius(int iRing) const +{ + return m_rdb->fwdRingServices(iRing)->getDouble("POWERTAPEINNERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdDiscPowerTapeOuterRadius(int iRing) const +{ + return m_rdb->fwdRingServices(iRing)->getDouble("POWERTAPEOUTERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdDiscPowerTapeThickness(int iRing) const +{ + return m_rdb->fwdRingServices(iRing)->getDouble("POWERTAPETHICKNESS") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdDiscPowerTapeMaterial(int iRing) const +{ + return m_rdb->fwdRingServices(iRing)->getString("POWERTAPEMATERIAL"); +} + + + +// +// Forward RingCooling +// +double +SCT_ForwardParameters::fwdRingCoolingInnerRadius(int iRing) const +{ + return m_rdb->fwdRingServices(iRing)->getDouble("COOLINGINNERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdRingCoolingOuterRadius(int iRing) const +{ + return m_rdb->fwdRingServices(iRing)->getDouble("COOLINGOUTERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdRingCoolingThickness(int iRing) const +{ + return m_rdb->fwdRingServices(iRing)->getDouble("COOLINGTHICKNESS") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdRingCoolingMaterial(int iRing) const +{ + return m_rdb->fwdRingServices(iRing)->getString("COOLINGMATERIAL"); +} + +// +// Forward Disc Fixation +// +bool +SCT_ForwardParameters::fwdDiscFixationPresent() const +{ + if (m_rdb->fwdDiscFixationTable()->size() > 0) { + return true; + } + else { + return false; + } +} + +double +SCT_ForwardParameters::fwdDiscFixationThickness() const +{ + return m_rdb->fwdDiscFixation()->getDouble("THICKNESS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdDiscFixationRadius() const +{ + return m_rdb->fwdDiscFixation()->getDouble("RADIUS") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdDiscFixationMaterial() const +{ + return m_rdb->fwdDiscFixation()->getString("MATERIAL"); +} + +// +// Forward SupportFrame +// +double +SCT_ForwardParameters::fwdSupportFrameRadialThickness() const +{ + return m_rdb->fwdServices()->getDouble("SUPPORTFRAMEDELTAR") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdSupportFrameInnerRadius() const +{ + return m_rdb->fwdServices()->getDouble("SUPPORTFRAMEINNERRAD") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdSupportFrameZMin() const +{ + return m_rdb->fwdServices()->getDouble("SUPPORTFRAMEZMIN") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdSupportFrameZMax() const +{ + return m_rdb->fwdServices()->getDouble("SUPPORTFRAMEZMAX") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdSupportFrameMaterial() const +{ + return m_rdb->fwdServices()->getString("SUPPORTFRAMEMATERIAL"); +} + +// +// Forward CoolingPipe +// +double +SCT_ForwardParameters::fwdCoolingPipeRadius() const +{ + return m_rdb->fwdServices()->getDouble("COOLINGPIPERADIUS") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdCoolingPipeMaterial() const +{ + return m_rdb->fwdServices()->getString("COOLINGPIPEMATERIAL"); +} + +// +// Forward PowerTape +// +double +SCT_ForwardParameters::fwdPowerTapeCrossSectArea() const +{ + return m_rdb->fwdServices()->getDouble("POWERTAPECROSSSECT") * CLHEP::mm2; +} + + +std::string +SCT_ForwardParameters::fwdPowerTapeMaterial() const +{ + return m_rdb->fwdServices()->getString("POWERTAPEMATERIAL"); +} + +// +// FSI +// +int +SCT_ForwardParameters::fwdFSINumGeomTypes() const +{ + return m_rdb->fwdFSITypeSize(); +} + +double +SCT_ForwardParameters::fwdFSIGeomDeltaR(int iType) const +{ + return m_rdb->fwdFSIType(iType)->getDouble("DELTAR") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdFSIGeomRPhi(int iType) const +{ + return m_rdb->fwdFSIType(iType)->getDouble("RPHI") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdFSIGeomThickness(int iType) const +{ + // Fix for SCT-DC3-03. May be removed when ATLAS-DC3-07 is obsolete. + if (iType == 0 && m_rdb->versionTag() == "SCT-DC3-03") return 26*CLHEP::mm; + return m_rdb->fwdFSIType(iType)->getDouble("THICKNESS") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdFSIGeomMaterial(int iType) const +{ + return m_rdb->fwdFSIType(iType)->getString("MATERIAL"); +} + +double +SCT_ForwardParameters::fwdFSIGeomZOffset(int iType) const +{ + // Fix for SCT-DC3-03. May be removed when ATLAS-DC3-07 is obsolete. + if (iType == 0 && m_rdb->versionTag() == "SCT-DC3-03") return 22*CLHEP::mm; + return m_rdb->fwdFSIType(iType)->getDouble("ZOFFSET") * CLHEP::mm; +} + + +const FSIHelper & +SCT_ForwardParameters::fsiHelper() const +{ + if (!m_fsiHelper) m_fsiHelper = new FSIHelper(m_rdb); + return *m_fsiHelper; +} + + +const std::vector<const FSIDetails *> & +SCT_ForwardParameters::fsiVector(int iWheel) const +{ + return fsiHelper().fsiVector(iWheel); +} + + +// +// Forward Cylinder Services +// +bool +SCT_ForwardParameters::fwdCylinderServicePresent() const +{ + if (m_rdb->fwdCylServSize() > 0) { + return true; + } + else { + return false; + } +} + +int +SCT_ForwardParameters::fwdNumCylinderServiceLocs() const +{ + + return m_rdb->fwdCylServLocSize(); +} + +std::string +SCT_ForwardParameters::fwdCylinderServiceLocName(int iLoc) const +{ + return m_rdb->fwdCylServLoc(iLoc)->getString("NAME"); +} + +double +SCT_ForwardParameters::fwdCylinderServiceLocAngle(int iLoc) const +{ + return m_rdb->fwdCylServLoc(iLoc)->getDouble("LOCANGLE") * CLHEP::degree; +} + +int +SCT_ForwardParameters::fwdNumCylinderServiceTypes() const +{ + return m_rdb->fwdCylServSize(); +} + +std::string +SCT_ForwardParameters::fwdCylinderServiceName(int iType) const +{ + return m_rdb->fwdCylServ(iType)->getString("NAME"); +} + +std::string +SCT_ForwardParameters::fwdCylinderServiceMaterial(int iType) const +{ + return m_rdb->fwdCylServ(iType)->getString("MATERIAL"); +} + +double +SCT_ForwardParameters::fwdCylinderServiceDeltaR(int iType) const +{ + return m_rdb->fwdCylServ(iType)->getDouble("DELTAR") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdCylinderServiceRPhi(int iType) const +{ + return m_rdb->fwdCylServ(iType)->getDouble("RPHI") * CLHEP::mm; +} + +// +// Forward ThermalShieldElement +// +int +SCT_ForwardParameters::fwdNumThermalShieldElements() const +{ + return m_rdb->fwdThermalShieldSize(); +} + +std::string +SCT_ForwardParameters::fwdThermalShieldMaterial(int iElement) const +{ + return m_rdb->fwdThermalShield(iElement)->getString("MATERIAL"); +} + +double +SCT_ForwardParameters::fwdThermalShieldInnerRadius(int iElement) const +{ + return m_rdb->fwdThermalShield(iElement)->getDouble("INNERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdThermalShieldOuterRadius(int iElement) const +{ + return m_rdb->fwdThermalShield(iElement)->getDouble("OUTERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdThermalShieldZMin(int iElement) const +{ + return m_rdb->fwdThermalShield(iElement)->getDouble("ZMIN") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdThermalShieldZMax(int iElement) const +{ + return m_rdb->fwdThermalShield(iElement)->getDouble("ZMAX") * CLHEP::mm; +} + + +// +// Forward General +// +int +SCT_ForwardParameters::fwdNumWheels() const +{ + return m_rdb->fwdGeneral()->getInt("NUMWHEELS"); +} + +double +SCT_ForwardParameters::fwdInnerRadius() const +{ + return m_rdb->fwdGeneral()->getDouble("INNERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdOuterRadius() const +{ + return m_rdb->fwdGeneral()->getDouble("OUTERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdZMin() const +{ + return m_rdb->fwdGeneral()->getDouble("ZMIN") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdZMax() const +{ + return m_rdb->fwdGeneral()->getDouble("ZMAX") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdTrtGapPos() const +{ + return m_rdb->fwdGeneral()->getDouble("TRTGAPPOS") * CLHEP::mm; +} + +// +// OptoHarness +// +bool +SCT_ForwardParameters::fwdOptoHarnessPresent() const +{ + if (m_rdb->fwdOptoHarnessTable()->size() > 0) { + return true; + } + else { + return false; + } +} + +int +SCT_ForwardParameters::fwdOptoHarnessDiscType(int index) const +{ + return m_rdb->fwdOptoHarness(index)->getInt("DISCTYPE"); +} + +double +SCT_ForwardParameters::fwdOptoHarnessInnerRadius(int index) const +{ + return m_rdb->fwdOptoHarness(index)->getDouble("INNERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdOptoHarnessOuterRadius(int index) const +{ + return m_rdb->fwdOptoHarness(index)->getDouble("OUTERRADIUS") * CLHEP::mm; +} + +double +SCT_ForwardParameters::fwdOptoHarnessThickness(int index) const +{ + return m_rdb->fwdOptoHarness(index)->getDouble("THICKNESS") * CLHEP::mm; +} + +std::string +SCT_ForwardParameters::fwdOptoHarnessMaterial(int index) const +{ + return m_rdb->fwdOptoHarness(index)->getString("MATERIAL"); +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx new file mode 100755 index 00000000000..f8953604da0 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx @@ -0,0 +1,68 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdCoolingBlock.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_FwdCoolingBlock::SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary) + : SCT_SharedComponentFactory(name), m_hiLo(hiLo), m_mainSec(mainOrSecondary) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdCoolingBlock::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_coolingBlockIndex = -1; + for (int i = 0; i < 4; i++){ + if (parameters->fwdCoolingBlockHiLo(i) == m_hiLo && parameters->fwdCoolingBlockMainOrSecondary(i) == m_mainSec) { + m_coolingBlockIndex = i; + } + } + + if (m_coolingBlockIndex < 0){ + std::cout << "SCT_FwdRing: ERROR. Cooling block type is missing. HiLo = " << m_hiLo + << ", MainSecondary = " << m_mainSec << std::endl; + // Will crash or give unpredictable results + } + + m_materialName = parameters->fwdCoolingBlockMaterial(m_coolingBlockIndex); + m_thickness = parameters->fwdCoolingBlockThickness(m_coolingBlockIndex); + m_deltaR = parameters->fwdCoolingBlockDeltaR(m_coolingBlockIndex); + m_rphi = parameters->fwdCoolingBlockRPhi(m_coolingBlockIndex); + m_offset = parameters->fwdCoolingBlockOffsetFromDisc(m_coolingBlockIndex); + + +} + +GeoVPhysVol * +SCT_FwdCoolingBlock::build() +{ + + // Build the CoolingBlock. Just a simple box. + + SCT_MaterialManager materials; + + const GeoBox * coolingBlockShape = new GeoBox(0.5*m_deltaR, 0.5*m_rphi, 0.5*m_thickness); + m_material = materials.getMaterialForVolume(m_materialName, coolingBlockShape->volume()); + const GeoLogVol *coolingBlockLog = + new GeoLogVol(getName(), coolingBlockShape, m_material); + GeoPhysVol * coolingBlock = new GeoPhysVol(coolingBlockLog); + + return coolingBlock; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx new file mode 100755 index 00000000000..1348dd44404 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx @@ -0,0 +1,68 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdCoolingPipe.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include <cmath> + +inline double sqr(double x) {return x * x;} + +SCT_FwdCoolingPipe::SCT_FwdCoolingPipe(const std::string & name, + int numPipes, + double innerRadius, + double startPos, + double endPos) + : SCT_SharedComponentFactory(name), m_numPipes(numPipes), m_innerRadius(innerRadius) +{ + m_length = std::abs(endPos - startPos); + m_zPosition = 0.5 * (startPos + endPos); + + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdCoolingPipe::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->fwdCoolingPipeMaterial()); + m_pipeRadius = parameters->fwdCoolingPipeRadius(); +} + +GeoVPhysVol * +SCT_FwdCoolingPipe::build() +{ + // Calculate the dimensions. + // area = CLHEP::pi*(pipeRadius)^2 * numPipes + // also area = 2*CLHEP::pi*r_ave*delta_r approx= 2 * CLHEP::pi * rMin * delta_r + // solve for delta_r + // m_thickness = delta_r + + double area = CLHEP::pi * sqr(m_pipeRadius) * m_numPipes; + m_thickness = area/(2. * CLHEP::pi * m_innerRadius); + m_outerRadius = m_innerRadius + m_thickness; + + + // Make the support disk. A simple tube. + const GeoTube * pipeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + const GeoLogVol * pipeLog = new GeoLogVol(getName(), pipeShape, m_material); + + GeoPhysVol * pipe = new GeoPhysVol(pipeLog); + + return pipe; +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx new file mode 100755 index 00000000000..efa2a8c3b86 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx @@ -0,0 +1,241 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdCylinderServices.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" + +#include "GeoModelKernel/GeoCons.h" +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoTubs.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + + +#include <sstream> +#include <cmath> + +#include <iostream> + +SCT_FwdCylinderServices::SCT_FwdCylinderServices(const std::string & name, + double rmin, + double rmax, + double length) + : SCT_SharedComponentFactory(name), m_innerRadius(rmin), m_outerRadius(rmax), m_length(length) +{ + getParameters(); + m_physVolume = build(); + +} + +SCT_FwdCylinderServices::~SCT_FwdCylinderServices() +{ +} + +void +SCT_FwdCylinderServices::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + // Retrieve parameters for each service + for (int iType = 0; iType < parameters->fwdNumCylinderServiceTypes(); iType++) { + if(parameters->fwdCylinderServiceName(iType) == "CoolingPipe") { + m_coolingDeltaR = parameters->fwdCylinderServiceDeltaR(iType); + m_coolingRPhi = parameters->fwdCylinderServiceRPhi(iType); + m_coolingMaterialName = parameters->fwdCylinderServiceMaterial(iType); + } + if(parameters->fwdCylinderServiceName(iType) == "LMT") { + m_lmtDeltaR = parameters->fwdCylinderServiceDeltaR(iType); + m_lmtRPhi = parameters->fwdCylinderServiceRPhi(iType); + m_lmtMaterialName = parameters->fwdCylinderServiceMaterial(iType); + } + if(parameters->fwdCylinderServiceName(iType) == "LMTCooling") { + m_lmtCoolingDeltaR = parameters->fwdCylinderServiceDeltaR(iType); + m_lmtCoolingRPhi = parameters->fwdCylinderServiceRPhi(iType); + m_lmtCoolingMaterialName = parameters->fwdCylinderServiceMaterial(iType); + } + if(parameters->fwdCylinderServiceName(iType) == "Fibres") { + m_fibreDeltaR = parameters->fwdCylinderServiceDeltaR(iType); + m_fibreRPhi = parameters->fwdCylinderServiceRPhi(iType); + m_fibreMaterialName = parameters->fwdCylinderServiceMaterial(iType); + } + if(parameters->fwdCylinderServiceName(iType) == "NPipe") { + m_nPipeDeltaR = parameters->fwdCylinderServiceDeltaR(iType); + m_nPipeRPhi = parameters->fwdCylinderServiceRPhi(iType); + m_nPipeMaterialName = parameters->fwdCylinderServiceMaterial(iType); + } + if(parameters->fwdCylinderServiceName(iType) == "Rail") { + m_railDeltaR = parameters->fwdCylinderServiceDeltaR(iType); + m_railRPhi = parameters->fwdCylinderServiceRPhi(iType); + m_railMaterialName = parameters->fwdCylinderServiceMaterial(iType); + } + } + + // Retrieve angles for each service + for (int iLoc = 0; iLoc < parameters->fwdNumCylinderServiceLocs(); iLoc++) { + if(parameters->fwdCylinderServiceLocName(iLoc) == "CoolingPipe") { + m_coolingLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); + } + if(parameters->fwdCylinderServiceLocName(iLoc) == "LMT") { + m_lmtLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); + } + if(parameters->fwdCylinderServiceLocName(iLoc) == "LMTCooling") { + m_lmtCoolingLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); + } + if(parameters->fwdCylinderServiceLocName(iLoc) == "Fibres") { + m_fibreLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); + } + if(parameters->fwdCylinderServiceLocName(iLoc) == "NPipe") { + m_nPipeLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); + } + if(parameters->fwdCylinderServiceLocName(iLoc) == "Rail") { + m_railLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); + } + } + + // Starting position for LMT Cooling is midpoint between wheels 1 and 2 + double lmtCoolingZStart = 0.5 * (parameters->fwdWheelZPosition(1) + parameters->fwdWheelZPosition(2)); + m_lmtCoolingZOffset = 0.5 * (lmtCoolingZStart - parameters->fwdSupportFrameZMin()); + +} + +GeoVPhysVol * +SCT_FwdCylinderServices::build() +{ + + // Make envelope for the services + SCT_MaterialManager materials; + const GeoTube * cylinderShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + const GeoLogVol * cylinderLog = new GeoLogVol(getName(), cylinderShape, materials.gasMaterial()); + GeoPhysVol * cylinder = new GeoPhysVol(cylinderLog); + + // Create All Services + // All except LMT Cooling run complete length of cylinder + // LMT Cooling starts midway between wheels 1 and 2 + // CoolingPipe, LMT and Fibres build up in z and are modelled as cone sections + // LMT Cooling, N2 Pipes and Rails are uniform in z and modelled as tube sections + // Cooling pipe, LMT, fibres and N2 pipe are placed at same radius + // LMT Cooling is outside LMT + // Rails are outside Cooling and N2 pipes + + // Cooling pipe + double coolingRmin = m_innerRadius; + double coolingRmax1 = coolingRmin + 0.2 * m_coolingDeltaR; + double coolingRmax2 = coolingRmin + 1.8 * m_coolingDeltaR; + double coolingDPhi = m_coolingRPhi / coolingRmin; + const GeoCons* coolingShape = new GeoCons(coolingRmin, coolingRmin, coolingRmax1, coolingRmax2, + 0.5 * m_length, + -0.5 * coolingDPhi * CLHEP::radian, coolingDPhi * CLHEP::radian); + const GeoLogVol * coolingLog = new GeoLogVol("CoolingPipe", coolingShape, materials.getMaterialForVolume(m_coolingMaterialName, coolingShape->volume())); + GeoPhysVol * coolingPipe = new GeoPhysVol(coolingLog); + + // Low Mass Tapes + double lmtRmin = m_innerRadius; + double lmtRmax1 = lmtRmin + 0.2 * m_lmtDeltaR; + double lmtRmax2 = lmtRmin + 1.8 * m_lmtDeltaR; + double lmtDPhi = m_lmtRPhi / lmtRmin; + const GeoCons* lmtShape = new GeoCons(lmtRmin, lmtRmin, lmtRmax1, lmtRmax2, 0.5 * m_length, + -0.5 * lmtDPhi * CLHEP::radian, lmtDPhi * CLHEP::radian); + const GeoLogVol * lmtLog = new GeoLogVol("LMT", lmtShape, materials.getMaterialForVolume(m_lmtMaterialName,lmtShape->volume())); + GeoPhysVol * lmt = new GeoPhysVol(lmtLog); + + // LMT Cooling: must be outside LMTs + double lmtCoolingRmin = lmtRmax2; + double lmtCoolingRmax = lmtCoolingRmin + m_lmtCoolingDeltaR; + double lmtCoolingDPhi = m_lmtCoolingRPhi / lmtCoolingRmin; + double lmtLength = m_length - 2. * m_lmtCoolingZOffset; + const GeoTubs* lmtCoolingShape = new GeoTubs(lmtCoolingRmin, lmtCoolingRmax, 0.5 * lmtLength, + -0.5 * lmtCoolingDPhi * CLHEP::radian, lmtCoolingDPhi * CLHEP::radian); + const GeoLogVol * lmtCoolingLog = new GeoLogVol("LMTCooling", lmtCoolingShape, materials.getMaterialForVolume(m_lmtCoolingMaterialName,lmtCoolingShape->volume())); + GeoPhysVol * lmtCooling = new GeoPhysVol(lmtCoolingLog); + + // Fibres + double fibreRmin = m_innerRadius; + double fibreRmax1 = fibreRmin + 0.2 * m_fibreDeltaR; + double fibreRmax2 = fibreRmin + 1.8 * m_fibreDeltaR; + double fibreDPhi = m_fibreRPhi / fibreRmin; + const GeoCons* fibreShape = new GeoCons(fibreRmin, fibreRmin, fibreRmax1, fibreRmax2, 0.5 * m_length, + -0.5 * fibreDPhi * CLHEP::radian, fibreDPhi * CLHEP::radian); + const GeoLogVol * fibreLog = new GeoLogVol("Fibres", fibreShape, materials.getMaterialForVolume(m_fibreMaterialName,fibreShape->volume())); + GeoPhysVol * fibres = new GeoPhysVol(fibreLog); + + // N2 Pipe + double nPipeRmin = m_innerRadius; + double nPipeRmax = nPipeRmin + m_nPipeDeltaR; + double nPipeDPhi = m_nPipeRPhi / nPipeRmin; + const GeoTubs* nPipeShape = new GeoTubs(nPipeRmin, nPipeRmax, 0.5 * m_length, + -0.5 * nPipeDPhi * CLHEP::radian, nPipeDPhi * CLHEP::radian); + const GeoLogVol * nPipeLog = new GeoLogVol("NPipe", nPipeShape, materials.getMaterialForVolume(m_nPipeMaterialName,nPipeShape->volume())); + GeoPhysVol * nPipe = new GeoPhysVol(nPipeLog); + + // Rails: must be outside Cooling and N2 Pipes + double railRmin = std::max(coolingRmax2, nPipeRmax); + double railRmax = railRmin + m_railDeltaR; + double railDPhi = m_railRPhi / railRmin; + const GeoTubs* railShape = new GeoTubs(railRmin, railRmax, + 0.5 * m_length, -0.5 * railDPhi * CLHEP::radian, railDPhi * CLHEP::radian); + const GeoLogVol * railLog = new GeoLogVol("Rail", railShape, materials.getMaterialForVolume(m_railMaterialName,railShape->volume())); + GeoPhysVol * rail = new GeoPhysVol(railLog); + + // Services are repeated for each quadrant + for (int iquad = 0; iquad < 4; iquad++) { + + // Cooling pipe + for (unsigned int iLoc = 0; iLoc < m_coolingLocAngle.size(); iLoc++) { + double coolingAngle = m_coolingLocAngle[iLoc] + iquad * 90*CLHEP::degree; + // std::cout << "Placing cooling pipe at " << coolingAngle / CLHEP::degree << " CLHEP::degrees" << std::endl; + cylinder->add(new GeoTransform(HepGeom::RotateZ3D(coolingAngle))); + cylinder->add(coolingPipe); + } + + // Low Mass Tapes and LMT Cooling are at same phi positions + for (unsigned int iLoc = 0; iLoc < m_lmtLocAngle.size(); iLoc++) { + double lmtAngle = m_lmtLocAngle[iLoc] + iquad * 90*CLHEP::degree; + // std::cout << "Placing LMT at " << lmtAngle / CLHEP::degree << " CLHEP::degrees" << std::endl; + cylinder->add(new GeoTransform(HepGeom::RotateZ3D(lmtAngle))); + cylinder->add(lmt); + cylinder->add(new GeoTransform(HepGeom::RotateZ3D(lmtAngle)*HepGeom::TranslateZ3D(m_lmtCoolingZOffset))); + cylinder->add(lmtCooling); + } + + // Fibres are between pairs of LMTs + for (unsigned int iLoc = 0; iLoc < m_fibreLocAngle.size(); iLoc++) { + double fibreAngle = m_fibreLocAngle[iLoc] + iquad * 90*CLHEP::degree; + // std::cout << "Placing fibres at " << fibreAngle / CLHEP::degree << " CLHEP::degrees" << std::endl; + cylinder->add(new GeoTransform(HepGeom::RotateZ3D(fibreAngle))); + cylinder->add(fibres); + } + + // N2 Pipes + for (unsigned int iLoc = 0; iLoc < m_nPipeLocAngle.size(); iLoc++) { + double nPipeAngle = m_nPipeLocAngle[iLoc] + iquad * 90*CLHEP::degree; + // std::cout << "Placing N2 pipe at " << nPipeAngle / CLHEP::degree << " CLHEP::degrees" << std::endl; + cylinder->add(new GeoTransform(HepGeom::RotateZ3D(nPipeAngle))); + cylinder->add(nPipe); + } + + // Rails + for (unsigned int iLoc = 0; iLoc < m_railLocAngle.size(); iLoc++) { + double railAngle = m_railLocAngle[iLoc] + iquad * 90*CLHEP::degree; + // std::cout << "Placing rail at " << railAngle / CLHEP::degree << " CLHEP::degrees" << std::endl; + cylinder->add(new GeoTransform(HepGeom::RotateZ3D(railAngle))); + cylinder->add(rail); + } + + } // end loop over quadrants + + return cylinder; + +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx new file mode 100755 index 00000000000..734b3ee6518 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx @@ -0,0 +1,51 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdDiscFixation.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_FwdDiscFixation::SCT_FwdDiscFixation(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdDiscFixation::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName= parameters->fwdDiscFixationMaterial(); + m_thickness = parameters->fwdDiscFixationThickness(); + m_radius = parameters->fwdDiscFixationRadius(); +} + +GeoVPhysVol * +SCT_FwdDiscFixation::build() +{ + + SCT_MaterialManager materials; + + const GeoTube * discFixationShape = new GeoTube(0., m_radius, 0.5*m_thickness); + m_material = materials.getMaterialForVolume(m_materialName, discFixationShape->volume()); + const GeoLogVol * discFixationLog = new GeoLogVol(getName(), discFixationShape, m_material); + + GeoPhysVol * discFixation = new GeoPhysVol(discFixationLog); + + return discFixation; +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx new file mode 100755 index 00000000000..930585f15a5 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdDiscPowerTape.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_FwdDiscPowerTape::SCT_FwdDiscPowerTape(const std::string & name, int iRing) + : SCT_SharedComponentFactory(name), m_ringNumber(iRing) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdDiscPowerTape::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName = parameters->fwdDiscPowerTapeMaterial(m_ringNumber); + m_innerRadius = parameters->fwdDiscPowerTapeInnerRadius(m_ringNumber); + m_outerRadius = parameters->fwdDiscPowerTapeOuterRadius(m_ringNumber); + m_thickness = parameters->fwdDiscPowerTapeThickness(m_ringNumber); + +} + +GeoVPhysVol * +SCT_FwdDiscPowerTape::build() +{ + + SCT_MaterialManager materials; + + // Make the support disk. A simple tube. + const GeoTube * powerTapeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness); + m_material = materials.getMaterialForVolume(m_materialName, powerTapeShape->volume()); + const GeoLogVol * powerTapeLog = new GeoLogVol(getName(), powerTapeShape, m_material); + + GeoPhysVol * powerTape = new GeoPhysVol(powerTapeLog); + + return powerTape; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx new file mode 100755 index 00000000000..814773ea56d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdDiscSupport.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_FwdDiscSupport::SCT_FwdDiscSupport(const std::string & name, int iWheel) + : SCT_SharedComponentFactory(name), m_iWheel(iWheel) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdDiscSupport::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName = parameters->fwdDiscSupportMaterial(); + m_thickness = parameters->fwdDiscSupportThickness(); + m_innerRadius = parameters->fwdDiscSupportInnerRadius(); + m_outerRadius = parameters->fwdDiscSupportOuterRadius(); +} + +GeoVPhysVol * +SCT_FwdDiscSupport::build() +{ + // Make the support disk. A simple tube. + SCT_MaterialManager materials; + + const GeoTube * discSupportShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness); + m_material = materials.getMaterialForVolume(m_materialName+intToString(m_iWheel), discSupportShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol * discSupportLog = new GeoLogVol(getName(), discSupportShape, m_material); + + GeoPhysVol * discSupport = new GeoPhysVol(discSupportLog); + + return discSupport; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx new file mode 100755 index 00000000000..563e36f9451 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdFSI.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_FwdFSI::SCT_FwdFSI(const std::string & name, int type) + : SCT_SharedComponentFactory(name), m_type(type) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdFSI::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName= parameters->fwdFSIGeomMaterial(m_type); + m_thickness = parameters->fwdFSIGeomThickness(m_type); + m_deltaR = parameters->fwdFSIGeomDeltaR(m_type); + m_rphi = parameters->fwdFSIGeomRPhi(m_type); + m_zOffset = parameters->fwdFSIGeomZOffset(m_type); +} + +GeoVPhysVol * +SCT_FwdFSI::build() +{ + SCT_MaterialManager materials; + + const GeoBox * fsiShape = new GeoBox(0.5 * m_deltaR, 0.5 * m_rphi, 0.5 * m_thickness); + m_material = materials.getMaterialForVolume(m_materialName, fsiShape->volume()); + const GeoLogVol * fsiLog = new GeoLogVol(getName(), fsiShape, m_material); + + GeoPhysVol * fsi = new GeoPhysVol(fsiLog); + + return fsi; +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx new file mode 100755 index 00000000000..afa2454d487 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx @@ -0,0 +1,126 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/////////////////////////////////////////////// +// Simulation for the COMBINED TESTBEAM 2004 // +// // +// Zdenka.Broklova@matfyz.cz // +// Carlos.Escobar@ific.uv.es // +// Peter.Kodys@ific.uv.es // +// January 23, 2004 // +/////////////////////////////////////////////// + +#include "SCT_GeoModel/SCT_FwdHybrid.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardModuleParameters.h" + +#include "GeoModelKernel/GeoTrd.h" +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <cmath> + + +SCT_FwdHybrid::SCT_FwdHybrid(const std::string & name, int ringType) + : SCT_SharedComponentFactory(name), m_ringType(ringType) +{ + getParameters(); + m_physVolume = build(); +} + + + +void +SCT_FwdHybrid::getParameters() +{ + + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + + m_materialName = parameters->fwdHybridMaterial(); + + //double CLHEP::radlength; + //CLHEP::radlength = 18.8 * CLHEP::cm; // [CLHEP::cm] for carbon (Partickle Physics Booklet) + + m_thickness = parameters->fwdHybridThickness(); + m_thickness2 = m_thickness; + + m_length = parameters->fwdHybridLength(); + + // TRD part + m_innerWidth = parameters->fwdHybridInnerWidth(); + m_outerWidth = parameters->fwdHybridOuterWidth(); // Width at outer edge + m_length1 = parameters->fwdHybridLengthToCorner(); + + // rectangular part. + m_length2 = m_length - parameters->fwdHybridLengthToCorner(); + m_width2 = m_innerWidth; + + if (m_width2 < m_outerWidth) m_width2 = m_outerWidth; + + m_mountPointToInnerEdge = parameters->fwdHybridMountPointToInnerEdge(); + m_mountPointToOuterEdge = m_length - m_mountPointToInnerEdge; + +} + +GeoVPhysVol * SCT_FwdHybrid::build() +{ + + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + + // Make a hybrid. This is a TRD + BOX + const GeoTrd * hybridShape1 = new GeoTrd(0.5 * m_thickness, 0.5 * m_thickness, + 0.5 * m_innerWidth, 0.5 * m_outerWidth, + 0.5 * m_length1); + + const GeoBox * hybridShape2 = new GeoBox(0.5 * m_thickness2, 0.5 * m_width2, 0.5 * m_length2); + + double position = parameters->fwdModuleMountPoint(m_ringType) - (m_mountPointToInnerEdge) + + 0.5*(m_length2); + // double position = zsmi[m_ringType].mountd - zhyb->hybysh + (zhyb->hyby - zhyb->hybycor) / 2.; + if (m_ringType == 0) { position = -1 * position; }; // outer module, hybrid in inner side + + const GeoShape & hybridPos1 = (*hybridShape2 << HepGeom::TranslateZ3D(position)); + + position = parameters->fwdModuleMountPoint(m_ringType) - (m_mountPointToInnerEdge) + + m_length - 0.5 * parameters->fwdHybridLengthToCorner(); + // position = zsmi[m_ringType].mountd - zhyb->hybysh + zhyb->hyby - zhyb->hybycor / 2.; + if (m_ringType == 0) { // outer module, hybrid in inner side + position = -1 * position; }; + + double rotation = 0.; + if (m_ringType == 0) rotation = 180. * CLHEP::deg; + + const GeoShape & hybridPos2 = (*hybridShape1 << HepGeom::RotateX3D(rotation) + << HepGeom::TranslateZ3D(position) ); + + + SCT_MaterialManager materials; + const GeoShapeUnion & hybridShape = hybridPos1.add(hybridPos2); + // error getting volume directly. + //m_material = materials.getMaterialForVolume(m_materialName, hybridShape.volume()); + m_material = materials.getMaterialForVolume(m_materialName, hybridShape1->volume()+hybridShape2->volume()); + const GeoLogVol * hybridLog = new GeoLogVol(getName(), &hybridShape, m_material); + GeoPhysVol * hybrid = new GeoPhysVol(hybridLog); + + return hybrid; + +} + + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx new file mode 100755 index 00000000000..174f6d9db90 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx @@ -0,0 +1,316 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/////////////////////////////////////////////// +// Simulation for the COMBINED TESTBEAM 2004 // +// // +// Zdenka.Broklova@matfyz.cz // +// Carlos.Escobar@ific.uv.es // +// Peter.Kodys@ific.uv.es // +// January 23, 2004 // +/////////////////////////////////////////////// + +#include "SCT_GeoModel/SCT_FwdModule.h" +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_ForwardModuleParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" +#include "SCT_GeoModel/SCT_Identifier.h" + +#include "SCT_GeoModel/SCT_FwdModuleConnector.h" +#include "SCT_GeoModel/SCT_FwdSpine.h" +#include "SCT_GeoModel/SCT_FwdSubSpine.h" +#include "SCT_GeoModel/SCT_FwdHybrid.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "GeoModelKernel/GeoTrd.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" + +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <cmath> +#include <sstream> + +inline double sqr(double x) {return x*x;} + +SCT_FwdModule::SCT_FwdModule(const std::string & name, int ringType) + : SCT_UniqueComponentFactory(name), m_ringType(ringType) +{ + + getParameters(); + + m_hybrid = new SCT_FwdHybrid("SCT_FwdHybrid"+intToString(ringType), m_ringType ); + m_spine = new SCT_FwdSpine("SCT_FwdSpine"+intToString(ringType), m_ringType); + m_subspineL = new SCT_FwdSubSpine("SCT_FwdSubSpineL"+intToString(ringType), m_ringType, SUBSPINE_LEFT); + m_subspineR = new SCT_FwdSubSpine("SCT_FwdSubSpineR"+intToString(ringType), m_ringType, SUBSPINE_RIGHT); + m_sensor = new SCT_FwdSensor("ECSensor"+intToString(ringType), m_ringType); + if (m_connectorPresent) { + m_connector = new SCT_FwdModuleConnector("SCT_FwdModuleConnector"+intToString(ringType), m_ringType); + } + else { + //std::cout << "SCT_FwdModuleConnector not built" << std::endl; + m_connector = NULL; + } + + m_logVolume = preBuild(); + +} + +SCT_FwdModule::~SCT_FwdModule() +{ + delete m_connector; + delete m_hybrid; + delete m_spine; + delete m_subspineL; + delete m_subspineR; + delete m_sensor; +} + + +void +SCT_FwdModule::getParameters() +{ + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + // m_safety = geometryManager()->safety(); + m_glueThickness = parameters->fwdModuleGlueThickness(m_ringType); + m_distBtwMountPoints = parameters->fwdModuleDistBtwMountPoints(m_ringType); + m_mountPointToCenter = parameters->fwdModuleMountPoint(m_ringType); + m_hybridIsOnInnerEdge = parameters->fwdHybridIsOnInnerEdge(m_ringType); + m_stereoAngle = parameters->fwdModuleStereoAngle(m_ringType); + m_upperSide = parameters->fwdModuleUpperSideNumber(m_ringType); + m_connectorPresent = parameters->fwdModuleConnectorPresent(); + +} + + +const GeoLogVol * SCT_FwdModule::preBuild() +{ + // module volume preparing + + const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + + double safety = generalParameters->safety(); + double safetyTmp = safety * CLHEP::cm; // For compatibility with minor bug in older version - safety already in CLHEP units; + + // module_length = (zhyb->hyby - zhyb->hybysh + zsmi[m_ringType].mountd2 + 0.33 ) * CLHEP::cm + safety; + // Distance from outer bybrid edge to outer spine edge. + // FIXME: The 1.05CLHEP::mm is not needed + double moduleLength = m_hybrid->mountPointToOuterEdge() + m_mountPointToCenter + m_spine->moduleCenterToEnd() + 1.05 * CLHEP::mm; + m_length = moduleLength + safety; // We add a bit of safety for the envelope + + // module_thickness = (zhyb->hybz0 * 2 + safety) * CLHEP::cm; + double sensorEnvelopeThickness = 2 * m_sensor->thickness() + m_spine->thickness() + 2 * m_glueThickness; + m_thickness = std::max(sensorEnvelopeThickness, m_hybrid->thickness()); + // std::cout << "sensor envelope thickness " << sensorEnvelopeThickness << std::endl; + // std::cout << "hybrid thickness " << m_hybrid->thickness() << std::endl; + + + // module_widthInner = ((zsmo->subdq + zssp[m_ringType].ssp0l + 0.325) * 2.+ 0.7 + safety)*CLHEP::cm; // upto to NOVA_760 + // module_widthOuter = ((zsmo->subdq + zssp[m_ringType].ssp2l + 0.325) * 2.+ 0.7 + safety)*CLHEP::cm; // upto to NOVA_760 + + //module_widthInner = ((zsmo->subdq + zssp[m_ringType].ssp0l) * 2.+ 0.7 + safety)*CLHEP::cm; + //module_widthOuter = ((zsmo->subdq + zssp[m_ringType].ssp2l) * 2.+ 0.7 + safety)*CLHEP::cm; + + m_widthInner = (m_spine->width() + 2 * m_subspineL->innerWidth() + 0.7*CLHEP::cm) + safetyTmp; + m_widthOuter = (m_spine->width() + 2 * m_subspineL->outerWidth() + 0.7*CLHEP::cm) + safetyTmp; + + + + if (m_ringType == 3 ) { + // module_widthOuter = (( zsmo->subdq + zssp[m_ringType].ssp2l + 0.325) * 2.+ 1.6 + safety)*CLHEP::cm; // upto to NOVA_760 + // module_widthOuter = (( zsmo->subdq + zssp[m_ringType].ssp2l) * 2.+ 1.6 + safety)*CLHEP::cm; + m_widthOuter = m_spine->width() + 2 * m_subspineL->outerWidth() + 1.6*CLHEP::cm + safetyTmp; + + } + + // Calculate module shift. Distance between module physics center and center of envelope. + int hybridSign = m_hybridIsOnInnerEdge ? +1: -1; + //module_shift = (zhyb->hyby - zhyb->hybysh + zsmi[m_ringType].mountd + 0.05)*CLHEP::cm; + //module_shift = hybrid * (module_length / 2. - module_shift); + + double moduleCenterToHybridOuterEdge = m_hybrid->mountPointToOuterEdge() + m_mountPointToCenter + 0.5*CLHEP::mm; + //FIXME: Should be: (ie don't need the 0.5CLHEP::mm) + // double moduleCenterToHybridOuterEdge = m_hybrid->mountPointToOuterEdge() + m_mountPointToCenter ; + m_moduleShift = hybridSign * (0.5 * m_length - moduleCenterToHybridOuterEdge); + + // Envelope inner/outer radius + m_innerRadius = m_sensor->centerRadius() + m_moduleShift - 0.5*m_length; + m_outerRadius = m_sensor->centerRadius() + m_moduleShift + 0.5*m_length; + + // Radial location of mount points (ignoring streo rotation) + m_mainMountPoint = m_sensor->centerRadius() - hybridSign * m_mountPointToCenter; + m_secMountPoint = m_mainMountPoint + hybridSign * m_distBtwMountPoints; + m_endLocator = m_sensor->centerRadius() + hybridSign * m_spine->moduleCenterToEnd(); + + // std::cout << "SCT_FwdModule: " << std::endl; + // std::cout << " ringType = " << m_ringType << std::endl; + // std::cout << " sensorCenterRadius = " << m_sensor->centerRadius() << std::endl; + // std::cout << " innerRadius = " << m_innerRadius << std::endl; + // std::cout << " outerRadius = " << m_outerRadius << std::endl; + // std::cout << " module_widthInner = " << m_widthInner << std::endl; + // std::cout << " module_widthOuter = " << m_widthOuter << std::endl; + // std::cout << " module_length = " << m_length << std::endl; + // std::cout << " module_thickness = " << m_thickness << std::endl; + + + // Outer module the hybrid is on inner edge. + // For the rest its in the outer edge. + // TODO Check this. + m_powerTapeStart = m_sensor->centerRadius() - hybridSign * moduleCenterToHybridOuterEdge; + + + const GeoTrd * moduleEnvelopeShape = new GeoTrd(0.5 * m_thickness, 0.5 * m_thickness, + 0.5 * m_widthInner, 0.5 * m_widthOuter, + 0.5 * m_length); + const GeoShapeShift & moduleEnvelope = (*moduleEnvelopeShape << HepGeom::TranslateZ3D(m_moduleShift) ); + + SCT_MaterialManager materials; + GeoLogVol * moduleLog = new GeoLogVol(getName(), &moduleEnvelope, materials.gasMaterial()); + + return moduleLog; + +} + +/* +GeoVPhysVol* SCT_FwdModule::build(SCT_Identifier id, GeoTransform * position, GeoPhysVol * world) +{ + + m_physVolume = build(id); + return m_physVolume; + // this build method put all components of module into world on position + GeoNameTag * SCTtag = new GeoNameTag("SCT"); + + world->add(SCTtag); + if (position != NULL) world->add(position); + world->add(m_hybrid->getVolume()); + + world->add(SCTtag); + if (position != NULL) world->add(position); + world->add(m_spine->getVolume()); + + world->add(SCTtag); + if (position != NULL) world->add(position); + world->add(m_subspineL->getVolume()); + + world->add(SCTtag); + if (position != NULL) world->add(position); + world->add(m_subspineR->getVolume()); + + world->add(SCTtag); + if (position != NULL) world->add(position); + world->add(m_sensor->getVolume()); + + world->add(SCTtag); + if (position != NULL) world->add(position); + world->add(m_sensor->getVolume()); + + if (m_ringType == 2) + { world->add(SCTtag); + if (position != NULL) world->add(position); + world->add(m_sensor->getInactive()); + + world->add(SCTtag); + if (position != NULL) world->add(position); + world->add(m_sensor->getInactive()); + }; + +} +*/ + +GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) const +{ + + // build method for creating module parent physical volume + // and puting all components into it + // - relative position of component is part of its shape + GeoFullPhysVol * module = new GeoFullPhysVol(m_logVolume); + + if(m_connector != NULL) module->add(m_connector->getVolume()); + module->add(m_hybrid->getVolume()); + module->add(m_spine->getVolume()); + module->add(m_subspineL->getVolume()); + module->add(m_subspineR->getVolume()); + + + // name tags are not final + + + // Position bottom (x<0)sensor + double positionX; + double positionZ = m_sensor->sensorOffset(); // For truncated middle the sensor is offset. + double rotation; + positionX =-(0.5*m_spine->thickness() + m_glueThickness + 0.5*m_sensor->thickness()); + rotation = 0.5 * m_stereoAngle; + CLHEP::Hep3Vector vecB(positionX,0,0); + CLHEP::HepRotation rotB; + rotB.rotateZ(180*CLHEP::degree); // Rotate so that X axis goes from backside to implant side + rotB.rotateX(rotation); + // First translate in z (only non-zero for truncated middle) + // Then rotate and then translate in x. + GeoAlignableTransform *bottomTransform + = new GeoAlignableTransform(HepGeom::Transform3D(rotB,vecB)*HepGeom::TranslateZ3D(positionZ)); + + int bottomSideNumber = (m_upperSide) ? 0 : 1; + id.setSide(bottomSideNumber); + module->add(new GeoNameTag("Sensor_Side#"+intToString(bottomSideNumber))); + module->add(new GeoIdentifierTag(600+bottomSideNumber)); + module->add(bottomTransform); + GeoVPhysVol * bottomSensorPV = m_sensor->build(id); + module->add(bottomSensorPV); + + // Store transform + detectorManager()->addAlignableTransform(0, id.getWaferId(), bottomTransform, bottomSensorPV); + + + if (m_ringType == 2) { // Place glass pieces in place of sensor + module->add(new GeoTransform(HepGeom::Transform3D(rotB,vecB))); + module->add(m_sensor->getInactive()); + } + + // Position top (x>0) sensor + positionX=-positionX; + rotation=-rotation; + CLHEP::HepRotation rotT; + //rotT.rotateZ(180*CLHEP::degree); // Rotate so that X axis goes from implant side to backside + rotT.rotateX(rotation); + CLHEP::Hep3Vector vecT(positionX,0,0); + // First translate in z (only non-zero for truncated middle) + // Then rotate and then translate in x. + GeoAlignableTransform *topTransform + = new GeoAlignableTransform(HepGeom::Transform3D(rotT,vecT)*HepGeom::TranslateZ3D(positionZ)); + + int topSideNumber = m_upperSide; + id.setSide(topSideNumber); + module->add(new GeoNameTag("Sensor_Side#"+intToString(topSideNumber))); + module->add(new GeoIdentifierTag(600+topSideNumber)); + module->add(topTransform); + GeoVPhysVol * topSensorPV = m_sensor->build(id); + module->add(topSensorPV); + + // Store transform + detectorManager()->addAlignableTransform(0, id.getWaferId(), topTransform, topSensorPV); + + if (m_ringType == 2) { // Place glass pieces in place of sensor + module->add(new GeoTransform(HepGeom::Transform3D(rotT,vecT))); + module->add(m_sensor->getInactive()); + }; + + return module; + +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx new file mode 100755 index 00000000000..df662b0483b --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx @@ -0,0 +1,66 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdModuleConnector.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardModuleParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Units/PhysicalConstants.h" // For pi + +#include <cmath> +#include <iostream> + +SCT_FwdModuleConnector::SCT_FwdModuleConnector(const std::string & name, int ringType) + : SCT_SharedComponentFactory(name), m_ringType(ringType) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdModuleConnector::getParameters() +{ + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + + m_materialName= parameters->fwdModuleConnectorMaterial(); + m_deltaR = parameters->fwdModuleConnectorDeltaR(); + m_rphi = parameters->fwdModuleConnectorRPhi(); + m_thickness = parameters->fwdModuleConnectorThickness(); +} + +GeoVPhysVol * +SCT_FwdModuleConnector::build() +{ + SCT_MaterialManager materials; + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + + // Construct box + const GeoBox * moduleConnShape = new GeoBox(0.5 * m_thickness, 0.5 * m_rphi, 0.5 * m_deltaR); + m_material = materials.getMaterialForVolume(m_materialName, moduleConnShape->volume()); + // std::cout << "Material = " << m_material->getName() << std::endl; + // std::cout << "Density = " << m_material->getDensity()/(gram/CLHEP::cm3) << std::endl; + + // Shift to correct position within module + double xposition = 0.5 * (parameters->fwdHybridThickness() + m_thickness); + double zposition = parameters->fwdModuleMountPoint(m_ringType) - parameters->fwdHybridMountPointToInnerEdge() + parameters->fwdHybridLength() - 0.5*(m_deltaR); + if (m_ringType == 0) { zposition = -1 * zposition; }; // outer module, hybrid in inner side + const GeoShape & connectorPos = (*moduleConnShape << HepGeom::Translate3D(xposition,0.,zposition)); + + + const GeoLogVol * moduleConnLog = new GeoLogVol(getName(), &connectorPos, m_material); + + GeoPhysVol * moduleConnector = new GeoPhysVol(moduleConnLog); + + return moduleConnector; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx new file mode 100755 index 00000000000..deed889f44e --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx @@ -0,0 +1,68 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdOptoHarness.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Units/PhysicalConstants.h" // For pi + +#include <cmath> +#include <iostream> + +inline double sqr(double x) {return x*x;} + +SCT_FwdOptoHarness::SCT_FwdOptoHarness(const std::string & name, int itype) + : SCT_SharedComponentFactory(name), m_type(itype) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdOptoHarness::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_index = -1; + for(int i=0; i<3; ++i) { + if(parameters->fwdOptoHarnessDiscType(i) == m_type) {m_index = i;} + } + + if(m_index < 0) { + std::cout << "SCT_FwdOptoHarness: ERROR. Disc type is missing" << m_type << std::endl; + std::cout << "Assuming type 1" << std::endl; + m_index = 0; + } + + m_materialName= parameters->fwdOptoHarnessMaterial(m_index); + m_innerRadius = parameters->fwdOptoHarnessInnerRadius(m_index); + m_outerRadius = parameters->fwdOptoHarnessOuterRadius(m_index); + m_thickness = parameters->fwdOptoHarnessThickness(m_index); +} + +GeoVPhysVol * +SCT_FwdOptoHarness::build() +{ + SCT_MaterialManager materials; + + const GeoTube * optoHarnessShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness); + m_material = materials.getMaterialForVolume(m_materialName, optoHarnessShape->volume()); + // m_material = materials.getMaterial(m_materialName); + // cout << "Material = " << m_material->getName() << endl; + // cout << "Density = " << m_material->getDensity()/(gram/CLHEP::cm3) << endl; + const GeoLogVol * optoHarnessLog = new GeoLogVol(getName(), optoHarnessShape, m_material); + + GeoPhysVol * optoHarness = new GeoPhysVol(optoHarnessLog); + + return optoHarness; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx new file mode 100755 index 00000000000..1598f0d4133 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdPPConnector.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_FwdPPConnector::SCT_FwdPPConnector(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdPPConnector::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName= parameters->fwdPPConnectorMaterial(); + m_thickness = parameters->fwdPPConnectorThickness(); + m_deltaR = parameters->fwdPPConnectorDeltaR(); + m_rphi = parameters->fwdPPConnectorRPhi(); +} + +GeoVPhysVol * +SCT_FwdPPConnector::build() +{ + + SCT_MaterialManager materials; + + const GeoBox * pPConnectorShape = new GeoBox(0.5 * m_deltaR, 0.5 * m_rphi, 0.5 * m_thickness); + m_material = materials.getMaterialForVolume(m_materialName, pPConnectorShape->volume()); + const GeoLogVol * pPConnectorLog = new GeoLogVol(getName(), pPConnectorShape, m_material); + + GeoPhysVol * pPConnector = new GeoPhysVol(pPConnectorLog); + + return pPConnector; +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx new file mode 100755 index 00000000000..0c4a4e0135d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdPPCooling.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_FwdPPCooling::SCT_FwdPPCooling(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdPPCooling::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName= parameters->fwdPPCoolingMaterial(); + m_thickness = parameters->fwdPPCoolingThickness(); + m_deltaR = parameters->fwdPPCoolingDeltaR(); + m_rphi = parameters->fwdPPCoolingRPhi(); +} + +GeoVPhysVol * +SCT_FwdPPCooling::build() +{ + + SCT_MaterialManager materials; + + const GeoBox * pPCoolingShape = new GeoBox(0.5 * m_deltaR, 0.5 * m_rphi, 0.5 * m_thickness); + m_material = materials.getMaterialForVolume(m_materialName, pPCoolingShape->volume()); + const GeoLogVol * pPCoolingLog = new GeoLogVol(getName(), pPCoolingShape, m_material); + + GeoPhysVol * pPCooling = new GeoPhysVol(pPCoolingLog); + + return pPCooling; +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx new file mode 100755 index 00000000000..c7e3982af68 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx @@ -0,0 +1,54 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdPatchPanel.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_FwdPatchPanel::SCT_FwdPatchPanel(const std::string & name, int type) + : SCT_SharedComponentFactory(name), m_type(type) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdPatchPanel::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName= parameters->fwdPatchPanelMaterial(m_type); + m_thickness = parameters->fwdPatchPanelThickness(m_type); + m_midRadius = parameters->fwdPatchPanelMidRadius(m_type); + m_deltaR = parameters->fwdPatchPanelDeltaR(m_type); + m_rphi = parameters->fwdPatchPanelRPhi(m_type); +} + +GeoVPhysVol * +SCT_FwdPatchPanel::build() +{ + + SCT_MaterialManager materials; + + const GeoBox * patchPanelShape = new GeoBox(0.5 * m_deltaR, 0.5 * m_rphi, 0.5 * m_thickness); + m_material = materials.getMaterialForVolume(m_materialName, patchPanelShape->volume()); + const GeoLogVol * patchPanelLog = new GeoLogVol(getName(), patchPanelShape, m_material); + + + GeoPhysVol * patchPanel = new GeoPhysVol(patchPanelLog); + + return patchPanel; +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx new file mode 100755 index 00000000000..620c82c05a2 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx @@ -0,0 +1,62 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdPowerTape.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include <cmath> + +SCT_FwdPowerTape::SCT_FwdPowerTape(const std::string & name, + int numModules, + double innerRadius, + double startPos, + double endPos) + : SCT_SharedComponentFactory(name), m_numModules(numModules), m_innerRadius(innerRadius) +{ + m_length = std::abs(endPos - startPos); + m_zPosition = 0.5 * (startPos + endPos); + + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdPowerTape::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->fwdPowerTapeMaterial()); + m_crossSectArea = parameters->fwdPowerTapeCrossSectArea(); +} + +GeoVPhysVol * +SCT_FwdPowerTape::build() +{ + // Calculate the dimensions. + // The area = 2*CLHEP::pi*r_ave*delta_r approx= 2 * CLHEP::pi * rMin * delta_r + // where m_thickness = delta_r + + double area = m_crossSectArea * m_numModules; + m_thickness = area/(2. * CLHEP::pi * m_innerRadius); + m_outerRadius = m_innerRadius + m_thickness; + + // Make the support disk. A simple tube. + const GeoTube * powerTapeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + const GeoLogVol * powerTapeLog = new GeoLogVol(getName(), powerTapeShape, m_material); + + GeoPhysVol * powerTape = new GeoPhysVol(powerTapeLog); + + return powerTape; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx new file mode 100755 index 00000000000..d0c74a7d4ec --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx @@ -0,0 +1,404 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdRing.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_ForwardParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" + +#include "SCT_GeoModel/SCT_FwdModule.h" +#include "SCT_GeoModel/SCT_FwdCoolingBlock.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <sstream> +#include <cmath> + +inline double sqr(double x) {return x*x;} + +SCT_FwdRing::SCT_FwdRing(const std::string & name, + //int ringType, + const SCT_FwdModule * module, + //const SCT_FwdRingCooling * cooling, + //int stereoSign, + //int ringSide) + int iWheel, + int iRing, + int ec) + : SCT_UniqueComponentFactory(name), + // m_ringType(ringType), + // m_ringSide(ringSide), + //m_stereoSign(stereoSign), + //m_cooling(cooling) + m_iWheel(iWheel), + m_iRing(iRing), + m_endcap(ec), + m_module(module) +{ + getParameters(); + m_logVolume = preBuild(); +} + +void +SCT_FwdRing::getParameters() +{ + + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + + m_safety = generalParameters->safety(); + + m_numModules = parameters->fwdRingNumModules(m_iRing); + m_moduleStagger = parameters->fwdRingModuleStagger(m_iRing); + m_refStartAngle = parameters->fwdRingPhiOfRefModule(m_iRing); + m_refFirstStagger = parameters->fwdRingStaggerOfRefModule(m_iWheel, m_iRing, m_endcap); + m_ringSide = parameters->fwdWheelRingSide(m_iWheel, m_iRing, m_endcap); + m_stereoSign = parameters->fwdWheelStereoType(m_iWheel); + m_ringOffset = parameters->fwdRingDistToDiscCenter(m_iRing); + m_discSupportThickness = parameters->fwdDiscSupportThickness(); + + m_discRotated = (parameters->fwdRingUsualRingSide(m_iRing) != m_ringSide); + + m_identifier = m_iRing; + + // Set numerology + detectorManager()->numerology().setNumPhiModulesForDiskRing(m_iWheel,m_iRing,m_numModules); + +} + +SCT_FwdRing::~SCT_FwdRing() +{ + delete m_coolingBlockHiMain; + delete m_coolingBlockHiSec; + delete m_coolingBlockLoMain; + delete m_coolingBlockLoSec; +} + +const GeoLogVol * +SCT_FwdRing::preBuild() +{ +// std::cout << getName() << std::endl; +// std::cout << "Wheel, Ring = " << m_iWheel << ", " << m_iRing << std::endl; +// std::cout << "m_module->thickness() = " << m_module->thickness() << std::endl; +// std::cout << "m_moduleStagger = " << m_moduleStagger << std::endl; +// std::cout << "m_refStartAngle = " << m_refStartAngle << std::endl; +// std::cout << "m_refFirstStagger = " << m_refFirstStagger << std::endl; +// std::cout << "m_ringOffset = " << m_ringOffset << std::endl; + + // Make a ring. This is made of two half rings. They are identical but as + // we need different identifiers they are made seperately. + // We will refer to the two halves as inner and outer. + // Inner will be the one closest to support when disk is on side of support + // furthest from IP. z of Inner < z of Outer. + // In later versions need to decide if I should rotate rings that are on IP side of + // support by 180 around x (or y) axis. + + // Make sure we have even number of modules + if (m_numModules % 2) std::cout << "SCT_FwdRing: Number of modules in ring must be even." << std::endl; + + + // We define here the module with id = 0 as the nearest module to phi = 0. + // It is at most 1/2 a division from 0, ie Between -0.5*divisionAngle to +0.5*divisionAngle. + // For old number it was the first module with positive phi. + + // The parameter refStartAngle is the angle of any module. + // refFirstStagger is whether this is an upper (+1) or lower (-1) module. + // The stagger and angle of the module with id = 0, is calculated from this. + + double angle = m_refStartAngle; + // If disc is rotated then recalculate the angle. + // It assumed the disc is rotated around the Y axis. + // TODO: Check this assumption. + if (m_discRotated) angle = CLHEP::pi - angle; + double divisionAngle = 2*CLHEP::pi / m_numModules; + + // Now we choose module 0 as the first module with -0.5 * divAngle < phi <= 0.5 * divAngle + double moduleCount = angle / divisionAngle; + int moduleCountInt = static_cast<int>(floor(moduleCount +0.5 -0.0001)); // The -0.0001 allows slightly positive + // in case of rounding errors. + m_startAngle = divisionAngle * (moduleCount - moduleCountInt); + + // Determine numbering for -ve endcap. + // This is for a rotation around Y axis. + // After rotation we want the first module closest to phi = 0. + double angleNegEC = CLHEP::pi - m_startAngle; + double moduleCountNegEC = angleNegEC / divisionAngle; + m_moduleZero = static_cast<int>(floor(moduleCountNegEC + 0.5 - 0.0001)); + + + // Determine if it is an upper or lower. + m_firstStagger = m_refFirstStagger; + if (moduleCountInt % 2) m_firstStagger = -m_refFirstStagger; + +// std::cout << "RingType, RingSide, Stereo, rotated = " << m_iRing << " " << m_ringSide << " " +// << m_stereoSign << " " << m_discRotated << std::endl; +// std::cout << "Ref Start angle and stagger " << m_refStartAngle/CLHEP::deg << " " << m_refFirstStagger << std::endl; +// std::cout << "First Start angle and stagger " << m_startAngle/CLHEP::deg << " " << m_firstStagger << std::endl; +// std::cout << "Module zero in -ve endcap " << m_moduleZero << std::endl; + + + makeModuleServices(); + + // Make envelope for ring + double moduleClearanceZ = 0.6 * CLHEP::mm; // Arbitrary choice + double moduleClearanceR = 0.5 * CLHEP::mm; + + m_innerRadius = m_module->innerRadius() - 0.5*m_module->stereoAngle()*(0.5*m_module->innerWidth()) - moduleClearanceR; + m_outerRadius = sqrt(sqr(m_module->outerRadius()) + sqr(0.5*m_module->outerWidth())) + + 0.5*m_module->stereoAngle()*(0.5*m_module->outerWidth()) + moduleClearanceR; + + // Calculate clearance we have. NB. This is an approximate. + //std::cout << "Module clearance (radial value does not take into account stereo rotation:" << std::endl; + //std::cout << " radial: " << moduleClearanceR/CLHEP::mm << " mm" << std::endl; + //std::cout << " away from disc in z " << moduleClearanceZ/CLHEP::mm << " mm" << std::endl; + //std::cout << " Lo Module to cooling block: " << -m_moduleStagger-0.5*m_module->thickness() - m_moduleServicesLoOuterZPos << std::endl; + //std::cout << " Hi Module to cooling block: " << +m_moduleStagger-0.5*m_module->thickness() - m_moduleServicesHiOuterZPos << std::endl; + //std::cout << " Module to Module: " << m_moduleStagger-m_module->thickness() << std::endl; + //std::cout << " towards disc in z " + // << std::min(m_moduleStagger-m_module->thickness(), + // std::min(-m_moduleStagger-0.5*m_module->thickness() - m_moduleServicesLoOuterZPos, + // +m_moduleStagger-0.5*m_module->thickness() - m_moduleServicesHiOuterZPos)) / CLHEP::mm << " mm" << std::endl; + + m_thicknessOuter = 0.5 * m_module->thickness() + m_moduleStagger + moduleClearanceZ; + m_thicknessInner = m_maxModuleServicesBaseToRingCenter + 2*m_safety; + // We have to at least include 1*m_safety as the moduleservices envelope is increased by this amount. + // m_maxModuleServicesBaseToRingCenter is calculated in makeModuleServices() + + m_thickness = m_thicknessOuter + m_thicknessInner; + + // We want the center in z to be at the module mid plane. So we shift the volume. + double envelopeShift = -m_ringSide * (0.5 * m_thickness - m_thicknessOuter); + + SCT_MaterialManager materials; + const GeoTube * tmpShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness); + const GeoShape & ringEnvelopeShape = (*tmpShape << HepGeom::Translate3D(0, 0, envelopeShift)); + GeoLogVol * ringLog = new GeoLogVol(getName(), &ringEnvelopeShape, materials.gasMaterial()); + + //std::cout << "m_innerRadius = " << m_innerRadius << std::endl; + //std::cout << "m_outerRadius = " << m_outerRadius << std::endl; + + return ringLog; + +} + + + +GeoVPhysVol * +SCT_FwdRing::build(SCT_Identifier id) const +{ + + // Physical volume for the half ring + GeoPhysVol * ring = new GeoPhysVol(m_logVolume); + + double deltaPhi = 360*CLHEP::degree / m_numModules; + bool negativeEndCap = (id.getBarrelEC() < 0); + + for (int i = 0; i < m_numModules; i++){ + + // As used by the identifier + int idNumber = i; + + // Alternate upper/lower + int staggerUpperLower = m_firstStagger; + if (i%2) staggerUpperLower = -m_firstStagger; + + // The negative endcap is rotated and so we have to play some tricks to get the + // identifier numbering right. + + // In order to get the identifiers going in the direction of + // increasing phi we have to invert them in the negative endcap. + + // Although the endcaps differ slightly (some upper/lower swaps) we build them in much the same + // way and change just the numbering. + + // The id number for the detector element + int idModule = idNumber; + + if (negativeEndCap) { + // identifiers go in the opposite direction for the negative endcap. + // We renumber so that module number "moduleZero" becomes zero. + idModule = (m_numModules + m_moduleZero - idNumber) % m_numModules; + } + + //std::cout << "Endcap# = " <<id.getBarrelEC() + // << ", idModule = " << idModule + // << ", idModuleSimulation = " << idModuleSimulation + // << ", idModule2 = " << (idModuleSimulation & 0xffff) + // << ", max = " << ((idModuleSimulation & 0x00ff0000) >> 16) + // << ", moduleZero = " << ((idModuleSimulation & 0xff000000) >> 24) + // << std::endl; + + + // The module is a TRD with length along z-axis. + // We need to rotate this so length is along the y-axis + // This can be achieved with a 90 deg rotation around Y. + // This leaves the depth axis point in the -z direction which + // is correct for modules mounted on the -ve side (side closest to the IP, ringSide = -1). + // For modules mounted on the opposite side we + // rotate 180 around X so that the depth axis is pointing in the same direction as z. + // Finally we rotate about z by phi and the 0.5*stereo (ie the u-phi or v-phi orientation) + + // It is assumed that the module is centered on the physics center (center of sensor) + + double phi = i * deltaPhi + m_startAngle; + + //std::cout << "Endcap# = " <<id.getBarrelEC() + // << ", idModule = " << idModule + // << ", i = " << i + // << ", phi = " << phi/CLHEP::degree << std::endl; + + CLHEP::HepRotation rot; + rot.rotateY(90*CLHEP::degree); + if (m_ringSide > 0) { + rot.rotateX(180*CLHEP::degree); + } + rot.rotateZ(phi + 0.5 * m_module->stereoAngle() * m_stereoSign); + + double zPos = staggerUpperLower * m_moduleStagger * m_ringSide; + CLHEP::Hep3Vector xyz(m_module->sensorCenterRadius(), 0, zPos); + xyz.rotateZ(phi); + HepGeom::Transform3D modulePos(rot,xyz); + + + // Add the module + std::string moduleName = "FwdModuleR" + intToString(m_iRing) + "#" + intToString(idModule); + ring->add(new GeoNameTag(moduleName)); + ring->add(new GeoIdentifierTag(idModule)); + GeoAlignableTransform * moduleTransform = new GeoAlignableTransform(modulePos); + ring->add(moduleTransform); + id.setPhiModule(idModule); + GeoVPhysVol * modulePV = m_module->build(id); + ring->add(modulePV); + + // Store alignable transform + detectorManager()->addAlignableTransform(1, id.getWaferId(), moduleTransform, modulePV); + + // Add the moduleServices (contains the cooling block) + // In principle this should also be rotated by the stereo angle (although one + // would need to be care were the center of rotation is. However this is not + // really necessary for the services so we do not bother. + + double zModuleServices = 0; + double rModuleServices = 0; + GeoVPhysVol * moduleServices = 0; + if (staggerUpperLower > 0){ // Upper + zModuleServices = m_moduleServicesHiZPos * m_ringSide; + rModuleServices = m_moduleServicesHiRPos; + moduleServices = m_moduleServicesHi; + } else { // Lower + zModuleServices = m_moduleServicesLoZPos * m_ringSide; + rModuleServices = m_moduleServicesLoRPos; + moduleServices = m_moduleServicesLo; + } + + + ring->add(new GeoTransform(HepGeom::RotateZ3D(phi)*HepGeom::Translate3D(rModuleServices, 0, zModuleServices))); + ring->add(moduleServices); + + } + + return ring; +} + + + + + // These are offset in z by m_moduleStagger and one is rotated relative to the other by the + // 360/m_numModules. + + + +void +SCT_FwdRing::makeModuleServices() +{ + // Make an envelope to contain the two cooling blocks. Not sure if there much to gain by this + // rather than just adding the cooling blocks directly to the ring but it may help if we decide + // to add more things to it later. We call it module services. + + // Cooling blocks for the upper Modules + m_coolingBlockHiMain = new SCT_FwdCoolingBlock("CoolingBlkHiMain",SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::MAIN); + m_coolingBlockHiSec = new SCT_FwdCoolingBlock("CoolingBlkHiSec", SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::SECONDARY); + // Cooling blocks for the lower Modules + m_coolingBlockLoMain = new SCT_FwdCoolingBlock("CoolingBlkLoMain",SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::MAIN); + m_coolingBlockLoSec = new SCT_FwdCoolingBlock("CoolingBlkLoSec", SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::SECONDARY); + + double coolingBlkMainR = m_module->mainMountPointRadius(); + double coolingBlkSecR = m_module->endModuleRadius(); // This is the end of the module. Align block with the end. + double moduleServicesHiWidth = std::max(m_coolingBlockHiMain->rphi(), m_coolingBlockHiSec->rphi()); + double moduleServicesLoWidth = std::max(m_coolingBlockLoMain->rphi(), m_coolingBlockLoSec->rphi()); + double moduleServicesHiLength = std::abs(coolingBlkMainR - coolingBlkSecR) + 0.5 * m_coolingBlockHiMain->deltaR(); + double moduleServicesLoLength = std::abs(coolingBlkMainR - coolingBlkSecR) + 0.5 * m_coolingBlockLoMain->deltaR(); + double moduleServicesHiThickness = std::max(m_coolingBlockHiMain->thickness(), m_coolingBlockHiSec->thickness()); + double moduleServicesLoThickness = std::max(m_coolingBlockLoMain->thickness(), m_coolingBlockLoSec->thickness()); + + // Radial position of this services volume. The calculation depends on whether the main cooling block is at the outer or inner radius. + double moduleOrientation = (coolingBlkMainR > coolingBlkSecR) ? +1 : -1; + m_moduleServicesHiRPos = coolingBlkMainR + moduleOrientation * (0.5 * m_coolingBlockHiMain->deltaR() - 0.5 * moduleServicesHiLength); + m_moduleServicesLoRPos = coolingBlkMainR + moduleOrientation * (0.5 * m_coolingBlockLoMain->deltaR() - 0.5 * moduleServicesLoLength); + + // Radial position of the mid point of the secondary cooling block + double coolingBlkHiSecRMid = coolingBlkSecR + moduleOrientation * 0.5 * m_coolingBlockHiSec->deltaR(); + double coolingBlkLoSecRMid = coolingBlkSecR + moduleOrientation * 0.5 * m_coolingBlockLoSec->deltaR(); + + // z position. Set so the surface closest to the disc support is at a fixed distance relative to the disc support or ring center. + // The distance between the disc surface and cooling block surface is obtained from the cooling block. + // We average the number even though they are all the same. + double coolingBlockOffsetHi = 0.5 * (m_coolingBlockHiMain->offsetFromDisc() + m_coolingBlockHiSec->offsetFromDisc()); + double coolingBlockOffsetLo = 0.5 * (m_coolingBlockLoMain->offsetFromDisc() + m_coolingBlockLoSec->offsetFromDisc()); + double moduleServicesBaseToRingCenterHi = m_ringOffset - 0.5*m_discSupportThickness - coolingBlockOffsetHi; + double moduleServicesBaseToRingCenterLo = m_ringOffset - 0.5*m_discSupportThickness - coolingBlockOffsetLo; + m_maxModuleServicesBaseToRingCenter = std::max(moduleServicesBaseToRingCenterHi, moduleServicesBaseToRingCenterLo); + m_moduleServicesHiZPos = -(moduleServicesBaseToRingCenterHi - 0.5 * moduleServicesHiThickness); + m_moduleServicesLoZPos = -(moduleServicesBaseToRingCenterLo - 0.5 * moduleServicesLoThickness); + + // For checking clearance. Position of outer surface of module service with respect to the ring center. + // + m_moduleServicesHiOuterZPos = -(moduleServicesBaseToRingCenterHi - moduleServicesHiThickness); + m_moduleServicesLoOuterZPos = -(moduleServicesBaseToRingCenterLo - moduleServicesLoThickness); + + SCT_MaterialManager materials; + const GeoBox * moduleServicesHiShape = new GeoBox(0.5*moduleServicesHiLength + m_safety, + 0.5*moduleServicesHiWidth + m_safety, + 0.5*moduleServicesHiThickness + m_safety); + const GeoBox * moduleServicesLoShape = new GeoBox(0.5*moduleServicesLoLength + m_safety, + 0.5*moduleServicesLoWidth + m_safety, + 0.5*moduleServicesLoThickness + m_safety); + const GeoLogVol * moduleServicesHiLog = new GeoLogVol("ModuleServicesHi", moduleServicesHiShape, materials.gasMaterial()); + const GeoLogVol * moduleServicesLoLog = new GeoLogVol("ModuleServicesLo", moduleServicesLoShape, materials.gasMaterial()); + + m_moduleServicesHi = new GeoPhysVol(moduleServicesHiLog); + m_moduleServicesLo = new GeoPhysVol(moduleServicesLoLog); + + // Add the cooling blocks + // Main Upper + m_moduleServicesHi->add(new GeoTransform(HepGeom::Translate3D(coolingBlkMainR - m_moduleServicesHiRPos, 0, 0))); + m_moduleServicesHi->add(m_coolingBlockHiMain->getVolume()); + // Secondary Upper + m_moduleServicesHi->add(new GeoTransform(HepGeom::Translate3D(coolingBlkHiSecRMid - m_moduleServicesHiRPos, 0, 0))); + m_moduleServicesHi->add(m_coolingBlockHiSec->getVolume()); + // Main Lower + m_moduleServicesLo->add(new GeoTransform(HepGeom::Translate3D(coolingBlkMainR - m_moduleServicesLoRPos, 0, 0))); + m_moduleServicesLo->add(m_coolingBlockLoMain->getVolume()); + // Secondary Lower + m_moduleServicesLo->add(new GeoTransform(HepGeom::Translate3D(coolingBlkLoSecRMid - m_moduleServicesLoRPos, 0, 0))); + m_moduleServicesLo->add(m_coolingBlockLoSec->getVolume()); +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx new file mode 100755 index 00000000000..97bb0348154 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx @@ -0,0 +1,54 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdRingCooling.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Units/PhysicalConstants.h" // For pi + +#include <cmath> + +inline double sqr(double x) {return x*x;} + +SCT_FwdRingCooling::SCT_FwdRingCooling(const std::string & name, int ringType) + : SCT_SharedComponentFactory(name), m_ringType(ringType) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdRingCooling::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName= parameters->fwdRingCoolingMaterial(m_ringType); + m_innerRadius = parameters->fwdRingCoolingInnerRadius(m_ringType); + m_outerRadius = parameters->fwdRingCoolingOuterRadius(m_ringType); + m_thickness = parameters->fwdRingCoolingThickness(m_ringType); + m_numModules = parameters->fwdRingNumModules(m_ringType); +} + +GeoVPhysVol * +SCT_FwdRingCooling::build() +{ + SCT_MaterialManager materials; + + const GeoTube * ringCoolingShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness); + m_material = materials.getMaterialForVolume(m_materialName, ringCoolingShape->volume()); + const GeoLogVol * ringCoolingLog = new GeoLogVol(getName(), ringCoolingShape, m_material); + + GeoPhysVol * ringCooling = new GeoPhysVol(ringCoolingLog); + + return ringCooling; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx new file mode 100755 index 00000000000..6a1ee6fc137 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx @@ -0,0 +1,361 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/////////////////////////////////////////////// +// Simulation for the COMBINED TESTBEAM 2004 // +// // +// Zdenka.Broklova@matfyz.cz // +// Carlos.Escobar@ific.uv.es // +// Peter.Kodys@ific.uv.es // +// January 23, 2004 // +/////////////////////////////////////////////// + +#include "SCT_GeoModel/SCT_FwdSensor.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_ForwardModuleParameters.h" + +#include "SCT_GeoModel/SCT_Identifier.h" + +#include "GeoModelKernel/GeoTrd.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" +#include "InDetReadoutGeometry/SCT_ForwardModuleSideDesign.h" +#include "InDetReadoutGeometry/SiDetectorElement.h" +#include "InDetReadoutGeometry/SiCommonItems.h" +#include "InDetReadoutGeometry/InDetDD_Defs.h" + +#include <cmath> + +using namespace InDetDD; + + +SCT_FwdSensor::SCT_FwdSensor(const std::string & name, + int ringType) + : SCT_UniqueComponentFactory(name), m_ringType(ringType) +{ + getParameters(); + m_logVolume = preBuild(); +} + + + +void +SCT_FwdSensor::getParameters() +{ + + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + SCT_MaterialManager materials; + + m_materialSensor = materials.getMaterial(parameters->fwdSensorMaterialFar(m_ringType)); + + + m_materialGlass = 0; + if (m_ringType == 2) { // Only need to define glass if its a Truncated middle module. + m_materialGlass = materials.getMaterial(parameters->fwdSensorMaterialNear(m_ringType)); + } + + m_thicknessN = m_thicknessF = parameters->fwdSensorThickness(m_ringType); + + + m_innerWidthF = parameters->fwdSensorInnerWidthFar(m_ringType); + m_outerWidthF = parameters->fwdSensorOuterWidthFar(m_ringType); + m_lengthF = parameters->fwdSensorLengthFar(m_ringType); + m_radiusF = parameters->fwdSensorRadiusFar(m_ringType); + + m_innerWidthN = parameters->fwdSensorInnerWidthNear(m_ringType); + m_outerWidthN = parameters->fwdSensorOuterWidthNear(m_ringType); + m_lengthN = parameters->fwdSensorLengthNear(m_ringType); + m_radiusN = parameters->fwdSensorRadiusNear(m_ringType); + + if (m_ringType == 3) { + // For Inner Module only use number for far sensor. + m_innerRadius = m_radiusF - 0.5 * m_lengthF; + m_innerWidth = m_innerWidthF; + } else { + m_innerRadius = m_radiusN - 0.5 * m_lengthN; + m_innerWidth = m_innerWidthN; + } + m_outerWidth = m_outerWidthF; + m_outerRadius = m_radiusF + 0.5 * m_lengthF; + + m_activeHalfLengthFar = parameters->fwdSensorActiveHalfLengthFar(m_ringType); + m_activeHalfLengthNear = parameters->fwdSensorActiveHalfLengthNear(m_ringType); + + if (m_ringType == 3) { // Inner + m_sensorRadius = m_radiusF; + } else { + m_sensorRadius = 0.5 * (m_radiusF + m_activeHalfLengthFar + + m_radiusN - m_activeHalfLengthNear); + } + + // For truncated middle the sensor is offset from what it would be if it was a full middle. + m_sensorOffset = 0; + if (m_ringType == 2) { // truncated middle + m_sensorOffset = m_radiusF - m_sensorRadius; + } + + //std::cout << "SCT_FwdSensor : " << std::endl; + //std::cout << " ringType = " << m_ringType << std::endl; + //std::cout << " sensorCenterRadius = " << m_sensorRadius << std::endl; + //std::cout << " innerRadius = " << m_innerRadius << std::endl; + //std::cout << " outerRadius = " << m_outerRadius << std::endl; + + + + + // The thickness of the two are the same, but to be pedantic. + m_thickness = std::max(m_thicknessF, m_thicknessN); + + +} + + + +const GeoLogVol * SCT_FwdSensor::preBuild() +{ + + const GeoTrd * sensorShapeF = new GeoTrd(0.5 * m_thicknessF, 0.5 * m_thicknessF, + 0.5 * m_innerWidthF, 0.5 * m_outerWidthF, + 0.5 * m_lengthF); + + + const GeoTrd * sensorShapeN= 0; + if (m_ringType != 3) { + sensorShapeN= new GeoTrd(0.5 * m_thicknessN, 0.5 * m_thicknessN, + 0.5 * m_innerWidthN, 0.5 * m_outerWidthN, + 0.5 * m_lengthN); + } + + + const GeoShape * sensorShape = 0; + if ((m_ringType == 2) || (m_ringType == 3)) { + // For truncated middle and inner there is only one wafer. + sensorShape = sensorShapeF; + } else { + // For outer and middle there are two wafers. We + // define the sensor as a boolean volume of the two wafers. + // relative position of near sensor + double positionNearZ = m_radiusN - m_sensorRadius; + const GeoShape & sensorPosN = (*sensorShapeN<< HepGeom::TranslateZ3D(positionNearZ)) ; + // relative position of near sensor + double positionFarZ = m_radiusF - m_sensorRadius; + const GeoShape & sensorPosF = (*sensorShapeF<< HepGeom::TranslateZ3D(positionFarZ) ); + sensorShape = &(sensorPosF.add(sensorPosN)); + } + + const GeoLogVol * sensorLog; + sensorLog = new GeoLogVol(getName(), sensorShape, m_materialSensor); + + + + if (m_ringType == 2) { + // Make inactive glass sensor. + double positionZ = m_radiusN - m_sensorRadius; + const GeoShape & sensorPosN = (*sensorShapeN<< HepGeom::TranslateZ3D(positionZ) ); + GeoLogVol * inactiveLog = new GeoLogVol(getName()+"Glass", &sensorPosN, m_materialGlass); + m_inactive = new GeoPhysVol(inactiveLog); + } else { + m_inactive = NULL; + } + + // Make the moduleside design for this sensor + makeDesign(); + + detectorManager()->addDesign(m_design); + + return sensorLog; +} + +void SCT_FwdSensor::makeDesign() +{ + + // The designs require a name when put in the collection + // but usually the design is accessed through SiDetectorElement + // and so is not generally acessesed through the DesignCollection. + + // Design names are no longer used/needed, but might be used in the future for + // information purposes. + /* + std::string designName; + switch (m_ringType) { + case 0: // Outer + designName = "SCT:ForwardRing1G3"; + break; + case 1: // Middle + designName = "SCT:ForwardRing2G3"; + break; + case 2: // Truncated Middle + designName = "SCT:ForwardRing3G3"; + break; + case 3: // Inner + designName = "SCT:ForwardRing4G3"; + break; + default: + break; + } + */ + + // These can no longer be user defined and are ignored. + //SiDetectorDesign::Axis etaAxis = SiDetectorDesign::zAxis; + //SiDetectorDesign::Axis phiAxis = SiDetectorDesign::yAxis; + //SiDetectorDesign::Axis depthAxis = SiDetectorDesign::xAxis; + + + // SCT_ForwardModuleSideDesign Constructor with parameters: + // local axis corresponding to eta direction + // local axis corresponding to phi direction + // local axis corresponding to depth direction + // thickness of silicon sensor + // number of crystals within module side + // number of diodes within crystal + // number of cells within module side + // index of diode connected to cell with index 0 + // radius from inner crystal center to beam + // inner crystal half height + // radius from outer crystal (if present) center to beam + // outer crystal (if present) half height + // strip step in angle (same for both crystals) + // eta coordinate of crystal center + // phi coordinate of crystal center + + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + + double radius1=0; + double radius2=0; + double halfHeight1=0; + double halfHeight2=0; + int crystals=0; + + switch (m_ringType) { + case 0: // Outer Module + case 1: // Full Middle module + crystals = 2; + radius1 = m_radiusN; + radius2 = m_radiusF; + halfHeight1 = m_activeHalfLengthNear; + halfHeight2 = m_activeHalfLengthFar; + break; + case 2: // Truncated Middle Module + case 3: // Inner Module + crystals = 1; + radius1 = m_radiusF; + radius2 = 0.; + halfHeight1 = m_activeHalfLengthFar; + halfHeight2 = 0.; + break; + default: + std::cout << "ERROR!!!! SCT_FwdSensor: Invalid ring type" << std::endl; + } + + double etaCenter = 0; + double phiCenter = 0; + + //int cells = parameters->fwdSensorNumReadoutStrips(); + //int diodes = parameters->fwdSensorNumStrips(); + //int shift = parameters->fwdSensorStripShift(); + // For consistency with older version we keep shift = 0. + int cells = parameters->fwdSensorNumReadoutStrips(m_ringType); + int diodes = cells; + int shift = 0; + + double step = parameters->fwdSensorAngularPitch(m_ringType); + +/* + std::cout << "ZB -----------------" << cells << " " << std::endl; + std::cout << radius1 << " " << radius2 << " " << halfHeight1 << " " << halfHeight2 << std::endl; +*/ + + // Readout direction is same direction as local phi direction for outer module + // and the opposite direction for inner and middle module. + bool swapStripReadout = (m_ringType != 0); // ie false for outer module only. + + // The readout side is at the +ve depth direction + int readoutSide = +1; + + m_design = new SCT_ForwardModuleSideDesign(m_thicknessN, + crystals, + diodes, + cells, + shift, + swapStripReadout, + InDetDD::holes, + radius1, + halfHeight1, + radius2, + halfHeight2, + step, + etaCenter, + phiCenter, + readoutSide); + + // + // Flags to signal if axis can be swapped. + // For trapezoid z axis (xEta) cannot be swapped. + // This is the default and no action is required. + // Can force axes not to be swapped by setting to false. + // + // bool phiSyCLHEP::mmetric = true; + // bool etaSyCLHEP::mmetric = false; + // bool depthSyCLHEP::mmetric = true; + // m_design->setSyCLHEP::mmetry(phiSyCLHEP::mmetric, etaSyCLHEP::mmetric, depthSyCLHEP::mmetric, + // + +} + + + +GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id) const +{ + + + + GeoFullPhysVol * sensor = new GeoFullPhysVol(m_logVolume); + + // Make detector element and add to collection + // Only do so if we have a valid id helper. + //id.print(); // for debugging only + + SiCommonItems* commonItems = geometryManager()->commonItems(); + + if (commonItems->getIdHelper()) { + + SiDetectorElement * detElement = new SiDetectorElement(id.getWaferId(), + m_design, + sensor, + commonItems); + + // Add the detector element. + detectorManager()->addDetectorElement(detElement); + + } else { + // std::cout << " ZB --> build - warning" << std::endl; + static bool noElementWarning = true; // So we don't get the message thousands of times. + if (noElementWarning) { + std::cout << "WARNING!!!!: No SCT id helper and so no elements being produced." << std::endl; + noElementWarning = false; + } + } + + return sensor; +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx new file mode 100755 index 00000000000..62f892cb328 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx @@ -0,0 +1,107 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/////////////////////////////////////////////// +// Simulation for the COMBINED TESTBEAM 2004 // +// // +// Zdenka.Broklova@matfyz.cz // +// Carlos.Escobar@ific.uv.es // +// Peter.Kodys@ific.uv.es // +// January 23, 2004 // +/////////////////////////////////////////////// + +#include "SCT_GeoModel/SCT_FwdSpine.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardModuleParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "GeoModelKernel/GeoShapeUnion.h" + +#include "CLHEP/Units/SystemOfUnits.h" + +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <cmath> + + +SCT_FwdSpine::SCT_FwdSpine(const std::string & name, + int ringType) + : SCT_SharedComponentFactory(name), m_ringType(ringType) +{ + getParameters(); + m_physVolume = build(); +} + + + +void +SCT_FwdSpine::getParameters() +{ + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + + m_materialName = parameters->fwdSpineMaterial(m_ringType); + + //Main spine + m_thickness = parameters->fwdSpineThickness(m_ringType); + m_width = parameters->fwdSpineWidth(m_ringType); + + + m_moduleCenterToEndTmp = parameters->fwdSpineEndToModuleCenter(m_ringType); + // FIXME: More accurate definition is + m_moduleCenterToEnd = parameters->fwdModuleDistBtwMountPoints(m_ringType) + - parameters->fwdModuleMountPoint(m_ringType) + + parameters->fwdSpineEndLocatorToEndMount(m_ringType); + //m_length = parameters->fwdSpineEndToModuleCenter(m_ringType) + // + parameters->fwdModuleMountPoint(m_ringType) + // - parameters->fwdHybridMountPointToInnerEdge() + // - parameters->fwdModuleHybridEdgeToSpine(); + // FIXME: Better definition would be + m_length = parameters->fwdModuleDistBtwMountPoints(m_ringType) + parameters->fwdSpineEndLocatorToEndMount(m_ringType) + - parameters->fwdHybridMountPointToInnerEdge() + - parameters->fwdModuleHybridEdgeToSpine(m_ringType); + + // (zssp[m_ringType].spndox + zsmi[m_ringType].mountd - zhyb->hybysh - zhyb->hybgap0) * CLHEP::cm; + +} + +GeoVPhysVol * +SCT_FwdSpine::build() +{ + + + // Build the spine. Just a simple box. Its orientated for building a module in a trapezoid so the spine + // has its length along the z axis, width along the y axis and thickness along the x axis. + + const GeoBox * spineShapeMain = new GeoBox( 0.5*m_thickness, 0.5*m_width, 0.5*m_length); + + double position; + + int HybPos; + if (m_ringType == 0) { HybPos = -1; } // outer module, hybrid in inner side + else { HybPos = 1; } //hybrid in outer side + + // shift between module center and spine center. + position = (0.5*m_length - m_moduleCenterToEndTmp) * HybPos; + //position = zsmi[m_ringType].mountd - zhyb->hybysh - zhyb->hybgap0 - zssp[m_ringType].spndox; + + //position = position / 2. * HybPos; + + SCT_MaterialManager materials; + + const GeoShape & spinePosMain = (*spineShapeMain << HepGeom::TranslateZ3D(position) ); + m_material = materials.getMaterialForVolume(m_materialName, spineShapeMain->volume()); + GeoLogVol * spineLog = new GeoLogVol(getName(), &spinePosMain, m_material); + GeoPhysVol * spine = new GeoPhysVol(spineLog); + + return spine; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx new file mode 100755 index 00000000000..34a6770c424 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx @@ -0,0 +1,134 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/////////////////////////////////////////////// +// Simulation for the COMBINED TESTBEAM 2004 // +// // +// Zdenka.Broklova@matfyz.cz // +// Carlos.Escobar@ific.uv.es // +// Peter.Kodys@ific.uv.es // +// January 23, 2004 // +/////////////////////////////////////////////// + +#include "SCT_GeoModel/SCT_FwdSubSpine.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardModuleParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "GeoModelKernel/GeoShapeUnion.h" + +#include "CLHEP/Units/SystemOfUnits.h" + +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <cmath> + + +SCT_FwdSubSpine::SCT_FwdSubSpine(const std::string & name, + int ringType, int spineSide) + : SCT_SharedComponentFactory(name), m_ringType(ringType), m_spineSide(spineSide) +{ + getParameters(); + m_physVolume = build(); +} + + + +void +SCT_FwdSubSpine::getParameters() +{ + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->fwdSubSpineMaterial(m_ringType)); + + // Width is in direction of module width (ie long axis of arm) + // Length is in direction of module length (ie short axis of arm) + + //Inner subspine + m_thickness1 = parameters->fwdSpineThickness(m_ringType); + m_width1 = parameters->fwdSubSpineInnerWidth(m_ringType); + m_length1 = parameters->fwdSubSpineInnerLength(m_ringType); + //Middle subspine + m_thickness2 = parameters->fwdSpineThickness(m_ringType); + m_width2 = parameters->fwdSubSpineMiddleWidth(m_ringType); + m_length2 = parameters->fwdSubSpineMiddleLength(m_ringType); + //Outer subspine + m_thickness3 = parameters->fwdSpineThickness(m_ringType); + m_width3 = parameters->fwdSubSpineOuterWidth(m_ringType); + m_length3 = parameters->fwdSubSpineOuterLength(m_ringType); +} + +GeoVPhysVol * SCT_FwdSubSpine::build() +{ + // x,y,z are in the geomodel module coordinates + + const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + + const GeoBox * spineShape1 = new GeoBox( m_thickness1/2., m_width1/2., m_length1/2.); + const GeoBox * spineShape2 = 0; + if (m_ringType != 3) spineShape2 = new GeoBox( m_thickness2/2., m_width2/2., m_length2/2.); + const GeoBox * spineShape3 = new GeoBox( m_thickness3/2., m_width3/2., m_length3/2.); + + + double position, position2; + + int HybPos; + + if (m_ringType == 0) { HybPos = -1; } // outer module, hybrid in inner side + else { HybPos = 1; } //hybrid in outer side + + + double widthMain = parameters->fwdSpineWidth(m_ringType); // width of main spine + + + const GeoShape * subSpineMiddle = 0; + const GeoShape * subSpineShape = 0; + + // Inner sub spine + double mountPosition = parameters->fwdModuleMountPoint(m_ringType); // mount point to physics center + position = mountPosition - parameters->fwdSubSpineInnerRefDist(m_ringType) - 0.5*m_length1; + position = position * HybPos; + position2 = (widthMain + m_width1) / 2.; + const GeoShape & spinePos1 = (*spineShape1 << HepGeom::TranslateY3D(m_spineSide * position2) << HepGeom::TranslateZ3D(position) ); + + + // Middle sub spine + // Not defined for inner module. + if (m_ringType != 3) { + position = mountPosition - parameters->fwdSubSpineMiddleRefDist(m_ringType) - 0.5*m_length2; + position = position * HybPos; + position2 = (widthMain + m_width2) / 2.; + const GeoShape & spinePos2 = (*spineShape2 << HepGeom::TranslateY3D(m_spineSide * position2) << HepGeom::TranslateZ3D(position) ); + subSpineMiddle = &spinePos2; + } + + // Outer sub spine + position = mountPosition - parameters->fwdSubSpineOuterRefDist(m_ringType) - 0.5*m_length3; + position = position * HybPos; + position2 = (widthMain + m_width3) / 2.; + const GeoShape & spinePos3 = (*spineShape3 << HepGeom::TranslateY3D(m_spineSide * position2) << HepGeom::TranslateZ3D(position) ); + + const GeoShapeUnion & spineTmp = (spinePos1).add(spinePos3); + if (m_ringType != 3) { + const GeoShapeUnion & spineTmp2 = spineTmp.add(*subSpineMiddle); + subSpineShape = &spineTmp2; + } else { + subSpineShape = &spineTmp; + } + + GeoLogVol * spineLog = new GeoLogVol(getName(), subSpineShape, m_material); + GeoPhysVol * spine = new GeoPhysVol(spineLog); + + return spine; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx new file mode 100755 index 00000000000..6da8b36f7f7 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx @@ -0,0 +1,56 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdSupportFrame.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_FwdSupportFrame::SCT_FwdSupportFrame(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdSupportFrame::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName = parameters->fwdSupportFrameMaterial(); + m_thickness = parameters->fwdSupportFrameRadialThickness(); + m_innerRadius = parameters->fwdSupportFrameInnerRadius(); + m_zMin = parameters->fwdSupportFrameZMin(); + m_zMax = parameters->fwdSupportFrameZMax(); + + m_outerRadius = m_innerRadius + m_thickness; + m_length = m_zMax - m_zMin; + +} + +GeoVPhysVol * +SCT_FwdSupportFrame::build() +{ + SCT_MaterialManager materials; + + // Make the support disk. A simple tube. + const GeoTube * supportFrameShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + m_material = materials.getMaterialForVolume(m_materialName, supportFrameShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol * supportFrameLog = new GeoLogVol(getName(), supportFrameShape, m_material); + + GeoPhysVol * supportFrame = new GeoPhysVol(supportFrameLog); + + return supportFrame; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx new file mode 100755 index 00000000000..8c9f7518517 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx @@ -0,0 +1,56 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdThermalShieldElement.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include <cmath> + +SCT_FwdThermalShieldElement::SCT_FwdThermalShieldElement(const std::string & name, int iElement) + : SCT_SharedComponentFactory(name), m_iElement(iElement) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_FwdThermalShieldElement::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_materialName = parameters->fwdThermalShieldMaterial(m_iElement); + m_innerRadius = parameters->fwdThermalShieldInnerRadius(m_iElement); + m_outerRadius = parameters->fwdThermalShieldOuterRadius(m_iElement); + m_zMin = parameters->fwdThermalShieldZMin(m_iElement); + m_zMax = parameters->fwdThermalShieldZMax(m_iElement); + + m_length = std::abs(m_zMax - m_zMin); + +} + +GeoVPhysVol * +SCT_FwdThermalShieldElement::build() +{ + SCT_MaterialManager materials; + + // Make the support disk. A simple tube. + const GeoTube * elementShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + m_material = materials.getMaterialForVolume(m_materialName, elementShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol * elementLog = new GeoLogVol(getName(), elementShape, m_material); + + GeoPhysVol * element = new GeoPhysVol(elementLog); + + return element; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx new file mode 100755 index 00000000000..77ab13df415 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx @@ -0,0 +1,550 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_FwdWheel.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" + +#include "SCT_GeoModel/SCT_FwdModule.h" +#include "SCT_GeoModel/SCT_FwdRing.h" +#include "SCT_GeoModel/SCT_FwdDiscSupport.h" +#include "SCT_GeoModel/SCT_FwdPatchPanel.h" +#include "SCT_GeoModel/SCT_FwdPPConnector.h" +#include "SCT_GeoModel/SCT_FwdPPCooling.h" +#include "SCT_GeoModel/SCT_FwdFSI.h" +#include "SCT_GeoModel/SCT_FwdDiscPowerTape.h" +#include "SCT_GeoModel/SCT_FwdRingCooling.h" +#include "SCT_GeoModel/SCT_FwdOptoHarness.h" +#include "SCT_GeoModel/SCT_FwdDiscFixation.h" + +#include "SCT_GeoModel/SCT_FSIHelper.h" + +#include "InDetGeoModelUtils/ExtraMaterial.h" +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + + +#include <sstream> +#include <cmath> + +#include <iostream> + +inline double sqr(double x) {return x*x;} + +SCT_FwdWheel::SCT_FwdWheel(const std::string & name, + int iWheel, + const std::vector<const SCT_FwdModule *> & modules, + int ec) + : SCT_UniqueComponentFactory(name), + m_iWheel(iWheel), + m_endcap(ec), + m_pPConnector(0), + m_pPCooling(0), + m_discFixation(0), + m_modules(modules) +{ + getParameters(); + //m_logVolume = 0; + m_logVolume = preBuild(); + +} + +SCT_FwdWheel::~SCT_FwdWheel() +{ + delete m_discSupport; + for (unsigned int iRing = 0; iRing < m_rings.size(); iRing++){ + delete m_rings[iRing]; + } + for (unsigned int iPPType = 0; iPPType < m_patchPanel.size(); iPPType++) { + delete m_patchPanel[iPPType]; + } + + if (m_pPConnectorPresent) delete m_pPConnector; + if (m_pPCoolingPresent) delete m_pPCooling; + if (m_discFixationPresent) delete m_discFixation; + + for (unsigned int iFSI = 0; iFSI < m_fsiType.size(); iFSI++) { + delete m_fsiType[iFSI]; + } +} + +void +SCT_FwdWheel::getParameters() +{ + const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + + m_zPosition = parameters->fwdWheelZPosition(m_iWheel); + m_numRings = parameters->fwdWheelNumRings(m_iWheel); + for (int iRing = 0; iRing < m_numRings; iRing++) { + m_ringType.push_back(parameters->fwdWheelModuleType(m_iWheel,iRing, m_endcap)); + //m_ringSide.push_back(parameters->fwdWheelRingSide(m_iWheel,iRing, m_endcap)); + //m_ringStereoType.push_back(parameters->fwdWheelStereoType(m_iWheel)); + } + + m_numPatchPanelLocs = parameters->fwdNumPatchPanelLocs(); + m_numPatchPanelTypes = parameters->fwdNumPatchPanelTypes(); + + for (int iPPLoc = 0; iPPLoc < m_numPatchPanelLocs; iPPLoc++) { + m_patchPanelType.push_back(parameters->fwdPatchPanelType(iPPLoc)); + m_patchPanelLocAngle.push_back(parameters->fwdPatchPanelLocAngle(iPPLoc)); + m_patchPanelRepeatQuadrant.push_back(parameters->fwdPatchPanelRepeatQuadrant(iPPLoc)); + } + + // FIXME: Check and put these in DB or calculate them + // We have a maximum width of 80.2. Make it 75 for some clearance. + //m_innerRadius = 267 * CLHEP::mm; + //m_outerRadius = 590 * CLHEP::mm; + //m_thickness = 100 * CLHEP::mm; + // These get swapped later if the wheel is rotated. + m_thicknessFront = 30 * CLHEP::mm; + m_thicknessBack = 45 * CLHEP::mm; + + m_numFSITypes = parameters->fwdFSINumGeomTypes(); + m_fsiVector = &(parameters->fsiVector(m_iWheel)); + + m_numWheels = parameters->fwdNumWheels(); + + m_optoHarnessPresent = parameters->fwdOptoHarnessPresent(); + m_pPConnectorPresent = parameters->fwdPPConnectorPresent(); + m_pPCoolingPresent = parameters->fwdPPCoolingPresent(); + + m_discFixationPresent = parameters->fwdDiscFixationPresent(); + if(m_discFixationPresent) { + for (int iLoc = 0; iLoc < parameters->fwdNumCylinderServiceLocs(); iLoc++) { + // Disc fixations are at same locations at as N2 pipes + if(parameters->fwdCylinderServiceLocName(iLoc) == "NPipe") { + m_discFixationLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); + } + } + } + + m_safety = geometryManager()->generalParameters()->safety(); + + // Set numerology + detectorManager()->numerology().setNumRingsForDisk(m_iWheel,m_numRings); + +} + +const GeoLogVol * +SCT_FwdWheel::preBuild() +{ + + // Create disc support. + m_discSupport = new SCT_FwdDiscSupport("DiscSupport"+intToString(m_iWheel), m_iWheel); + + + // The rings + for (int iRing = 0; iRing < m_numRings; iRing++){ + std::string ringName = "Ring"+intToString(iRing)+"For"+getName(); + int ringType = m_ringType[iRing]; + m_rings.push_back(new SCT_FwdRing(ringName, m_modules[ringType], m_iWheel, iRing, m_endcap)); + } + + + // Create Patch Panel + //m_patchPanel = new SCT_FwdPatchPanel("PatchPanel"+intToString(m_iWheel), m_iWheel); + for (int iPPType = 0; iPPType < m_numPatchPanelTypes; iPPType++) { + m_patchPanel.push_back(new SCT_FwdPatchPanel("PatchPanel"+intToString(iPPType), iPPType)); + } + + // Create Patch Pannel Connector and Cooling, and disc Fixations + if(m_pPConnectorPresent) {m_pPConnector = new SCT_FwdPPConnector("PPConnector");} + if(m_pPCoolingPresent) {m_pPCooling = new SCT_FwdPPCooling("PPCooling");} + if(m_discFixationPresent) {m_discFixation = new SCT_FwdDiscFixation("DiscFixation");} + + + // Calculate total number of modules + m_totalModules = 0; + for (int iRing = 0; iRing < m_numRings; iRing++){ + m_totalModules += m_rings[iRing]->numModules(); + } + + + // Create the FSI types + m_fsiType.resize(m_numFSITypes); + for (unsigned int iFSI = 0; iFSI < m_fsiVector->size(); iFSI++) { + int type = (*m_fsiVector)[iFSI]->simType(); + if (!m_fsiType[type]) { + m_fsiType[type] = new SCT_FwdFSI("FSI"+intToString(type), type); + } + } + + + + // Calculate the extent of the envelope + // Use support disc as starting values. + double maxOuterRadius = m_discSupport->outerRadius(); + double minInnerRadius = m_discSupport->innerRadius(); + double maxModuleThickness = 0.5 * m_discSupport->thickness(); + + // Extend min max accounting for rings + for (int iRing = 0; iRing < m_numRings; iRing++){ + maxOuterRadius = std::max(m_rings[iRing]->outerRadius(), maxOuterRadius); + minInnerRadius = std::min(m_rings[iRing]->innerRadius(), minInnerRadius); + maxModuleThickness = std::max(maxModuleThickness, m_rings[iRing]->thicknessOuter() + m_rings[iRing]->ringOffset()); + } + m_ringMaxRadius = maxOuterRadius; + + // If first or last wheel there is nothing protruding beyond the rings so we reduce the + // envelope size. Comes to about 20 mm. Note the front becomes the back later for the last wheel. + if ((m_iWheel == 0) || (m_iWheel == m_numWheels - 1)) { + m_thicknessFront = maxModuleThickness + 1*CLHEP::mm; // We give plenty of safety as we have the room. + // But now modified by disc fixations + if(m_discFixationPresent) { + m_thicknessFront = std::max(m_thicknessFront,m_discFixation->radius() + m_safety); + } + } + + // The outer radius is now defined by the patch panel cooling if present + if(m_pPCoolingPresent) { + double ppCoolingOuterRadius = sqrt(sqr(m_patchPanel[2]->outerRadius() + m_pPCooling->deltaR()) + sqr(m_pPCooling->rphi())) + m_safety; + maxOuterRadius = std::max(ppCoolingOuterRadius, maxOuterRadius); + } + + // Or maybe by the disc fixations... + if(m_discFixationPresent) { + double discFixationOuterRadius = sqrt(sqr(m_ringMaxRadius + m_discFixation->thickness() + m_safety) + sqr(m_discFixation->radius())) + m_safety; + maxOuterRadius = std::max(discFixationOuterRadius, maxOuterRadius); + } + + m_rotateWheel = +1; // +1 normal, -1 rotate (ie last wheel) + if (m_numRings > 0) { // Should always be true + m_rotateWheel = (m_rings[0]->discRotated()) ? -1 : +1 ; + } + + // swap thickness front/back (this only happens for the last wheel). + if (m_rotateWheel < 0) { + double tmp = m_thicknessFront; + m_thicknessFront = m_thicknessBack; + m_thicknessBack = tmp; + } + + // std::cout << " Wheel front thickness = " << m_thicknessFront << std::endl; + // std::cout << " Wheel back thickness = " << m_thicknessBack << std::endl; + m_thickness = m_thicknessFront + m_thicknessBack; + + + + m_innerRadius = minInnerRadius - m_safety; + m_outerRadius = maxOuterRadius + m_safety; + + // TODO. Have to account for FSI and patch panels + //m_thickness = 2. * maxRingOffset + maxThickness; + // m_thickness = 100 * CLHEP::mm; + + // std::cout << "Wheel " << m_iWheel << ":" << std::endl; + // std::cout << " innerRadius = " << m_innerRadius << std::endl; + // std::cout << " outerRadius = " << m_outerRadius << std::endl; + // std::cout << " thickness = " << m_thickness << std::endl; + + // Make envelope for the wheel + SCT_MaterialManager materials; + + double envelopeShift = 0.5*(m_thicknessBack - m_thicknessFront); + const GeoTube * tmpShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness); + const GeoShape & fwdWheelEnvelopeShape = *tmpShape << HepGeom::Translate3D(0, 0, envelopeShift); + + const GeoLogVol * fwdWheelLog = + new GeoLogVol(getName(), &fwdWheelEnvelopeShape, materials.gasMaterial()); + + + return fwdWheelLog; + +} + +GeoVPhysVol * +SCT_FwdWheel::build(SCT_Identifier id) const +{ + + //std::cout << "SCT_FwdWheel: Building Wheel " << m_iWheel << std::endl; + + GeoFullPhysVol * wheel = new GeoFullPhysVol(m_logVolume); + + // Add discsupport. Its centered so no need for a transform + wheel->add(m_discSupport->getVolume()); + + // + // Loop over rings and put in rings, cooling and power tapes. + // + double powerTapeZPlusMax = 0.5 * m_discSupport->thickness(); + double powerTapeZMinusMax = -0.5 * m_discSupport->thickness(); + + double maxZOfRingsFront = 0; + + for (int iRing = 0; iRing < m_numRings; iRing++){ + + const SCT_FwdRing * ring = m_rings[iRing]; + + // Position ring + double ringZpos = ring->ringSide() * ring->ringOffset(); + // std::cout << "Wheel, ring = " << m_iWheel << ", " << iRing << std::endl; + // std::cout << " ringZpos, thickness = " << ringZpos << ", " << ring->thickness() << std::endl; + double ringOuterZ = ring->ringOffset() + ring->thicknessOuter(); + // std::cout << " ring outer z = " << ringOuterZ << std::endl; + maxZOfRingsFront = std::max(maxZOfRingsFront, ringOuterZ); + // std::cout << " ring inner radius = " << ring->innerRadius() << std::endl; + // std::cout << " ring outer radius = " << ring->outerRadius() << std::endl; + + + CLHEP::Hep3Vector pos(0, 0, ringZpos); + std::string ringNameTag = "Ring#" + intToString(ring->identifier()); + wheel->add(new GeoNameTag(ringNameTag)); + wheel->add(new GeoIdentifierTag(ring->identifier())); + wheel->add(new GeoTransform(HepGeom::Translate3D(pos))); + id.setEtaModule(ring->identifier()); + wheel->add(ring->build(id)); + + // Position cooling + // Get a pointer to the cooling ring. + SCT_FwdRingCooling cooling("RingCoolingW"+intToString(m_iWheel)+"R"+intToString(iRing), + iRing); + double coolingZpos = ring->ringSide() * (0.5*(m_discSupport->thickness() + cooling.thickness())); + //std::cout << "coolingZpos, thickness = " << coolingZpos << ", " << cooling->thickness() << std::endl; + wheel->add(new GeoTransform(HepGeom::TranslateZ3D(coolingZpos))); + wheel->add(cooling.getVolume()); + + // Power Tapes + // Get a pointer to the power tape + SCT_FwdDiscPowerTape powerTape("PowerTapeW"+intToString(m_iWheel)+ + "R"+intToString(iRing), iRing); + + double powerTapeZpos = ring->ringSide() * (0.5*(m_discSupport->thickness() + powerTape.thickness()) + + cooling.thickness()); + //std::cout << "powerTapeZpos, thickness = " << powerTapeZpos << ", " << powerTape->thickness() << std::endl; + + // Make sure we don't overlap with powertape from outer rings + // We store max extent of power tape for each side (Plus, Minus) + // This is really only ever an issue for ring2 but we keep it general. + if (ring->ringSide() > 0) { + double powerTapeZstart = powerTapeZpos - 0.5 * powerTape.thickness(); + if (powerTapeZstart < powerTapeZPlusMax) { + powerTapeZpos = powerTapeZPlusMax + 0.5 * powerTape.thickness(); + //std::cout << "Moving power tape!!!" << std::endl; + } + powerTapeZPlusMax = powerTapeZpos + 0.5 * powerTape.thickness(); + } else { + double powerTapeZstart = powerTapeZpos + 0.5 * powerTape.thickness(); + if (powerTapeZstart > powerTapeZMinusMax) { + powerTapeZpos = powerTapeZMinusMax - 0.5 * powerTape.thickness(); + //std::cout << "Moving power tape!!!" << std::endl; + } + powerTapeZMinusMax = powerTapeZpos - 0.5 * powerTape.thickness(); + } + if ((std::abs(powerTapeZpos)+0.5*powerTape.thickness()) > (std::abs(ringZpos) - 0.5*ring->thicknessInner())) { + std::cout << "ERROR: Power tapes clash with modules!!!" << std::endl; + } + //std::cout << " powertape max " << std::abs(powerTapeZpos)+0.5*powerTape.thickness() << std::endl; + //std::cout << " modules min " << std::abs(ringZpos) - 0.5*ring->thicknessInner() << std::endl; + + //std::cout << "new powerTapeZpos, thickness = " << powerTapeZpos << ", " << powerTape->thickness() << std::endl; + wheel->add(new GeoTransform(HepGeom::TranslateZ3D(powerTapeZpos))); + wheel->add(powerTape.getVolume()); + + + } // End Ring loop + + + // + // Put in the patch Panel + // + // Put it on opposide side of outer ring (ring 0). + int patchPanelSide = m_rotateWheel; + + + // Get outer position of power tape on that side. + // In case there are no rings on that side (and hence no powertapes) this will be 1/2 disc support thickness + double powerTapeZMax = 0; + if (patchPanelSide > 0) { + powerTapeZMax = powerTapeZPlusMax; + } else { + powerTapeZMax = -powerTapeZMinusMax; + } + + + + // Loop over patch panel locations + for (int iPPLoc = 0; iPPLoc < m_numPatchPanelLocs ; iPPLoc++) { + + // The patchpanels generally repeat in the four quadrants. + int numRepeat = 1; + if (m_patchPanelRepeatQuadrant[iPPLoc]) numRepeat = 4; + int ppType = m_patchPanelType[iPPLoc]; + if (ppType >= m_numPatchPanelTypes) std::cout << "ERROR: Patch Panel type number out of range!" << std::endl; + for (int iRepeat = 0; iRepeat < numRepeat; iRepeat++) { + + // Calculate the location. + double patchPanelAngle = m_patchPanelLocAngle[iPPLoc] + iRepeat * 90*CLHEP::degree; + double patchPanelZpos = patchPanelSide * (powerTapeZMax + 0.5*m_patchPanel[ppType]->thickness() + m_safety); + double patchPanelR = m_patchPanel[ppType]->midRadius(); + + // Check for overlap with middle ring. + if (m_numRings >= 2 && (m_patchPanel[ppType]->innerRadius() <= m_rings[1]->outerRadius())) { + std::cout << "ERROR: Patch Panel clashes with middle ring" << std::endl; + std::cout << " PatchPanel inner radius: " << m_patchPanel[ppType]->innerRadius() << std::endl; + std::cout << " Ring outer radius: " << m_rings[1]->outerRadius() << std::endl; + } + + // Add it to the wheel + wheel->add(new GeoTransform(HepGeom::RotateZ3D(patchPanelAngle)*HepGeom::TranslateX3D(patchPanelR)*HepGeom::TranslateZ3D(patchPanelZpos))); + wheel->add(m_patchPanel[ppType]->getVolume()); + + // Make and add the connector for PPF0e (type 0) + // Positioned immediately outside PatchPanel at same angle + if(ppType == 0 && m_pPConnectorPresent) { + double ppConnectorZpos = patchPanelSide * (powerTapeZMax + 0.5*m_pPConnector->thickness() + m_safety); + double ppConnectorR = m_patchPanel[ppType]->outerRadius() + 0.5*m_pPConnector->deltaR() + m_safety; + // Check is within wheel + if (ppConnectorR + 0.5*m_pPConnector->deltaR() >= m_outerRadius) { + std::cout << "ERROR: Patch Panel Connector clashes outside wheel" << std::endl; + std::cout << " PatchPanel Connector outer radius: " << ppConnectorR + 0.5*m_pPConnector->deltaR() << std::endl; + std::cout << " Wheel outer radius: " << m_outerRadius << std::endl; + } + // Add it to the wheel + wheel->add(new GeoTransform(HepGeom::RotateZ3D(patchPanelAngle)*HepGeom::TranslateX3D(ppConnectorR)*HepGeom::TranslateZ3D(ppConnectorZpos))); + wheel->add(m_pPConnector->getVolume()); + } + + // Make and add the cooling for PPF0c (type 2) + // Positioned immediately outside PatchPanel at same angle + if(ppType == 2 && m_pPCoolingPresent) { + double ppCoolingZpos = patchPanelSide * (powerTapeZMax + 0.5*m_pPCooling->thickness() + m_safety); + double ppCoolingR = m_patchPanel[ppType]->outerRadius() + 0.5*m_pPCooling->deltaR() + m_safety; + // Check is within wheel + if (ppCoolingR + 0.5*m_pPCooling->deltaR() >= m_outerRadius) { + std::cout << "ERROR: Patch Panel Cooling clashes outside wheel" << std::endl; + std::cout << " PatchPanel Cooling outer radius: " << ppCoolingR + 0.5*m_pPCooling->deltaR() << std::endl; + std::cout << " Wheel outer radius: " << m_outerRadius << std::endl; + } + // Add it to the wheel + wheel->add(new GeoTransform(HepGeom::RotateZ3D(patchPanelAngle)*HepGeom::TranslateX3D(ppCoolingR)*HepGeom::TranslateZ3D(ppCoolingZpos))); + wheel->add(m_pPCooling->getVolume()); + } + } + + } // end loop over patch panel locations + + + // Add the optoharness - type depends on number of rings + // The optoharness is always on the back side (except if the wheel is rotates) + double optoHarnessZMax = 0.5 * m_discSupport->thickness(); + if (!m_optoHarnessPresent) { + //std::cout << "SCT_FwdOptoHarness not built" << std::endl; + } else { + std::string optoharnessName = "OptoHarnessO"; + if(m_numRings > 1) {optoharnessName+="M";} + if(m_numRings > 2) {optoharnessName+="I";} + SCT_FwdOptoHarness optoharness(optoharnessName+"W"+intToString(m_iWheel),m_numRings); + double optoHarnessZpos = 0.5*m_rotateWheel*(m_discSupport->thickness() + optoharness.thickness()); + wheel->add(new GeoTransform(HepGeom::TranslateZ3D(optoHarnessZpos))); + wheel->add(optoharness.getVolume()); + optoHarnessZMax = optoHarnessZpos + 0.5*optoharness.thickness(); + } + + // Loop over FSI locations. + for (unsigned int iFSI = 0; iFSI < m_fsiVector->size(); iFSI++) { + int type = (*m_fsiVector)[iFSI]->simType(); + double fsiRadius = (*m_fsiVector)[iFSI]->location().radius(); + double fsiPhi = (*m_fsiVector)[iFSI]->location().phi(); + int fsiUsualSide = (*m_fsiVector)[iFSI]->location().side(); + int fsiSide = fsiUsualSide * m_rotateWheel; + double fsiZpos = fsiSide * m_fsiType[type]->zOffset(); + + // std::cout << "Placing FSI. Type: " << type << ", " + // << "Sim type: " << (*m_fsiVector)[iFSI]->simTypeString() << ", " + // << "Actual type: " << (*m_fsiVector)[iFSI]->actualType() << ", " + // << "Loc type: " << (*m_fsiVector)[iFSI]->locationType() << ", " + // << "Radius(mm): " << fsiRadius/CLHEP::mm << ", " + // << "Phi(deg): " << fsiPhi/CLHEP::deg << ", " + // << "Thickness(mm): " << m_fsiType[type]->thickness() << ", " + // << "ZOffset(mm): " << m_fsiType[type]->zOffset() << ", " + // << "RPhi(mm): " << m_fsiType[type]->rphi() << ", " + // << "DeltaR(mm): " << m_fsiType[type]->deltaR() + // << std::endl; + + + // Check for clashes on front side + if (fsiUsualSide < 0) { + double zMin = std::abs(fsiZpos) - 0.5*m_fsiType[type]->thickness(); + if (maxZOfRingsFront > zMin) { + std::cout << "WARNING: FSI probably clashes with ring" << std::endl; + std::cout << " maxZOfRingsFront = " << maxZOfRingsFront << std::endl; + std::cout << " fsiZMin = " << zMin << std::endl; + } + } else { // ... and backside + // Check radius of fsi. + // If outer radii check for overlap with powertape + // If inner radii check for overlap with optoharness (disksupport if no optoharness) + double diskMidRadius = 0.5*(m_outerRadius + m_innerRadius); + double servicesZMax = (fsiRadius > diskMidRadius) ? powerTapeZMax : optoHarnessZMax; + double zMin = std::abs(fsiZpos) - 0.5*m_fsiType[type]->thickness(); + if (servicesZMax > zMin) { + std::cout << "WARNING: FSI probably clashes with disc services" << std::endl; + std::cout << " servicesZMax = " << servicesZMax << std::endl; + std::cout << " fsiZMin = " << zMin << std::endl; + std::cout << " fsiRadius = " << fsiRadius << std::endl; + } + } + + wheel->add(new GeoTransform(HepGeom::RotateZ3D(fsiPhi)*HepGeom::TranslateX3D(fsiRadius)*HepGeom::TranslateZ3D(fsiZpos))); + wheel->add(m_fsiType[type]->getVolume()); + + + } // end loop over FSI. + + // Loop over disc fixation locations + if(m_discFixationPresent) { + for (unsigned int iLoc = 0; iLoc < m_discFixationLocAngle.size() ; iLoc++) { + // The disc fixations repeat in the four quadrants. + for (int iRepeat = 0; iRepeat < 4; iRepeat++) { + // Calculate the location. + double discFixationAngle = m_discFixationLocAngle[iLoc] + iRepeat * 90*CLHEP::degree; + double discFixationR = m_ringMaxRadius + 0.5*m_discFixation->thickness() + m_safety; + // Check is within wheel + if (discFixationR + 0.5*m_discFixation->thickness() >= m_outerRadius) { + std::cout << "ERROR: Disc Fixation outside wheel" << std::endl; + std::cout << "Disc fixation outer radius: " << discFixationR + 0.5*m_discFixation->thickness() << std::endl; + std::cout << " Wheel outer radius: " << m_outerRadius << std::endl; + } + // Add it to the wheel + wheel->add(new GeoTransform(HepGeom::RotateY3D(90.*CLHEP::degree)*HepGeom::RotateX3D(discFixationAngle)*HepGeom::TranslateZ3D(discFixationR))); + wheel->add(m_discFixation->getVolume()); + } + } + } + + + + // Extra Material + InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager()); + xMat.add(wheel, "SCTDisc"); + xMat.add(wheel, "SCTDisc"+intToString(m_iWheel)); + if (m_endcap > 0) { + xMat.add(wheel, "SCTDiscA"); + xMat.add(wheel, "SCTDiscA"+intToString(m_iWheel)); + } else { + xMat.add(wheel, "SCTDiscC"); + xMat.add(wheel, "SCTDiscC"+intToString(m_iWheel)); + } + return wheel; + +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx new file mode 100755 index 00000000000..b6039ef3e27 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx @@ -0,0 +1,91 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_GeneralParameters.h" +#include "SCT_GeoModel/SCT_DataBase.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "InDetGeoModelUtils/TopLevelPlacements.h" + +#include <iostream> + + +const double SCT_SAFETY = 0.01 * CLHEP::mm; // Used in some places to make envelopes slightly larger to ensure + // no overlaps due to rounding errors. + + +SCT_GeneralParameters::SCT_GeneralParameters() +{ + m_rdb = SCT_DataBase::instance(); + m_placements = new TopLevelPlacements(m_rdb->topLevelTable()); +} + + +SCT_GeneralParameters::~SCT_GeneralParameters() +{ + delete m_placements; +} + + +const HepGeom::Transform3D & +SCT_GeneralParameters::partTransform(const std::string & partName) const +{ + return m_placements->transform(partName); +} + + +bool +SCT_GeneralParameters::partPresent(const std::string & partName) const +{ + return m_placements->present(partName); +} + + + +// +// General +// +double +SCT_GeneralParameters::safety() const +{ + return SCT_SAFETY; +} + +// Default Conditions. Values should be come form conditions data base. These values provide +// default vlaues if nothing from the conditions database is provided. + + +double +SCT_GeneralParameters::temperature() const +{ + if (m_rdb->conditionsTable()->size() == 0) { + return 266.15 * CLHEP::kelvin; // -7 C + } + return (m_rdb->conditions()->getDouble("TEMPERATURE") + 273.15) * CLHEP::kelvin; +} + + +double +SCT_GeneralParameters::biasVoltage() const +{ + if (m_rdb->conditionsTable()->size() == 0) { + return 100 * CLHEP::volt; + } + return m_rdb->conditions()->getDouble("BIASVOLT") * CLHEP::volt; +} + +double +SCT_GeneralParameters::depletionVoltage() const +{ + if (m_rdb->conditionsTable()->size() == 0) { + return 20 * CLHEP::volt; + } + return m_rdb->conditions()->getDouble("DEPLETIONVOLT") * CLHEP::volt; +} + + + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeoModelAthenaComps.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeoModelAthenaComps.cxx new file mode 100644 index 00000000000..6781ce4dd89 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeoModelAthenaComps.cxx @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_GeoModelAthenaComps.h" +#include "InDetCondServices/ISiLorentzAngleSvc.h" + +SCT_GeoModelAthenaComps::SCT_GeoModelAthenaComps() + : InDetDD::AthenaComps("SCT_GeoModel"), + m_lorentzAngleSvc("",""), + m_idHelper(0) +{} + +void +SCT_GeoModelAthenaComps::setLorentzAngleSvc(const ServiceHandle<ISiLorentzAngleSvc> & lorentzAngleSvc) +{ + m_lorentzAngleSvc = lorentzAngleSvc; +} + +void +SCT_GeoModelAthenaComps::setIdHelper(const SCT_ID* idHelper) +{ + m_idHelper = idHelper; +} + +const ServiceHandle<ISiLorentzAngleSvc> & +SCT_GeoModelAthenaComps::lorentzAngleSvc() const +{ + return m_lorentzAngleSvc; +} + +const SCT_ID* +SCT_GeoModelAthenaComps::getIdHelper() const +{ + return m_idHelper; +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx new file mode 100755 index 00000000000..f90bb7ef46d --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx @@ -0,0 +1,134 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_GeometryManager.h" + +#include "SCT_GeoModel/SCT_BarrelParameters.h" +#include "SCT_GeoModel/SCT_BarrelModuleParameters.h" +#include "SCT_GeoModel/SCT_ForwardParameters.h" +#include "SCT_GeoModel/SCT_ForwardModuleParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" +#include "InDetGeoModelUtils/DistortedMaterialManager.h" +#include "SCT_GeoModel/SCT_GeoModelAthenaComps.h" + + +SCT_GeometryManager::SCT_GeometryManager() + : m_athenaComps(0), + m_commonItems(0), + m_barrelParameters(0), + m_barrelModuleParameters(0), + m_forwardParameters(0), + m_forwardModuleParameters(0), + m_generalParameters(0), + m_distortedMatManager(0) +{} + +SCT_GeometryManager::~SCT_GeometryManager() +{ + delete m_barrelParameters; + delete m_barrelModuleParameters; + delete m_forwardParameters; + delete m_forwardModuleParameters; + delete m_generalParameters; + delete m_distortedMatManager; +} + +// +// Access to run time options. +// +const SCT_Options & +SCT_GeometryManager::options() const +{ + return m_options; +} + +void +SCT_GeometryManager::setOptions(const SCT_Options & options) +{ + m_options = options; +} + +const SCT_GeoModelAthenaComps * +SCT_GeometryManager::athenaComps() const +{ + return m_athenaComps; +} + +void +SCT_GeometryManager::setAthenaComps(const SCT_GeoModelAthenaComps * athenaComps) +{ + m_athenaComps = athenaComps; +} + + +// +// SiCommonItems which are passed to SiDetectorElements. +// + +InDetDD::SiCommonItems * +SCT_GeometryManager::commonItems() const +{ + return m_commonItems; +} + + +void +SCT_GeometryManager::setCommonItems(InDetDD::SiCommonItems * commonItems) +{ + m_commonItems = commonItems; +} + +const SCT_BarrelParameters * +SCT_GeometryManager::barrelParameters() const +{ + if (!m_barrelParameters) { + m_barrelParameters = new SCT_BarrelParameters; + } + return m_barrelParameters; +} + +const SCT_BarrelModuleParameters * +SCT_GeometryManager::barrelModuleParameters() const +{ + if (!m_barrelModuleParameters) { + m_barrelModuleParameters = new SCT_BarrelModuleParameters; + } + return m_barrelModuleParameters; +} + + +const SCT_ForwardModuleParameters * +SCT_GeometryManager::forwardModuleParameters() const +{ + if (!m_forwardModuleParameters) { + m_forwardModuleParameters = new SCT_ForwardModuleParameters; + } + return m_forwardModuleParameters; +} + + +const SCT_ForwardParameters * +SCT_GeometryManager::forwardParameters() const +{ + if (!m_forwardParameters) { + m_forwardParameters = new SCT_ForwardParameters; + } + return m_forwardParameters; +} + + +const SCT_GeneralParameters * +SCT_GeometryManager::generalParameters() const +{ + if (!m_generalParameters) m_generalParameters = new SCT_GeneralParameters; + return m_generalParameters; +} + +const InDetDD::DistortedMaterialManager * +SCT_GeometryManager::distortedMatManager() const +{ + if (!m_distortedMatManager) m_distortedMatManager = new InDetDD::DistortedMaterialManager; + return m_distortedMatManager; +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx new file mode 100755 index 00000000000..8c712f019ba --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx @@ -0,0 +1,51 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Harness.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_Harness::SCT_Harness(const std::string & name, double length) + : SCT_SharedComponentFactory(name), m_length(length) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_Harness::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_materialName = parameters->harnessMaterial(); + m_thickness = parameters->harnessThickness(); + m_width = parameters->harnessWidth(); +} + +GeoVPhysVol * +SCT_Harness::build() +{ + + // Build the Harness. + SCT_MaterialManager materials; + + const GeoBox * harnessShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length); + m_material = materials.getMaterialForVolume(m_materialName, harnessShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol *harnessLog = + new GeoLogVol(getName(), harnessShape, m_material); + GeoPhysVol * harness = new GeoPhysVol(harnessLog); + + return harness; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx new file mode 100755 index 00000000000..5da9b725a4c --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx @@ -0,0 +1,49 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Hybrid.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelModuleParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_Hybrid::SCT_Hybrid(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + +void +SCT_Hybrid::getParameters() +{ + const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->hybridMaterial()); + m_thickness = parameters->hybridThickness(); + m_length = parameters->hybridLength(); + m_width = parameters->hybridWidth(); +} + +GeoVPhysVol * +SCT_Hybrid::build() +{ + // Build the . Just a simple box. + const GeoBox * simpleHybridShape = new GeoBox(0.5*m_thickness, + 0.5*m_width, + 0.5*m_length); + const GeoLogVol * simpleHybridLog = + new GeoLogVol(getName(), simpleHybridShape, m_material); + GeoPhysVol * simpleHybrid = new GeoPhysVol(simpleHybridLog); + + return simpleHybrid; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx new file mode 100755 index 00000000000..1acadfafbe3 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx @@ -0,0 +1,28 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Identifier.h" +#include "InDetIdentifier/SCT_ID.h" +#include "Identifier/Identifier.h" + +#include <cassert> +#include <iostream> + +const SCT_ID * SCT_Identifier::s_idHelper = 0; + +Identifier +SCT_Identifier::getWaferId() +{ + assert (s_idHelper); + return s_idHelper->wafer_id(m_barrelEC, m_layerDisk, m_phiModule, m_etaModule, m_side); +} + +void SCT_Identifier::print() +{ + std::cout << "2/2/" << m_barrelEC << "/" + << m_layerDisk << "/" + << m_phiModule << "/" + << m_etaModule << "/" + << m_side << std::endl; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx new file mode 100755 index 00000000000..bd40637958c --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx @@ -0,0 +1,207 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// 13rd Mar 2005 D.Naito +// 28th Mar 2005 S.Mima +// Wed 15th Jun 2005 D.Naito modified. +// +#include "SCT_GeoModel/SCT_InnerSide.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelModuleParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" +#include "SCT_GeoModel/SCT_Identifier.h" + +// module parts. +#include "SCT_GeoModel/SCT_Sensor.h" +#include "SCT_GeoModel/SCT_Hybrid.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoShapeShift.h" + +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" + +#include <cmath> + +SCT_InnerSide::SCT_InnerSide(const std::string & name) + : SCT_UniqueComponentFactory(name), + m_hybrid(0), + m_sensor(0) + + //m_hybridPos(0), + //m_sensorPos(0) +{ + getParameters(); + m_logVolume = preBuild(); +} + + +SCT_InnerSide::~SCT_InnerSide() +{ + // Clean up + delete m_hybrid; + delete m_sensor; + + // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (00)********************************* + // *** -->> (00)********************************* + delete m_env1RefPointVector; + delete m_env2RefPointVector; + // *** End of modified lines. ------------------ (00)********************************* + + //delete m_hybridPos; + //delete m_sensorPos; +} + + +void +SCT_InnerSide::getParameters() +{ + const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + + m_safety = generalParameters->safety(); + m_hybridOffsetZ = parameters->hybridOffsetZ(); + m_hybridOffsetX = parameters->hybridOffsetX(); +} + + +const GeoLogVol * +SCT_InnerSide::preBuild() +{ + SCT_MaterialManager materials; + + // Create child components + m_sensor = new SCT_Sensor("BRLSensor"); + m_hybrid = new SCT_Hybrid("Hybrid"); + + // + // Define constants for convenience. + // t_XXX: thickness of XXX. + // w_XXX: width of XXX. + // l_XXX: length of XXX. + // + const double t_hybrid = m_hybrid->thickness(); + const double w_hybrid = m_hybrid->width(); + const double l_hybrid = m_hybrid->length(); + + const double t_sensor = m_sensor->thickness(); + const double w_sensor = m_sensor->width(); + const double l_sensor = m_sensor->length(); + + // + // Calculate a few things. + // + const double sensorPosX = 0.0; + const double sensorPosY = 0.0; + const double sensorPosZ = 0.0; + + const double hybridPosX = m_hybridOffsetX; + const double hybridPosY = 0.0; + const double hybridPosZ = m_hybridOffsetZ; + + // + // ise : InnerSideEnvelope + // Reference: sct_module_geometry.ps + // + // 28th Mar S.Mima modified + // Wed 15th Jun 2005 D.Naito modified. + const double w_ise1 = w_sensor + m_safety; + const double t_ise1 = t_sensor + m_safety; + const double l_ise1 = l_sensor + m_safety; + + const double t_ise2 = t_hybrid + m_safety; + const double w_ise2 = w_hybrid + m_safety; + const double l_ise2 = l_hybrid + m_safety; + + const double ise2PosX = hybridPosX; + const double ise2PosY = hybridPosY; + const double ise2PosZ = hybridPosZ; + + // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (00)********************************* + // *** -->> (00)********************************* + m_env1RefPointVector = new CLHEP::Hep3Vector(0.0, 0.0, 0.0); + m_env2RefPointVector = new CLHEP::Hep3Vector(-ise2PosX, -ise2PosY, -ise2PosZ); + // *** End of modified lines. ------------------ (00)********************************* + + m_hybridPos = new GeoTransform(HepGeom::Translate3D(hybridPosX, hybridPosY, hybridPosZ)); + + // The depth axis goes from the backside to the implant side + // and so point away from the module center. + // The two sensor+hybrid combinations are built in a similar way. + // + // ^ + // --- hybrid | + // ------- sensor | x-axis + // + // Shown is the outer side. The inner side is the same but with a rotation of 180 deg around the z-axis. + // + //CLHEP::HepRotation rotSensor; + //rotSensor.rotateZ(180*CLHEP::deg); + //m_outerSidePos = new HepGeom::Transform3D(rotOuter, CLHEP::Hep3Vector(0.5 * (m_sensorGap + sectThickness), 0., 0.)); + //m_sensorPos = new GeoTransform(HepGeom::Transform3D(rotSensor, CLHEP::Hep3Vector(sensorPosX, sensorPosY, sensorPosZ))); + m_sensorPos = new GeoTransform(HepGeom::Translate3D(sensorPosX, sensorPosY, sensorPosZ)); + + + // + // Make an envelope for the whole module. + // + const GeoBox * ise1Shape = new GeoBox(0.5 * t_ise1, + 0.5 * w_ise1, + 0.5 * l_ise1); + const GeoBox * ise2Shape = new GeoBox(0.5 * t_ise2, + 0.5 * w_ise2, + 0.5 * l_ise2); + + const GeoShape & InnerSideEnvelopeShape = (*ise1Shape). + add(*ise2Shape << HepGeom::Translate3D(ise2PosX, ise2PosY, ise2PosZ)); + + const GeoLogVol * InnerSideEnvelopeLog = new GeoLogVol("InnerSideEnvelope", + &InnerSideEnvelopeShape, + materials.gasMaterial()); + // 28th Mar S.Mima modified + // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (00)********************************* + //m_thickness = 0.5*t_sensor + hybridPosX + 0.5*t_ise2; + // *** -->> (00)********************************* + m_thickness = 0.5*t_ise1 + hybridPosX + 0.5*t_ise2; + // *** End of modified lines. ------------------ (00)********************************* + m_width = w_ise1; + m_length = l_ise1; + + return InnerSideEnvelopeLog; +} + + +GeoVPhysVol * +SCT_InnerSide::build(SCT_Identifier id) const +{ + GeoFullPhysVol * innerSide = new GeoFullPhysVol(m_logVolume); + + // + // Build the innerSide + // + // Add Sensor + innerSide->add(new GeoIdentifierTag(1000)); + innerSide->add(m_sensorPos); + innerSide->add(m_sensor->build(id)); + + // Add Hybrid + innerSide->add(m_hybridPos); + innerSide->add(m_hybrid->getVolume()); + + return innerSide; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx new file mode 100755 index 00000000000..c598f209072 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx @@ -0,0 +1,133 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_InterLink.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoTubs.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoTransform.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_InterLink::SCT_InterLink(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_InterLink::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + // Interlink parameters + m_materialName = parameters->interLinkMaterial(); + m_length = parameters->interLinkDeltaZ(); + m_innerRadius = parameters->interLinkInnerRadius(); + m_outerRadius = parameters->interLinkOuterRadius(); + m_dPhi = parameters->interLinkDeltaPhi(); + m_phiPos = parameters->interLinkPhiPos(); + m_nRepeat = parameters->interLinkNRepeat(); + + // FSIFlange parameters: only for non-uniform interlink + if(m_nRepeat > 1) { + m_includeFSIFlange = parameters->includeFSI(); + } + else { + m_includeFSIFlange = false; + } + if(m_includeFSIFlange) { + m_innerRadiusFSIFlange = parameters->fsiFlangeInnerRadius(); + m_outerRadiusFSIFlange = parameters->fsiFlangeOuterRadius(); + m_materialNameFSIFlange = parameters->fsiFlangeMaterial(); + } + + // B6 bearing parameters: only for non-uniform interlink + if(m_nRepeat > 1) { + m_materialNameBearing = parameters->bearingMaterial(); + m_lengthBearing = m_length; + m_innerRadiusBearing = m_outerRadius; + m_outerRadiusBearing = parameters->thermalShieldBulkheadInnerRadius(); + m_dPhiBearing = parameters->bearingDeltaPhi(); + m_phiPosBearing = parameters->bearingPhiPos(); + m_nRepeatBearing = parameters->bearingNRepeat(); + } + +} + +GeoVPhysVol * +SCT_InterLink::build() +{ + // Make the interlink. + + SCT_MaterialManager materials; + GeoPhysVol* interLink; + + if(m_nRepeat == 1) { + // For old geometry interlink is a simple tube of material + const GeoTube* interLinkShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5*m_length); + const GeoMaterial* material = materials.getMaterialForVolume(m_materialName, interLinkShape->volume()); + if(!material) {material = materials.getMaterial(m_materialName);} + const GeoLogVol* interLinkLog = new GeoLogVol(getName(), interLinkShape, material); + interLink = new GeoPhysVol(interLinkLog); + } + + else { + // In updated version we make air tube containing interlink segments and B6 bearings + // And also include FSI flange segments if defined + // Air tube: + const GeoTube* interLinkShape = new GeoTube(m_innerRadius, m_outerRadiusBearing, 0.5*m_length); + const GeoLogVol* interLinkLog = new GeoLogVol(getName(), interLinkShape, materials.gasMaterial()); + interLink = new GeoPhysVol(interLinkLog); + + // Interlink segments: + const GeoTubs* interLinkSegShape = new GeoTubs(m_innerRadius, m_outerRadius, 0.5*m_length, - 0.5*m_dPhi*CLHEP::radian, m_dPhi*CLHEP::radian); + const GeoLogVol* interLinkSegLog = new GeoLogVol("InterlinkSegment", interLinkSegShape, materials.getMaterialForVolume(m_materialName, interLinkSegShape->volume())); + GeoPhysVol* interLinkSeg = new GeoPhysVol(interLinkSegLog); + + for(int i=0; i<m_nRepeat; i++) { + double interlinkAngle = m_phiPos + (i * 360./m_nRepeat)*CLHEP::deg; + interLink->add(new GeoTransform(HepGeom::RotateZ3D(interlinkAngle))); + interLink->add(interLinkSeg); + } + + // B6 bearings + const GeoTubs* bearingShape = new GeoTubs(m_innerRadiusBearing, m_outerRadiusBearing, 0.5*m_lengthBearing, - 0.5*m_dPhiBearing*CLHEP::radian, m_dPhiBearing*CLHEP::radian); + const GeoLogVol* bearingLog = new GeoLogVol("Bearing", bearingShape, materials.getMaterialForVolume(m_materialNameBearing, bearingShape->volume())); + GeoPhysVol* bearing = new GeoPhysVol(bearingLog); + + for(int i=0; i<m_nRepeatBearing; i++) { + double bearingAngle = m_phiPosBearing + (i * 360./m_nRepeatBearing)*CLHEP::deg; + interLink->add(new GeoTransform(HepGeom::RotateZ3D(bearingAngle))); + interLink->add(bearing); + } + + // FSI Flange segments: + // These exactly fill gaps between interlink segments, with smaller radial extent + if(m_includeFSIFlange) { + double dPhiFSI = (360./m_nRepeat)*CLHEP::deg - m_dPhi; + const GeoTubs* FSIFlangeShape = new GeoTubs(m_innerRadiusFSIFlange, m_outerRadiusFSIFlange, 0.5*m_length, - 0.5*dPhiFSI*CLHEP::radian, dPhiFSI*CLHEP::radian); + const GeoLogVol* FSIFlangeLog = new GeoLogVol("FSIFlangeSegment", FSIFlangeShape, materials.getMaterialForVolume(m_materialNameFSIFlange, FSIFlangeShape->volume())); + GeoPhysVol* FSIFlange = new GeoPhysVol(FSIFlangeLog); + + for(int i=0; i<m_nRepeat; i++) { + double phiPosFSI = m_phiPos + (180./m_nRepeat)*CLHEP::deg; + double FSIFlangeAngle = phiPosFSI + (i * 360./m_nRepeat)*CLHEP::deg; + interLink->add(new GeoTransform(HepGeom::RotateZ3D(FSIFlangeAngle))); + interLink->add(FSIFlange); + } + } + } + + return interLink; +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx new file mode 100755 index 00000000000..56a02a7126e --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx @@ -0,0 +1,507 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// CPW 17/8/06 +// Version using new model of services from A. Tricoli +// +#include "SCT_GeoModel/SCT_Layer.h" +#include "SCT_GeoModel/SCT_Identifier.h" +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" +#include "SCT_GeoModel/SCT_Bracket.h" +#include "SCT_GeoModel/SCT_CoolingEnd.h" +#include "SCT_GeoModel/SCT_Clamp.h" +#include "SCT_GeoModel/SCT_Flange.h" +#include "SCT_GeoModel/SCT_Harness.h" +#include "SCT_GeoModel/SCT_Module.h" +#include "SCT_GeoModel/SCT_Ski.h" +#include "SCT_GeoModel/SCT_SkiAux.h" +#include "SCT_GeoModel/SCT_SkiPowerTape.h" +#include "SCT_GeoModel/SCT_SupportCyl.h" +#include "SCT_GeoModel/SCT_FSIEndJewel.h" +#include "SCT_GeoModel/SCT_FSIScorpion.h" +#include "SCT_GeoModel/SCT_FSIFibreMask.h" + +#include "InDetGeoModelUtils/ExtraMaterial.h" +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoShapeSubtraction.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <sstream> +#include <cmath> + +inline double sqr(double x) {return x * x;} + +SCT_Layer::SCT_Layer(const std::string & name, + int iLayer, + const SCT_Module * module) + : SCT_UniqueComponentFactory(name), + m_iLayer(iLayer), + m_module(module) +{ + getParameters(); + m_logVolume = preBuild(); +} + +SCT_Layer::~SCT_Layer() +{ + delete m_bracket; + delete m_clamp; + delete m_coolingEnd; + delete m_flange; + delete m_harness; + delete m_ski; + delete m_skiAux; + delete m_skiPowerTape; + delete m_supportCyl; + if(m_includeFSI) { + delete m_endJewel; + delete m_scorpion; + delete m_fibreMask; + } +} + +void +SCT_Layer::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + + m_safety = generalParameters->safety(); + m_radius = parameters->radius(m_iLayer); + m_skisPerLayer = parameters->skisPerLayer(m_iLayer); + m_tilt = parameters->tilt(m_iLayer); + m_stereoSign = parameters->layerStereoSign(m_iLayer); + m_bracketPhiOffset = parameters->layerBracketPhiOffset(m_iLayer); + m_phiRefModule = parameters->layerPhiOfRefModule(m_iLayer); + + m_outerRadiusOfSupport = parameters->supportCylOuterRadius(m_iLayer); + m_activeLength = parameters->activeLength(); + m_cylinderLength = parameters->cylinderLength(); + + m_includeFSI = parameters->includeFSI(); + if(m_includeFSI) { + m_nRepeatEndJewel = parameters->fsiEndJewelNRepeat(m_iLayer); + m_phiEndJewel = parameters->fsiEndJewelPhi(m_iLayer); + m_zEndJewel = parameters->fsiEndJewelZ(m_iLayer); + m_nRepeatScorpion = parameters->fsiScorpionNRepeat(m_iLayer); + m_phiScorpion = parameters->fsiScorpionPhi(m_iLayer); + m_zScorpion = parameters->fsiScorpionZ(m_iLayer); + } + + // Set numerology + detectorManager()->numerology().setNumPhiModulesForLayer(m_iLayer,m_skisPerLayer); + detectorManager()->numerology().setNumEtaModulesForLayer(m_iLayer,parameters->modulesPerSki()); + + // std::cout << "In SCT_Layer:" << std::endl; + // std::cout << " skisPerLayer = " << m_skisPerLayer << std::endl; + // std::cout << " radius = " << m_radius << std::endl; + // std::cout << " tilt = " << m_tilt << std::endl; + +} + + + +const GeoLogVol * +SCT_Layer::preBuild() +{ + // Build the components required for the layer. + // We use the layer number as a string quite a bit + std::string layerNumStr = intToString(m_iLayer); + + // Build the Flanges + m_flange = new SCT_Flange("Flange"+layerNumStr, m_iLayer); + + // Build the SupportCyl + m_supportCyl = new SCT_SupportCyl("SupportCyl"+layerNumStr, m_iLayer, m_cylinderLength); + + // Build the FSI end jewel, scorpion and fibre mask + // Mask runs between scorpions and flange in z - must be built after these + if(m_includeFSI) { + m_endJewel = new SCT_FSIEndJewel("FSIEndJewel"+layerNumStr); + m_scorpion = new SCT_FSIScorpion("FSIScorpion"+layerNumStr); + double length_mask = 0.5*m_cylinderLength - m_flange->length() - m_zScorpion - 0.5*m_scorpion->length(); + // std::cout << "length_mask = " << length_mask << std::endl; + m_fibreMask = new SCT_FSIFibreMask("FSIFibreMask"+layerNumStr, m_iLayer, length_mask); + } + else { + m_endJewel = 0; + m_scorpion = 0; + m_fibreMask = 0; + } + + // + // Calculations for making active layer components - called ski. + // This is the modules + doglegs + cooling blocks + coolingpipe + // + double divisionAngle = 360 * CLHEP::degree / m_skisPerLayer; + + // We define here the first module(id = 0) as the nearest module to phi = 0 with positive phi. + // We allow slightly negative in case of rounding errors. + + double moduleCount = m_phiRefModule / divisionAngle; + m_skiPhiStart = divisionAngle * (moduleCount - floor(moduleCount +0.5 -0.0001)); + + m_skiAuxPhiStart = 0; + + // Make the ski + // The ski length is now reduced to m_activeLength to make room for the cooling inlet/outlet volumes + m_ski = new SCT_Ski("Ski"+layerNumStr, m_module, m_stereoSign, m_tilt, m_activeLength); + + // + // Make SkiAux - This is the brackets, harness and power tape. + // + // Bracket is placed at edge of division. + // -tiltSign * (r*divisionAngle/2 - bracket_width/2) + // Works for both +ve and -ve tilt. + m_bracket = new SCT_Bracket("Bracket"+layerNumStr); + + m_harness = new SCT_Harness("Harness"+layerNumStr, m_cylinderLength); + m_skiPowerTape = new SCT_SkiPowerTape("SkiPowerTape"+layerNumStr, m_ski, m_cylinderLength); + + int tiltSign = (m_tilt < 0) ? -1 : +1; + + double bracketOffset = m_skiPhiStart - tiltSign * m_bracketPhiOffset; + double powerTapeOffset = bracketOffset - tiltSign * 0.5*divisionAngle; + // tiltSign not really necessary in powerTapeOffset calculate + // - but keeps the bracket and powertape pair associated with the same ski + + + // Make the SkiAux. This is layer dependent. + m_skiAux = new SCT_SkiAux("SkiAux"+layerNumStr, + m_ski, + m_bracket, + m_harness, + m_skiPowerTape, + m_outerRadiusOfSupport, + bracketOffset, + powerTapeOffset, + divisionAngle); + + // Build the clamp: we cannot do this until we have the dimensions of SkiAux + m_clamp = new SCT_Clamp("Clamp"+layerNumStr, m_iLayer, m_skiAux->outerRadius()); + + // Build the volume representing the cooling inlets, outlet and U-bends. + // We cannot do this until we have the dimensions of the clamp + double coolingInnerRadius = m_clamp->outerRadius(); + double clearance = 1*CLHEP::mm; + double coolingLength = 0.5*m_cylinderLength - 0.5*m_activeLength - clearance; + m_coolingEnd = new SCT_CoolingEnd("CoolingEnd"+layerNumStr, m_iLayer, coolingInnerRadius, coolingLength); + + // + // Calculate the envelopes. + // + + + // + // Active Layer Envelope extent + // Envelope for the active part (ie containing all the skis for the layer) + // + double rMinActive, rMaxActive; + + // Returns the min and max radius for the active envelope + activeEnvelopeExtent(rMinActive, rMaxActive); + + // Add some safety + rMinActive -= m_safety; + rMaxActive += m_safety; + + // But active layer now includes clamp.... + rMinActive = m_skiAux->outerRadius(); + + m_innerRadiusActive = rMinActive; + m_outerRadiusActive = rMaxActive; + + // + // Extent Envelope for support cyl, flanges and close-outs. + // + double rMinSupport = std::min(m_supportCyl->innerRadius(),m_flange->innerRadius()); + // + // Overall Layer Envelope extent + // + // Inner radius is inner radius of support. + m_innerRadius = rMinSupport; + m_outerRadius = m_outerRadiusActive; + + // + // Make envelope for layer; length is now same as support cylinder + // + SCT_MaterialManager materials; + double length = m_cylinderLength; + // double length = m_layerLength; + // if (m_iLayer == 0) {length = m_cylinderLength + m_safety;} + const GeoTube * layerEnvelopeTube = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * length); + + // std::cout << "Layer " << m_iLayer << " envelope, rmin, rmax, length = " + // << m_innerRadius << ", " <<m_outerRadius << ", " << length + // << std::endl; + + GeoLogVol * layerLog = new GeoLogVol(getName(), layerEnvelopeTube, materials.gasMaterial()); + + + // Check for overlap. + if (m_skiAux->outerRadius() > rMinActive) { + std::cout << "----> WARNING: SCT_Layer: Overlap between active layer and aux layer." << std::endl; + } + + return layerLog; +} + +GeoVPhysVol * +SCT_Layer::build(SCT_Identifier id) const +{ + + SCT_MaterialManager materials; + + // We make this a fullPhysVol for alignment code. + GeoFullPhysVol * layer = new GeoFullPhysVol(m_logVolume); + + double divisionAngle = 360 * CLHEP::degree / m_skisPerLayer; + + // + // Active Layer + // + // Make envelope for active layer + // + // std::cout << "Making Active Layer: rmin,rmax,len = " << m_innerRadiusActive + // << " " << m_outerRadiusActive << " " << 0.5 * m_cylinderLength + // << std::endl; + const GeoTube * activeLayerEnvelopeShape = new GeoTube(m_innerRadiusActive, m_outerRadiusActive, 0.5 * m_cylinderLength); + GeoLogVol * activeLayerLog = new GeoLogVol(getName()+"Active", activeLayerEnvelopeShape, materials.gasMaterial()); + GeoPhysVol * activeLayer = new GeoPhysVol(activeLayerLog); + + for (int iSki = 0; iSki < m_skisPerLayer; iSki++){ + std::ostringstream name; name << "Ski#" << iSki; + + double phi = m_skiPhiStart + iSki * divisionAngle; + + // std::cout << "m_skiPhiStart = " << m_skiPhiStart/CLHEP::degree << ", phi = " << phi/CLHEP::degree << std::endl; + + CLHEP::Hep3Vector pos(m_radius, 0, 0); + CLHEP::HepRotation rot; + rot.rotateZ(phi); + rot.rotateZ(m_tilt); + pos.rotateZ(phi); + + // Because the ski envelope center is not positioned at the rotation axis for the ski we must first + // apply the inverse of refPointTransform() of the ski. + HepGeom::Transform3D trans(HepGeom::Transform3D(rot,pos) * m_ski->getRefPointTransform()->getTransform().inverse()); + + // std::cout << "Adding ski at pos: " << pos << std::endl; + // std::cout << " StereoInner = " << m_module->stereoInner() << std::endl; + activeLayer->add(new GeoAlignableTransform(trans)); + activeLayer->add(new GeoNameTag(name.str())); + activeLayer->add(new GeoIdentifierTag(iSki)); + id.setPhiModule(iSki); + activeLayer->add(m_ski->build(id)); + } + + // And add the service material + double clampZPos = 0.5 * m_cylinderLength - 0.5 * m_clamp->length(); + activeLayer->add(new GeoTransform(HepGeom::TranslateZ3D(clampZPos))); + activeLayer->add(m_clamp->getVolume()); + activeLayer->add(new GeoTransform(HepGeom::TranslateZ3D(-clampZPos))); + activeLayer->add(m_clamp->getVolume()); + + double coolingZPos = 0.5 * m_cylinderLength - 0.5 * m_coolingEnd->length(); + activeLayer->add(new GeoTransform(HepGeom::TranslateZ3D(coolingZPos))); + activeLayer->add(m_coolingEnd->getVolume()); + activeLayer->add(new GeoTransform(HepGeom::TranslateZ3D(-coolingZPos))); + activeLayer->add(m_coolingEnd->getVolume()); + + // + // Aux Layer + // Envelope for brackets and powertapes. + // + // std::cout << "Making Aux Layer: rmin,rmax,len = " << m_skiAux->innerRadius() + // << " " << m_skiAux->outerRadius() << " " << 0.5 * m_skiAux->length() + // << std::endl; + const GeoTube * auxLayerEnvelopeShape = new GeoTube(m_skiAux->innerRadius(), m_skiAux->outerRadius(), + 0.5*m_skiAux->length()); + GeoLogVol * auxLayerLog = new GeoLogVol(getName()+"Aux", auxLayerEnvelopeShape, materials.gasMaterial()); + GeoPhysVol * auxLayer = new GeoPhysVol(auxLayerLog); + + for (int iSki = 0; iSki < m_skisPerLayer; iSki++){ + //for (int iSki = 0; iSki < 2; iSki++){ + double phi = m_skiAuxPhiStart + iSki * divisionAngle; + CLHEP::HepRotation rot; + rot.rotateZ(phi); + auxLayer->add(new GeoTransform(HepGeom::Rotate3D(rot))); + auxLayer->add(m_skiAux->getVolume()); + } + + + // + // Support Layer + // + + // Envelope for support cylinder, flanges and FSI. + // Layer0 no longer needs cut-out + // + // std::cout << "Making Support Layer: rmin,rmax,len = " << m_innerRadius + // << " " << m_outerRadiusOfSupport << " " << 0.5 * m_cylinderLength + // << std::endl; + const GeoTube * supportLayerTube = new GeoTube(m_innerRadius, m_outerRadiusOfSupport, 0.5 * m_cylinderLength); + GeoLogVol * supportLayerLog = new GeoLogVol(getName()+"Support", supportLayerTube, + materials.gasMaterial()); + GeoPhysVol * supportLayer = new GeoPhysVol(supportLayerLog); + + // Position flanges. One at each end. + double flangeZPos = 0.5 * m_cylinderLength - 0.5 * m_flange->length(); + supportLayer->add(new GeoTransform(HepGeom::TranslateZ3D(flangeZPos))); + supportLayer->add(m_flange->getVolume()); + supportLayer->add(new GeoTransform(HepGeom::TranslateZ3D(-flangeZPos))); + supportLayer->add(m_flange->getVolume()); + + // Position supportCyl + supportLayer->add(m_supportCyl->getVolume()); + + if(m_includeFSI) { + // Position FSI fibre masks + double fibreMaskZPos = 0.5 * m_cylinderLength - m_flange->length() - 0.5 * m_fibreMask->length(); + supportLayer->add(new GeoTransform(HepGeom::TranslateZ3D(fibreMaskZPos))); + supportLayer->add(m_fibreMask->getVolume()); + supportLayer->add(new GeoTransform(HepGeom::TranslateZ3D(-fibreMaskZPos))); + supportLayer->add(m_fibreMask->getVolume()); + + // Position FSI End jewels + double jewelRadius = std::sqrt(m_fibreMask->innerRadius()*m_fibreMask->innerRadius() - 0.25 * m_endJewel->rPhiWidth()*m_endJewel->rPhiWidth()) - 0.5 * m_endJewel->radialWidth(); + // std::cout << "jewelRadius = " << jewelRadius << std::endl; + for ( int i=0; i<m_nRepeatEndJewel; i++) { + double jewelAngle = m_phiEndJewel + i * 360.*CLHEP::degree/m_nRepeatEndJewel; + // std::cout << "jewelAngle = " << jewelAngle << std::endl; + supportLayer->add(new GeoTransform(HepGeom::RotateZ3D(jewelAngle)*HepGeom::TranslateX3D(jewelRadius)*HepGeom::TranslateZ3D(m_zEndJewel))); + supportLayer->add(m_endJewel->getVolume()); + supportLayer->add(new GeoTransform(HepGeom::RotateZ3D(jewelAngle)*HepGeom::TranslateX3D(jewelRadius)*HepGeom::TranslateZ3D(-m_zEndJewel))); + supportLayer->add(m_endJewel->getVolume()); + } + + // Position FSI Scorpions + double scorpionRadius = std::sqrt(m_supportCyl->innerRadius()*m_supportCyl->innerRadius() - 0.25 * m_scorpion->rPhiWidth()*m_scorpion->rPhiWidth()) - 0.5 * m_scorpion->radialWidth(); + // std::cout << "scorpionRadius = " << scorpionRadius << std::endl; + for ( int i=0; i<m_nRepeatScorpion; i++) { + double scorpionAngle = m_phiScorpion + i * 360.*CLHEP::degree/m_nRepeatScorpion; + // std::cout << "scorpionAngle = " << scorpionAngle << std::endl; + supportLayer->add(new GeoTransform(HepGeom::RotateZ3D(scorpionAngle)*HepGeom::TranslateX3D(scorpionRadius)*HepGeom::TranslateZ3D(m_zScorpion))); + supportLayer->add(m_scorpion->getVolume()); + supportLayer->add(new GeoTransform(HepGeom::RotateZ3D(scorpionAngle)*HepGeom::TranslateX3D(scorpionRadius)*HepGeom::TranslateZ3D(-m_zScorpion))); + supportLayer->add(m_scorpion->getVolume()); + } + } + + // Extra Material + InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager()); + xMat.add(supportLayer, "SCTLayer"+intToString(m_iLayer)); + + + // Now place all the sub layers into the overall layer. + layer->add(activeLayer); + layer->add(auxLayer); + layer->add(supportLayer); + + return layer; +} + +void +SCT_Layer::activeEnvelopeExtent(double & rmin, double & rmax) +{ + + // These are the coordinates of the corners of the ski envelope. + // x is in the radial direction and x is in the phi direction. + + //CLHEP::Hep3Vector c0(); + CLHEP::Hep3Vector c1(-(m_ski->env1RefPointVector()->x()) - 0.5*(m_ski->env1Thickness()), + -(m_ski->env1RefPointVector()->y()) + 0.5*(m_ski->env1Width()), + 0.0); + CLHEP::Hep3Vector c2(-(m_ski->env2RefPointVector()->x()) - 0.5*(m_ski->env2Thickness()), + -(m_ski->env2RefPointVector()->y()) + 0.5*(m_ski->env2Width()), + 0.0); + //CLHEP::Hep3Vector c3(); + CLHEP::Hep3Vector c4(-(m_ski->env1RefPointVector()->x()) + 0.5*(m_ski->env1Thickness()), + -(m_ski->env1RefPointVector()->y()) - 0.5*(m_ski->env1Width()), + 0.0); + + //c0.rotateZ(m_tilt); + c1.rotateZ(m_tilt); + c2.rotateZ(m_tilt); + //c3.rotateZ(m_tilt); + c4.rotateZ(m_tilt); + + CLHEP::Hep3Vector vxmax = c4; + CLHEP::Hep3Vector vxmin; + if (c1.x() < c2.x()) { + vxmin = c1; + } + else { + vxmin = c2; + } + + double xmax = vxmax.x(); + double xmin = vxmin.x(); + double ymax = vxmax.y(); + double ymin = vxmin.y(); + + rmax = sqrt(sqr(m_radius + xmax) + sqr(ymax)); + rmin = sqrt(sqr(m_radius + xmin) + sqr(ymin)); +} +// *** End of modified lines. ------------------ (07)********************************* + +double +SCT_Layer::calcSkiPhiOffset() +{ + // Calculate skiPhiOffset such that active silicon touches edge of division + // This is what is done in AGE. + + // First calculated for abs(m_tilt). + + double divisionAngle = 360 * CLHEP::degree / m_skisPerLayer; + + // double activeHalfWidth = 0.5 * m_skiAux->ski()->module()->activeWidth(); + // double moduleHalfThickness = 0.5 * m_skiAux->ski()->module()->thickness(); + double activeHalfWidth = 0.5 * m_module->activeWidth(); + double moduleHalfThickness = 0.5 * m_module->thickness(); + + // rotate top points by tilt xin,yin (-X,+Y) and xout,yout (+X,+Y) + double ctilt = std::abs(cos(m_tilt)); + double stilt = std::abs(sin(m_tilt)); + double xin = m_radius + - ctilt * moduleHalfThickness - stilt * activeHalfWidth; + double yin = - stilt * moduleHalfThickness + ctilt * activeHalfWidth; + double xout = m_radius + + ctilt * moduleHalfThickness - stilt * activeHalfWidth; + double yout = stilt * moduleHalfThickness + ctilt * activeHalfWidth; + double alpha_in = atan(yin/xin); + double alpha_out = atan(yout/xout); + double alpha = std::max(alpha_in, alpha_out); + + int tiltSign = (m_tilt < 0) ? -1 : 1; + // As ski is larger than (ie alpha > divisionAngle/2) + // skiPhiOffset < 0 for +ve tilt and > 0 for -ve tilt. + double skiPhiOffset = tiltSign * (0.5 * divisionAngle - alpha); + + //std::cout << "In Volume: " << getName() << ":" << std::endl; + //// std::cout << " Module width = " << m_skiAux->ski()->module()->width() << std::endl; + //// std::cout << " Active width = " << m_skiAux->ski()->module()->activeWidth() << std::endl; + //std::cout << " Module width = " << m_module->width() << std::endl; + //std::cout << " Active width = " << m_module->activeWidth() << std::endl; + //std::cout << " Division angle = " << divisionAngle/CLHEP::degree << " CLHEP::deg" << std::endl; + //std::cout << " Ski phi offset = " << skiPhiOffset/CLHEP::degree << " CLHEP::deg" << std::endl; + return skiPhiOffset; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx new file mode 100755 index 00000000000..842fe2845ef --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx @@ -0,0 +1,128 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_MaterialManager.h" +#include "InDetGeoModelUtils/InDetMaterialManager.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoElement.h" +#include "SCT_GeoModel/SCT_DataBase.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/Bootstrap.h" +#include "GaudiKernel/ISvcLocator.h" + +#include <iostream> + +InDetMaterialManager * SCT_MaterialManager::s_materialManager = 0; +const GeoMaterial * SCT_MaterialManager::s_gasMaterial = 0; + +// Constructor +SCT_MaterialManager::SCT_MaterialManager() +{ + // Get my material manager if we haven't already done so. + if (!s_materialManager) { + + ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap + StoreGateSvc* detStore; + StatusCode sc = svcLocator->service("DetectorStore", detStore ); + if (sc.isFailure()) { + std::cout << "Could not locate DetectorStore" << std::endl; + return; + } + + const SCT_DataBase * rdb = SCT_DataBase::instance(); + //s_materialManager = new InDetMaterialManager("SCT_MaterialManager", detStore, rdb->weightTable(), "sct") + s_materialManager = new InDetMaterialManager("SCT_MaterialManager", rdb->athenaComps()); + s_materialManager->addWeightTable(rdb->weightTable(), "sct"); + s_materialManager->addScalingTable(rdb->scalingTable()); + + loadMaterials(); + } + + if (!s_gasMaterial) { + s_gasMaterial = s_materialManager->getMaterial("std::Air"); + } + +} + +void +SCT_MaterialManager::reinit() +{ + s_gasMaterial = 0; + delete s_materialManager; + s_materialManager = 0; +} + + +// Add materials not yet in the database +void +SCT_MaterialManager::loadMaterials() +{ + //const GeoElement *copper = getElement("Copper"); + + //const GeoMaterial *kapton = getMaterial("std::Kapton"); // 30th Aug 2005 D.Naito added. + + // CuKapton for Low Mass Tapes + //GeoMaterial * matCuKapton = new GeoMaterial("sct::CuKapton",2.94*gram/CLHEP::cm3); + //matCuKapton->add(const_cast<GeoElement*>(copper), 0.6142); + //matCuKapton->add(const_cast<GeoMaterial*>(kapton), 0.3858); + //addMaterial(matCuKapton); +} + +const GeoElement* +SCT_MaterialManager::getElement(const std::string & elementName) const +{ + return s_materialManager->getElement(elementName); +} + +const GeoMaterial* +SCT_MaterialManager::getMaterial(const std::string & materialName) const +{ + return s_materialManager->getMaterial(materialName); +} + +void +SCT_MaterialManager::addMaterial(GeoMaterial* material) +{ + return s_materialManager->addMaterial(material); +} + +const GeoMaterial* +SCT_MaterialManager::getMaterial(const std::string & originalMaterial, + double density, + const std::string & newName) +{ + + return s_materialManager->getMaterial(originalMaterial, density, newName); +} + +const GeoMaterial * +SCT_MaterialManager::getMaterialForVolume(const std::string & materialName, double volume) +{ + return s_materialManager->getMaterialForVolume(materialName, volume); +} + + + +const GeoMaterial* +SCT_MaterialManager::gasMaterial() const +{ + return s_gasMaterial; +} + + +void +SCT_MaterialManager::setGasMaterial(const GeoMaterial* material) +{ + s_gasMaterial = material; +} + +void +SCT_MaterialManager::setGasMaterial(const std::string & materialName) +{ + // Make sure an instance is created in order to initialize the manager + SCT_MaterialManager manager; + s_gasMaterial = manager.getMaterial(materialName); +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx new file mode 100755 index 00000000000..50415bbaaf4 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx @@ -0,0 +1,407 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Module.h" + +#include "SCT_GeoModel/SCT_Identifier.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelModuleParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" + +#include "SCT_GeoModel/SCT_Sensor.h" +#include "SCT_GeoModel/SCT_Hybrid.h" +#include "SCT_GeoModel/SCT_Pigtail.h" +#include "SCT_GeoModel/SCT_InnerSide.h" +#include "SCT_GeoModel/SCT_OuterSide.h" +#include "SCT_GeoModel/SCT_BaseBoard.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoVPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +// 8th Aug 2005 S.Mima modified. +#include "GeoModelKernel/GeoShapeSubtraction.h" + +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <cmath> + +SCT_Module::SCT_Module(const std::string & name) + : SCT_UniqueComponentFactory(name), + //m_stereoSign(0), + m_innerSide(0), + m_outerSide(0), + m_baseBoard(0) + +{ + getParameters(); + m_logVolume = preBuild(); +} + + +SCT_Module::~SCT_Module() +{ + // Clean up + delete m_baseBoardPos; // 6th Apr 2005 S.Mima modified. + delete m_innerSidePos; + delete m_outerSidePos; + + //delete m_sensor; // 14:00 Thu 14th Jul 2005 D.Naito removed. + delete m_innerSide; + delete m_outerSide; + delete m_baseBoard; + + delete m_env1RefPointVector; + delete m_env2RefPointVector; +} + + +void +SCT_Module::getParameters() +{ + const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + + //const SCT_OuterSide OuterSide("OuterSide"); // 14:00 Thu 14th Jul 2005 D.Naito removed. + + m_safety = generalParameters->safety(); + + m_sensorGap = parameters->moduleSensorToSensorGap(); + + m_stereoAngle = parameters->moduleStereoAngle(); + int sign = parameters->moduleStereoUpperSign(); + m_upperSide = parameters->moduleUpperSideNumber(); + m_stereoInner = -0.5*sign*m_stereoAngle; + m_stereoOuter = 0.5*sign*m_stereoAngle; + + // 1st Feb 2005 D.Naito modified. + //m_hybridAndBaseBoardOffsetDirection = (m_stereoSign == 0) ? -1 : +1; + + m_baseBoardOffsetY = parameters->baseBoardOffsetY(); + m_baseBoardOffsetZ = parameters->baseBoardOffsetZ(); +} + + +const GeoLogVol * +SCT_Module::preBuild() +{ + SCT_MaterialManager materials; + + // Create child components + m_outerSide = new SCT_OuterSide("OuterSide"); + m_baseBoard = new SCT_BaseBoard("BaseBoard"); + m_innerSide = new SCT_InnerSide("InnerSide"); + //m_sensor = new SCT_Sensor("BRLSensor"); // 14:00 Thu 14th Jul 2005 D.Naito removed. + + // + // We have 2 envelopes. + // 1. It contains two sensors and baseBoard. + // 2. It contains hybrid and pigtail. + // + // See "doc/cornerName.ps". + // + + // We need to take into account the safety incorporated in the inner and outer side + // envelopes. + double sensorWidth = m_innerSide->sensor()->width() + m_safety; + double sensorLength = m_innerSide->sensor()->length() + m_safety; + double innerSideHybridWidth = m_innerSide->hybrid()->width() + m_safety; + double innerSideHybridLength = m_innerSide->hybrid()->length() + m_safety; + double outerSideHybridWidth = m_outerSide->hybrid()->width() + m_safety; + double outerSideHybridLength = m_outerSide->hybrid()->length() + m_safety; + double baseBoardWidth = m_baseBoard->width() + m_safety; + double baseBoardLength = m_baseBoard->length() + m_safety; + double outerSidePigtailLength = m_outerSide->pigtail()->length() + m_safety; + + + // Define constants for convenience. + // for corner of outer side sensor. + CLHEP::Hep3Vector a(0.0, 0.5 * sensorWidth, 0.5 * sensorLength); + CLHEP::Hep3Vector b(0.0, -0.5 * sensorWidth, a.z()); + CLHEP::Hep3Vector c(0.0, b.y(),-0.5 * sensorLength); + CLHEP::Hep3Vector d(0.0, a.y(), c.z()); + + // for corner of inner side sensor. + CLHEP::Hep3Vector e(0.0, a.y(), a.z()); + CLHEP::Hep3Vector f(0.0, b.y(), b.z()); + CLHEP::Hep3Vector g(0.0, c.y(), c.z()); + CLHEP::Hep3Vector h(0.0, d.y(), d.z()); + + // for corner of base board. + CLHEP::Hep3Vector u(0.0, + m_baseBoardOffsetY + 0.5*baseBoardWidth, + m_baseBoardOffsetZ + 0.5*baseBoardLength); + CLHEP::Hep3Vector v(0.0, m_baseBoardOffsetY - 0.5*baseBoardWidth, u.z()); + CLHEP::Hep3Vector w(0.0, v.y(), m_baseBoardOffsetZ - 0.5*baseBoardLength); + CLHEP::Hep3Vector x(0.0, u.y(),w.z()); + + // for corner of hybrid, connectorouter and pigtail of outer side. + //CLHEP::Hep3Vector i(0.0, + // 0.5*outerSideHybridWidth, + // m_outerSide->hybridOffsetZ() + 0.5*outerSideHybridLength); + // CLHEP::Hep3Vector k(0.0, + // -0.5*outerSideHybridWidth, + // m_outerSide->hybridOffsetZ() + 0.5*outerSidePigtailLength); + //CLHEP::Hep3Vector l(0.0, + // -0.5*outerSideHybridWidth - m_outerSide->pigtail()->width(), k.z()); + //CLHEP::Hep3Vector m(0.0, l.y(), + // m_outerSide->hybridOffsetZ() - 0.5*outerSidePigtailLength); + //CLHEP::Hep3Vector n(0.0, k.y(),m.z()); + //CLHEP::Hep3Vector p(0.0, i.y(), + // m_outerSide->hybridOffsetZ() - 0.5*outerSideHybridLength); + + CLHEP::Hep3Vector i(0.0, + 0.5*outerSideHybridWidth, + m_outerSide->hybridOffsetZ() + 0.5*outerSidePigtailLength); + CLHEP::Hep3Vector l(0.0, + -0.5*outerSideHybridWidth - m_outerSide->pigtail()->width(), i.z()); + CLHEP::Hep3Vector m(0.0, l.y(), + m_outerSide->hybridOffsetZ() - 0.5*outerSidePigtailLength); + CLHEP::Hep3Vector p(0.0, i.y(), + m.z()); + + + + // for corner of hybrid and interConnect of inner side. + CLHEP::Hep3Vector q(0.0, 0.5*outerSideHybridWidth, m_outerSide->hybridOffsetZ() + 0.5*outerSideHybridLength ); + CLHEP::Hep3Vector r(0.0, -0.5*innerSideHybridWidth, q.z()); + CLHEP::Hep3Vector s(0.0, r.y(), m_innerSide->hybridOffsetZ() - 0.5*innerSideHybridLength); + CLHEP::Hep3Vector t(0.0, q.y(), s.z()); + + // All points turn +-20 mCLHEP::rad around physical center of module. + a.rotateX(m_stereoOuter/CLHEP::radian); + b.rotateX(m_stereoOuter/CLHEP::radian); + c.rotateX(m_stereoOuter/CLHEP::radian); + d.rotateX(m_stereoOuter/CLHEP::radian); + + e.rotateX(m_stereoInner/CLHEP::radian); + f.rotateX(m_stereoInner/CLHEP::radian); + g.rotateX(m_stereoInner/CLHEP::radian); + h.rotateX(m_stereoInner/CLHEP::radian); + + i.rotateX(m_stereoOuter/CLHEP::radian); + //k.rotateX(m_stereoOuter/CLHEP::radian); + l.rotateX(m_stereoOuter/CLHEP::radian); + m.rotateX(m_stereoOuter/CLHEP::radian); + //n.rotateX(m_stereoOuter/CLHEP::radian); + p.rotateX(m_stereoOuter/CLHEP::radian); + + q.rotateX(m_stereoInner/CLHEP::radian); + r.rotateX(m_stereoInner/CLHEP::radian); + s.rotateX(m_stereoInner/CLHEP::radian); + t.rotateX(m_stereoInner/CLHEP::radian); + + // Calculate demension of envelope1. + const double z_ab = std::max(a.z(), b.z()); + const double z_ef = std::max(e.z(), f.z()); + const double z_cd = std::min(c.z(), d.z()); + const double z_gh = std::min(g.z(), h.z()); + + const double y_ad = std::max(a.y(), d.y()); + const double y_eh = std::max(e.y(), h.y()); + const double y_bc = std::min(b.y(), c.y()); + const double y_fg = std::min(f.y(), g.y()); + + //const double y_ux = std::max(u.y(), x.y()); + //const double y_vw = std::min(v.y(), w.y()); + + const double zmaxEnv1 = std::max(z_ab, z_ef); + const double zminEnv1 = std::min(z_cd, z_gh); + + const double ypre_maxEnv1 = std::max(y_ad, y_eh); + const double ypre_minEnv1 = std::min(y_bc, y_fg); + + const double ymaxEnv1 = std::max(ypre_maxEnv1, u.y()); + const double yminEnv1 = std::min(ypre_minEnv1, v.y()); + + // some temporary value. + const double thicknessEnv1 = m_sensorGap + 2.0*m_outerSide->sensor()->thickness(); + const double lengthEnv1 = zmaxEnv1 - zminEnv1; + const double widthEnv1 = ymaxEnv1 - yminEnv1; + + // Center of evnelope1. + const double xCenterEnv1 = 0.0; + const double yCenterEnv1 = yminEnv1 + 0.5*widthEnv1; + const double zCenterEnv1 = zmaxEnv1 - 0.5*lengthEnv1; + + m_env1RefPointVector = new CLHEP::Hep3Vector(-xCenterEnv1, -yCenterEnv1, -zCenterEnv1); + + // Calculate demension of envelope2. + const double z_ikl = std::max(i.z(), l.z()); + const double z_qr = std::max(q.z(), r.z()); + const double z_mnp = std::min(m.z(), p.z()); + const double z_st = std::min(s.z(), t.z()); + + const double y_ip = std::max(i.y(), p.y()); + const double y_qt = std::max(q.y(), t.y()); + const double y_lm = std::min(l.y(), m.y()); + const double y_rs = std::min(r.y(), s.y()); + + const double zmaxEnv2 = std::max(z_ikl, z_qr); + const double zminEnv2 = std::min(z_mnp, z_st); + + const double ymaxEnv2 = std::max(y_ip, y_qt); + const double yminEnv2 = std::min(y_lm, y_rs); + + const double thicknessEnv2 = 2.0*(m_outerSide->hybridOffsetX() + + 0.5*m_innerSide->sensor()->thickness() + + 0.5*m_sensorGap + + 0.5*m_outerSide->hybrid()->thickness()); + const double lengthEnv2 = zmaxEnv2 - zminEnv2; + const double widthEnv2 = ymaxEnv2 - yminEnv2; + + // Center of envelope2. + const double xCenterEnv2 = 0.0; + const double yCenterEnv2 = ymaxEnv2 - 0.5*widthEnv2; + const double zCenterEnv2 = zmaxEnv2 - 0.5*lengthEnv2; + + m_env2RefPointVector = new CLHEP::Hep3Vector(-xCenterEnv2, -yCenterEnv2, -zCenterEnv2); + + // 8th Aug 2005 S.Mima modified. + // Calculate dimension of subbox + const double xmaxSubBox = - 0.5*m_baseBoard->thickness() - m_safety; + const double xminSubBox = - 0.5*thicknessEnv2 - 2.0*m_safety; + + const double ymaxSubBox = std::min(r.y(), s.y()) - m_safety; + const double yminSubBox = yminEnv2 - 2.0*m_safety; + + const double zmaxSubBox = zmaxEnv1 + 2.0*m_safety; + const double zminSubBox = zminEnv1 - 2.0*m_safety; + + const double thicknessSubBox = xmaxSubBox - xminSubBox; + const double widthSubBox = ymaxSubBox - yminSubBox; + const double lengthSubBox = zmaxSubBox - zminSubBox; + + // Center of subbox. + const double xCenterSubBox = xmaxSubBox - 0.5*thicknessSubBox; + const double yCenterSubBox = ymaxSubBox - 0.5*widthSubBox; + const double zCenterSubBox = zmaxSubBox - 0.5*lengthSubBox; + + + m_env1Thickness = thicknessEnv1 + 2*m_safety; + m_env1Width = widthEnv1 + 2*m_safety; + m_env1Length = lengthEnv1 + 2*m_safety; + + m_env2Thickness = thicknessEnv2 + 2*m_safety; + m_env2Width = widthEnv2 + 2*m_safety; + m_env2Length = lengthEnv2 + 2*m_safety; + + // Envelope 2 defines the overall thickness. NB. The ski assumes the + // the envelope "thickness" is centered on x, which it is. + m_thickness = m_env2Thickness; + m_activeWidth = m_env2Width; + m_width = m_env2Width; + m_length = m_env1Length; + + // Calculate a few things. + const double OSPosX = 0.5*m_sensorGap + 0.5*m_innerSide->sensor()->thickness(); + const double ISPosX = -(0.5*m_sensorGap + 0.5*m_innerSide->sensor()->thickness()); + + // + // Make an envelope for the whole module. + // + // 6th Feb 2005 D.Naito modified. + const GeoBox * envelope1 = new GeoBox(0.5*m_env1Thickness, 0.5*m_env1Width, 0.5*m_env1Length); + const GeoBox * envelope2 = new GeoBox(0.5*m_env2Thickness, 0.5*m_env2Width, 0.5*m_env2Length); + + // 8th Aug 2005 S.Mima modified. + const GeoBox * subBox = new GeoBox(0.5*thicknessSubBox, 0.5*widthSubBox, 0.6*lengthSubBox); + + // In the following, envelope1 and envelope2 are added and SUBBOX is pulled. + const GeoShape & moduleEnvelope = (*envelope1 << HepGeom::Translate3D(xCenterEnv1, yCenterEnv1, zCenterEnv1)). + add(*envelope2 << HepGeom::Translate3D(xCenterEnv2, yCenterEnv2, zCenterEnv2)). + subtract(*subBox << HepGeom::Translate3D(xCenterSubBox, yCenterSubBox, zCenterSubBox)); + + const GeoLogVol * moduleLog = new GeoLogVol(getName(), &moduleEnvelope, materials.gasMaterial()); + + // + // inner side + // + CLHEP::HepRotation rotInner; + rotInner.rotateZ(180*CLHEP::deg); + rotInner.rotateX(m_stereoInner); + m_innerSidePos = new HepGeom::Transform3D(rotInner, + CLHEP::Hep3Vector(ISPosX, 0.0, 0.0)); + + // + // outer side + // + CLHEP::HepRotation rotOuter; + rotOuter.rotateX(m_stereoOuter); + m_outerSidePos = new HepGeom::Transform3D(rotOuter, + CLHEP::Hep3Vector(OSPosX, 0.0, 0.0)); + + // + // base board + // 6th Apr 2005 S.Mima modified. + // + const double baseBoardPosY = m_baseBoardOffsetY; + const double baseBoardPosZ = m_baseBoardOffsetZ; + m_baseBoardPos = new HepGeom::Translate3D(CLHEP::Hep3Vector( 0.0, baseBoardPosY, baseBoardPosZ)); + + + return moduleLog; +} + + +GeoVPhysVol * +SCT_Module::build(SCT_Identifier id) const +{ + GeoFullPhysVol * module = new GeoFullPhysVol(m_logVolume); + + // We make these fullPhysVols for the alignment code. + // We probably should make the transform for the sensor + // alignable rather than the "side" to save making an extra full phys volume. + + // + // Build the module + // + // Add Baseboard + GeoTransform * baseBoardTransform = new GeoTransform(*m_baseBoardPos); + module->add(baseBoardTransform); + module->add(m_baseBoard->getVolume()); + + // Add innerside + GeoAlignableTransform * innerTransform = new GeoAlignableTransform(*m_innerSidePos); + module->add(innerTransform); + int innerSideNumber = (m_upperSide) ? 0 : 1; + module->add(new GeoNameTag("Side#"+intToString(innerSideNumber))); // Identifier side=0 + module->add(new GeoIdentifierTag(innerSideNumber)); + id.setSide(innerSideNumber); + Identifier innerId = id.getWaferId(); + GeoVPhysVol * innerSide = m_innerSide->build(id); + module->add(innerSide); + // Store alignable transform + detectorManager()->addAlignableTransform(0, innerId, innerTransform, innerSide); + + // Add outerside + GeoAlignableTransform * outerTransform = new GeoAlignableTransform(*m_outerSidePos); + module->add(outerTransform); + int outerSideNumber = m_upperSide; + module->add(new GeoNameTag("Side#"+intToString(outerSideNumber))); // Identifier side=1 + module->add(new GeoIdentifierTag(outerSideNumber)); + id.setSide(outerSideNumber); + Identifier outerId = id.getWaferId(); + GeoVPhysVol * outerSide = m_outerSide->build(id); + module->add(outerSide); + // Store alignable transform + detectorManager()->addAlignableTransform(0, outerId, outerTransform, outerSide); + + return module; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Options.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Options.cxx new file mode 100644 index 00000000000..a8a7557952a --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Options.cxx @@ -0,0 +1,78 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Options.h" + +SCT_Options::SCT_Options() + : m_g3Compatible(false), + m_dc1Geometry(false), + m_dc2Geometry(true), + m_alignable(true), + m_alignModule(true) +{} + +void +SCT_Options::setG3Compatible(bool flag) +{ + m_g3Compatible = flag; + if (flag) setDC1Geometry(); +} + +bool +SCT_Options::g3Compatible() const +{ + return m_g3Compatible; +} + +void +SCT_Options::setDC1Geometry() +{ + m_dc1Geometry = true; + m_dc2Geometry = false; +} + +bool +SCT_Options::versionDC1() const +{ + return m_dc1Geometry; +} + +void +SCT_Options::setDC2Geometry() +{ + m_dc1Geometry = false; + m_dc2Geometry = true; + m_g3Compatible = false; +} + +bool +SCT_Options::versionDC2() const +{ + return m_dc2Geometry; +} + +void +SCT_Options::setAlignable(bool flag) +{ + m_alignable = flag; +} + +bool +SCT_Options::alignable() const +{ + return m_alignable; +} + +void +SCT_Options::setAlignAtModuleLevel(bool flag) +{ + m_alignModule = flag; +} + +bool +SCT_Options::alignAtModuleLevel() const +{ + return m_alignModule; +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx new file mode 100755 index 00000000000..2054ec2e68f --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx @@ -0,0 +1,219 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_OuterSide.h" + +#include "SCT_GeoModel/SCT_Identifier.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelModuleParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" + +// module parts. +#include "SCT_GeoModel/SCT_Sensor.h" +#include "SCT_GeoModel/SCT_Hybrid.h" +#include "SCT_GeoModel/SCT_Pigtail.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoShapeShift.h" + +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" + +#include <cmath> + +SCT_OuterSide::SCT_OuterSide(const std::string & name) + : SCT_UniqueComponentFactory(name), + m_hybrid(0), + m_pigtail(0), + m_sensor(0) + + //m_hybridPos(0), // 16:30 Wed 15th Jun 2005 D.Naito removed. + //m_pigtailPos(0), // 16:30 Wed 15th Jun 2005 D.Naito removed. + //m_sensorPos(0) // 16:30 Wed 15th Jun 2005 D.Naito removed. +{ + getParameters(); + m_logVolume = preBuild(); +} + + +SCT_OuterSide::~SCT_OuterSide() +{ + // Clean up + delete m_hybrid; + delete m_pigtail; + delete m_sensor; + // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (01)********************************* + // *** -->> (01)********************************* + delete m_env1RefPointVector; + delete m_env2RefPointVector; + // *** End of modified lines. ------------------ (01)********************************* + + //delete m_hybridPos; + //delete m_pigtailPos; + //delete m_sensorPos; +} + + +void +SCT_OuterSide::getParameters() +{ + const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + + m_safety = generalParameters->safety(); + m_hybridOffsetZ = parameters->hybridOffsetZ(); + m_hybridOffsetX = parameters->hybridOffsetX(); +} + + +const GeoLogVol * +SCT_OuterSide::preBuild() +{ + SCT_MaterialManager materials; + + // Create child components + m_sensor = new SCT_Sensor("BRLSensor"); + m_hybrid = new SCT_Hybrid("Hybrid"); + m_pigtail = new SCT_Pigtail("Pigtail"); + + // + // Define constants for convenience. + // t_XXX: thickness of XXX. + // w_XXX: width of XXX. + // l_XXX: length of XXX. + // + const double t_hybrid = m_hybrid->thickness(); + const double w_hybrid = m_hybrid->width(); + //const double l_hybrid = m_hybrid->length(); + + const double t_pigtail = m_pigtail->thickness(); + const double w_pigtail = m_pigtail->width(); + const double l_pigtail = m_pigtail->length(); + + const double t_sensor = m_sensor->thickness(); + const double w_sensor = m_sensor->width(); + const double l_sensor = m_sensor->length(); + + // + // Calculate a few things. + // + const double sensorPosX = 0.0; + const double sensorPosY = 0.0; + const double sensorPosZ = 0.0; + + const double hybridPosX = m_hybridOffsetX; + const double hybridPosY = 0.0; + const double hybridPosZ = m_hybridOffsetZ; + + const double pigtailPosX = hybridPosX + 0.5*t_hybrid - 0.5*t_pigtail; + const double pigtailPosY = -0.5*w_hybrid - 0.5*w_pigtail; + const double pigtailPosZ = hybridPosZ; + + // + // ose : OuterSideEnvelope + // Reference: sct_module_geometry.ps + // + const double w_ose1 = w_sensor + m_safety; + const double t_ose1 = t_sensor + m_safety; + const double l_ose1 = l_sensor + m_safety; + + const double t_ose2 = t_hybrid + m_safety; + const double w_ose2 = w_hybrid + w_pigtail + m_safety; + const double l_ose2 = l_pigtail + m_safety; + + const double ose2PosX = hybridPosX; + const double ose2PosY = hybridPosY - 0.5*w_pigtail; + const double ose2PosZ = hybridPosZ; + + // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (02)********************************* + // *** -->> (02)********************************* + m_env1RefPointVector = new CLHEP::Hep3Vector(0.0, 0.0, 0.0); + m_env2RefPointVector = new CLHEP::Hep3Vector(-ose2PosX, -ose2PosY, -ose2PosZ); + // *** End of modified lines. ------------------ (02)********************************* + + m_hybridPos = new GeoTransform(HepGeom::Translate3D(hybridPosX, hybridPosY, hybridPosZ)); + m_pigtailPos = new GeoTransform(HepGeom::Translate3D(pigtailPosX, pigtailPosY, pigtailPosZ)); + + // The depth axis goes from the backside to the implant side + // and so point to away from the module center. + // The two sensor+hybrid combinations are built in a similar way. + // + // ^ + // --- hybrid | + // ------- sensor | x-axis + // + // Shown is the outer side. The inner side is the same but with a rotation of 180 CLHEP::deg around the z-axis. + // + //CLHEP::HepRotation rotSensor; + //rotSensor.rotateZ(180*CLHEP::deg); + //m_outerSidePos = new HepGeom::Transform3D(rotOuter, CLHEP::Hep3Vector(0.5 * (m_sensorGap + sectThickness), 0., 0.)); + //m_sensorPos = new GeoTransform(HepGeom::Transform3D(rotSensor, CLHEP::Hep3Vector(sensorPosX, sensorPosY, sensorPosZ))); + m_sensorPos = new GeoTransform(HepGeom::Translate3D(sensorPosX, sensorPosY, sensorPosZ)); + + + // + // Make an envelope for the whole module. + // + const GeoBox * ose1Shape = new GeoBox(0.5 * t_ose1, + 0.5 * w_ose1, + 0.5 * l_ose1); + const GeoBox * ose2Shape = new GeoBox(0.5 * t_ose2, + 0.5 * w_ose2, + 0.5 * l_ose2); + + const GeoShape & OuterSideEnvelopeShape = (*ose1Shape). + add(*ose2Shape << HepGeom::Translate3D(ose2PosX, ose2PosY, ose2PosZ)); + + const GeoLogVol * OuterSideEnvelopeLog = new GeoLogVol("OuterSideEnvelope", + &OuterSideEnvelopeShape, + materials.gasMaterial()); + + // 28th Mar S.Mima modified. + // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (03)********************************* + //m_thickness = 0.5*t_sensor + m_hybridOffsetX + 0.5*t_ose2; + // *** -->> (03)********************************* + m_thickness = 0.5*t_ose1 + m_hybridOffsetX + 0.5*t_ose2; + // *** End of modified lines. ------------------ (03)********************************* + m_width = w_ose2; + m_length = l_ose1; + + return OuterSideEnvelopeLog; +} + + +GeoVPhysVol * +SCT_OuterSide::build(SCT_Identifier id) const +{ + GeoFullPhysVol * outerSide = new GeoFullPhysVol(m_logVolume); + + // + // Build the outerSide + // + // Add Sensor + outerSide->add(new GeoIdentifierTag(1000)); + outerSide->add(m_sensorPos); + outerSide->add(m_sensor->build(id)); + + // Add Hybrid + outerSide->add(m_hybridPos); + outerSide->add(m_hybrid->getVolume()); + + // Add Pigtail + outerSide->add(m_pigtailPos); + outerSide->add(m_pigtail->getVolume()); + + return outerSide; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx new file mode 100755 index 00000000000..709eecfe7ad --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Pigtail.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelModuleParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_Pigtail::SCT_Pigtail(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + +void +SCT_Pigtail::getParameters() +{ + const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->pigtailMaterial()); + m_thickness = parameters->pigtailThickness(); + m_length = parameters->pigtailLength(); + m_width = parameters->pigtailWidth(); +} + +GeoVPhysVol * +SCT_Pigtail::build() +{ + + // Build the Pigtail. Just a simple box. + const GeoBox * pigtailShape = new GeoBox(0.5*m_thickness, + 0.5*m_width, + 0.5*m_length); + const GeoLogVol * pigtailLog = + new GeoLogVol(getName(), pigtailShape, m_material); + GeoPhysVol * pigtail = new GeoPhysVol(pigtailLog); + + return pigtail; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx new file mode 100755 index 00000000000..0c0f0636034 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_PixelAttachment.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + +// This is the SCT to Pixel attachment. This was originally defined in the +// general indet services but it is in the SCT mother volume. + +SCT_PixelAttachment::SCT_PixelAttachment(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_PixelAttachment::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->pixelAttachmentMaterial()); + m_length = parameters->pixelAttachmentDeltaZ(); + m_innerRadius = parameters->pixelAttachmentInnerRadius(); + m_outerRadius = parameters->pixelAttachmentOuterRadius(); + m_zMin = parameters->pixelAttachmentZMin(); + m_zMax = m_zMin + m_length; +} + +GeoVPhysVol * +SCT_PixelAttachment::build() +{ + // Make the SCT to Pixel attachment. A simple tube. + const GeoTube * shape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + const GeoLogVol * log = new GeoLogVol(getName(), shape, m_material); + + GeoPhysVol * attachment = new GeoPhysVol(log); + + return attachment; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx new file mode 100755 index 00000000000..c8a6db4f401 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_PowerTape.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" + +SCT_PowerTape::SCT_PowerTape(const std::string & name, double length) + : SCT_SharedComponentFactory(name), m_length(length) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_PowerTape::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + SCT_MaterialManager materials; + + // 30th Aug 2005 S.Mima modified. + // m_material = materials.powerTapeMaterial(); + m_material = materials.getMaterial(parameters->powerTapeMaterial()); + m_thickness = parameters->powerTapeThickness(); + m_width = parameters->powerTapeWidth(); +} + +GeoVPhysVol * +SCT_PowerTape::build() +{ + + // Build the PowerTape. + const GeoBox * powerTapeShape = new GeoBox(0.5*m_thickness-epsilon(), 0.5*m_width-epsilon(), 0.5*m_length-epsilon()); + const GeoLogVol *powerTapeLog = + new GeoLogVol(getName(), powerTapeShape, m_material); + GeoPhysVol * powerTape = new GeoPhysVol(powerTapeLog); + + return powerTape; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx new file mode 100755 index 00000000000..e4697174ed0 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx @@ -0,0 +1,167 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Sensor.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_BarrelModuleParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" +#include "InDetReadoutGeometry/SCT_BarrelModuleSideDesign.h" +#include "InDetReadoutGeometry/SiDetectorElement.h" +#include "InDetReadoutGeometry/InDetDD_Defs.h" +#include "InDetReadoutGeometry/SiCommonItems.h" + + +#include "CLHEP/Units/SystemOfUnits.h" + +using namespace InDetDD; + +SCT_Sensor::SCT_Sensor(const std::string & name) + : SCT_UniqueComponentFactory(name) +{ + getParameters(); + m_logVolume = preBuild(); +} + + +void +SCT_Sensor::getParameters() +{ + + const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + SCT_MaterialManager materials; + + m_material = materials.getMaterial(parameters->sensorMaterial()); + m_thickness = parameters->sensorThickness(); + m_length = 0; + if (parameters->sensorNumWafers() == 2) { + m_length = parameters->sensorLength() + parameters->sensorDistCenterToCenter(); + } else { + m_length = parameters->sensorLength(); + } + m_width = parameters->sensorWidth(); + +} + +const GeoLogVol * +SCT_Sensor::preBuild() +{ + + // Build the sensor. Just a simple box. + const GeoBox * sensorShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length); + GeoLogVol * sensorLog = new GeoLogVol(getName(), sensorShape, m_material); + + // Make the moduleside design for this sensor + makeDesign(); + + detectorManager()->addDesign(m_design); + + return sensorLog; +} + + +void +SCT_Sensor::makeDesign() +{ + //SiDetectorDesign::Axis etaAxis = SiDetectorDesign::zAxis; + //SiDetectorDesign::Axis phiAxis = SiDetectorDesign::yAxis; + //SiDetectorDesign::Axis depthAxis = SiDetectorDesign::xAxis; + + const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + + double stripPitch = parameters->sensorStripPitch(); + double stripLength = parameters->sensorStripLength(); + int crystals = parameters->sensorNumWafers(); + double distCenterToCenter = parameters->sensorDistCenterToCenter(); + + //int cells = parameters->sensorNumReadoutStrips(); + //int diodes = parameters->sensorNumStrips(); + //int shift = parameters->sensorStripShift(); + + // For consistency with older version we keep shift = 0. + int cells = parameters->sensorNumReadoutStrips(); + int diodes = cells; + int shift = 0; + + double totalDeadLength = distCenterToCenter - stripLength; + + double xEtaStripPatternCenter = 0; + double xPhiStripPatternCenter = 0; + + // Readout direction is in same direction as local phi direction + bool swapStripReadout = false; + + // The readout side is at the +ve depth direction + int readoutSide = +1; + + m_design = new SCT_BarrelModuleSideDesign(m_thickness, + crystals, + diodes, + cells, + shift, + swapStripReadout, + InDetDD::holes, + stripPitch, + stripLength, + xEtaStripPatternCenter, + xPhiStripPatternCenter, + totalDeadLength, + readoutSide); + // + // Flags to signal if axis can be swapped. + // For rectangular detector these are all true. + // This is the default and no action is required. + // Can force axes not to be swapped by setting to false. + // + // bool phiSyCLHEP::mmetric = true; + // bool etaSyCLHEP::mmetric = true; + // bool depthSyCLHEP::mmetric = true; + // m_design->setSyCLHEP::mmetry(phiSyCLHEP::mmetric, etaSyCLHEP::mmetric, depthSyCLHEP::mmetric, + // +} + + + +GeoVPhysVol * +SCT_Sensor::build(SCT_Identifier id) const +{ + GeoFullPhysVol * sensor = new GeoFullPhysVol(m_logVolume); + + // Make detector element and add to collection + // Only do so if we have a valid id helper. + + //id.print(); // for debugging only + + SiCommonItems* commonItems = geometryManager()->commonItems(); + + if (commonItems->getIdHelper()) { + + SiDetectorElement * detElement; + + detElement = new SiDetectorElement(id.getWaferId(), + m_design, + sensor, + commonItems); + + // Add the detector element. + detectorManager()->addDetectorElement(detElement); + + } else { + + static bool noElementWarning = true; // So we don't get the message thousands of times. + if (noElementWarning) { + std::cout << "WARNING!!!!: No SCT id helper and so no elements being produced." << std::endl; + noElementWarning = false; + } + } + return sensor; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx new file mode 100755 index 00000000000..825e5c8ee41 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx @@ -0,0 +1,527 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Ski.h" +#include "SCT_GeoModel/SCT_Identifier.h" +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_MaterialManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" +#include "SCT_GeoModel/SCT_GeneralParameters.h" +#include "SCT_GeoModel/SCT_Module.h" +#include "SCT_GeoModel/SCT_BaseBoard.h" // 18:00 Wed 15th Jun 2005 D.Naito added. +#include "SCT_GeoModel/SCT_Dogleg.h" +#include "SCT_GeoModel/SCT_CoolingBlock.h" // 14th Aug 2005 S.Mima added. +#include "SCT_GeoModel/SCT_CoolingPipe.h" + +#include "InDetReadoutGeometry/SCT_DetectorManager.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <sstream> +#include <cmath> + +SCT_Ski::SCT_Ski(const std::string & name, + const SCT_Module * module, + int stereoSign, + double tilt, + double length) + : SCT_UniqueComponentFactory(name), + m_stereoSign(stereoSign), + m_tilt(tilt), + m_length(length), + m_module(module) +{ + getParameters(); + m_logVolume = preBuild(); +} + + +SCT_Ski::~SCT_Ski() +{ + delete m_dogleg; + delete m_coolingBlock; + delete m_coolingPipe; + delete m_env1RefPointVector; + delete m_env2RefPointVector; +} + + +void +SCT_Ski::getParameters() +{ + + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + + m_safety = generalParameters->safety(); + + m_radialSep = parameters->skiRadialSep(); + m_firstStagger = parameters->skiFirstStagger(); + m_modulesPerSki = parameters->modulesPerSki(); + for (int iModule = 0; iModule < m_modulesPerSki; iModule++){ + m_zPos.push_back(parameters->skiZPosition(iModule)); + m_id.push_back(parameters->skiModuleIdentifier(iModule)); + } + + // Various offset for the doglegs, cooling blocks and cooling pipe. + // These are not currently needed and are all set to zero. + m_doglegRadialOffset = 0; + m_doglegPhiOffset = 0; + m_coolingBlockPhiOffset = 0; + m_coolingBlockRadialOffset = 0; + m_coolingPipeRadialOffset = 0; + m_coolingPipePhiOffset = 0; + + // 10th Aug 2005 S.Mima modified. + m_coolingBlockOffsetX = parameters->coolingBlockOffsetX(); + m_coolingBlockOffsetY = parameters->coolingBlockOffsetY(); + m_coolingBlockOffsetZ = parameters->coolingBlockOffsetZ(); + m_coolingPipeOffsetX = parameters->coolingPipeOffsetX(); + m_coolingPipeOffsetY = parameters->coolingPipeOffsetY(); + // 15th Aug 2005 S.Mima modified. + m_doglegOffsetX = parameters->doglegOffsetX(); + m_doglegOffsetY = parameters->doglegOffsetY(); +} + +const GeoLogVol * +SCT_Ski::preBuild() +{ + const double rphiClearance = 0.5*CLHEP::mm; + const double radialClearance = 0.5*CLHEP::mm; + + + // Make components. + // 15th Aug 2005 S.Mima modified. + // m_dogleg = new SCT_Dogleg(getName()+"Dogleg"); + m_dogleg = new SCT_Dogleg(getName()+"Dogleg"); + // 15th Aug 2005 S.Mima modified. + // m_coolingBlock = new SCT_CoolingBlock(getName()+"CoolingBlock"); + m_coolingBlock = new SCT_CoolingBlock(getName()+"CoolingBlock"); + m_coolingPipe = new SCT_CoolingPipe(getName()+"CoolingPipe",m_length); + + // We need the sign of the tilt in numerous places + int tiltSign = (m_tilt < 0) ? -1 : +1; + + + // The two modules are lined up in x in the unrotated ski. The ski then gets tilted + // when placed in the layer. + // So the x offset is just the raidal separation and the y offset is zero. + + double xModuleOffset = 0.5 * m_radialSep; + + // *** 10:00 Mon 30th May 2005 D.Naito modified. (12)********************************* + // I get what "yModuleOffset" has role. "yModuleOffset" must be zero. + // I move the calculations of corners to lower area in this code(L336 ~ L367). + // "yModuleOffset = -0.5*(moduleYMax + moduleYMin)" is wrong. + + // *** 18:00 Fri 27th May 2005 D.Naito added. (09)********************************* + + // *** 18:00 Fri 27th May 2005 D.Naito put some comments. + // I need to calculate moduleYMax and moduleYMin for yModuleOffset, + // because the modules is asyCLHEP::mmetry in y direction. + + // + // These are coordinates of corners of module's envelopes. + // + + //CLHEP::Hep3Vector c0(0.0, 0.5*(m_module->env1Width()), 0.5*(m_module->env1Length())); + //CLHEP::Hep3Vector c1(0.0, -0.5*(m_module->env1Width()), 0.5*(m_module->env1Length())); + //CLHEP::Hep3Vector c2(0.0, -0.5*(m_module->env1Width()), -0.5*(m_module->env1Length())); + //CLHEP::Hep3Vector c3(0.0, 0.5*(m_module->env1Width()), -0.5*(m_module->env1Length())); + //CLHEP::Hep3Vector c4(0.0, + // -(m_module->env2RefPointVector()->y()) + 0.5*(m_module->env2Width()), + // -(m_module->env2RefPointVector()->z()) + 0.5*(m_module->env2Length())); + //CLHEP::Hep3Vector c5(0.0, + // -(m_module->env2RefPointVector()->y()) - 0.5*(m_module->env2Width()), + // -(m_module->env2RefPointVector()->z()) + 0.5*(m_module->env2Length())); + //CLHEP::Hep3Vector c6(0.0, + // -(m_module->env2RefPointVector()->y()) - 0.5*(m_module->env2Width()), + // -(m_module->env2RefPointVector()->z()) - 0.5*(m_module->env2Length())); + //CLHEP::Hep3Vector c7(0.0, + // -(m_module->env2RefPointVector()->y()) + 0.5*(m_module->env2Width()), + // -(m_module->env2RefPointVector()->z()) - 0.5*(m_module->env2Length())); + + //double moduleYMax = c4.y(); + //double moduleYMin = c5.y(); + // c0.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + // c1.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + // c2.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + // c3.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + // c4.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + // c5.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + // c6.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + // c7.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + + // moduleYMax = std::max(std::max(c0.y(), c4.y()), std::max(c7.y(), c3.y())); + // moduleYMin = std::min(std::min(c1.y(), c5.y()), std::min(c6.y(), c2.y())); + // *** End of added lines. --------------------- (09)********************************* + + + // *** 18:00 Fri 27th May 2005 D.Naito modified. (10)********************************* + //double yModuleOffset = 0; + // *** -->> (10)********************************* + //double yModuleOffset = -0.5*(moduleYMax + moduleYMin); + // *** End of modified lines. ------------------ (10)********************************* + // *** -->> (12)********************************* + double yModuleOffset = 0.0; + // *** End of modified lines. ------------------ (12)********************************* + + + //std::cout << "xPos, yPos = " << xPos << " " << yPos << std::endl; + + // + // Calculate position of cooling block + // + // Position the cooling block m_coolingBlockPhiOffset from the lower egde + // of the module and m_coolingBlockRadialOffset from surface of the module. + // double xCoolingBlockOffset = -(m_coolingBlockRadialOffset + + // 0.5 * m_module->thickness() + + // 0.5 * m_coolingBlock->thickness()) + epsilon(); + // 10th Aug 2005 S.Mima modified. + double xCoolingBlockOffset = - m_coolingBlockRadialOffset + coolingBlockOffsetX(); + // Works for both tilts. + // *** 18:00 Wed 15th Jun 2005 D.Naito modified. (00)********************************* + // *** 14:00 Fri 27th May 2005 D.Naito modified. (03)********************************* + //double yCoolingBlockOffset = -tiltSign *(0.5 * m_module->baseBoard()->width() + // - 0.5 * m_coolingBlock->width() + // - m_coolingBlockPhiOffset ); + //double zCoolingBlockOffset = m_module->baseBoardCenter(); + // *** -->> (03)********************************* + //double yCoolingBlockOffset = tiltSign *(m_module->baseBoard()->bb1OffsetY() - 0.5*(m_module->baseBoard()->bb1()->width()) + // + 0.5*m_coolingBlock->width() - m_coolingBlockPhiOffset); + //double zCoolingBlockOffset = m_module->baseBoard()->bb1OffsetZ() - 0.5*(m_module->baseBoard()->bb3()->length()); + // *** End of modified lines. ------------------ (03)********************************* + // *** -->> (00)********************************* + //double yCoolingBlockOffset = tiltSign *(m_module->baseBoardOffsetY() - 0.5*(m_module->baseBoard()->width()) + // + 0.5*m_coolingBlock->width() - m_coolingBlockPhiOffset); + // 10th Aug 2005 S.Mima modified. + double yCoolingBlockOffset = tiltSign *(coolingBlockOffsetY() - m_coolingBlockPhiOffset); + // double zCoolingBlockOffset = m_module->baseBoardOffsetZ(); + // 10th Aug 2005 S.Mima modified. + double zCoolingBlockOffset = coolingBlockOffsetZ(); + // *** End of modified lines. ------------------ (03)********************************* + + // + // Calculate position of dogleg + // + // *** 17:00 Fri 27th May 2005 D.Naito modified. (06)********************************* + //double xDoglegOffset = - (m_doglegRadialOffset + 0.5 *m_dogleg->thickness() + // + 0.5 * m_module->thickness()) + // *** -->> (06)********************************* + // 15th Aug 2005 S.Mima modified. + // double xDoglegOffset = - (m_doglegRadialOffset + 0.5 *m_dogleg->thickness() + // + 0.5 * m_module->env2Thickness() + epsilon()); + double xDoglegOffset = doglegOffsetX() - m_doglegRadialOffset; + // *** End of modified lines. ------------------ (06)********************************* + + // NB length of dogleg runs in phi direction. + double yDoglegOffset = tiltSign * (doglegOffsetY() + m_doglegPhiOffset); + + // 15th Aug 2005 S.Mima modified. + // double zDoglegOffset = m_module->baseBoardCenter(); + double zDoglegOffset = coolingBlockOffsetZ(); + + //std::cout << "Dogleg offset: " << yDoglegOffset << std::endl; + + // + // Calculate position of cooling pipe. + // + // First calculate minimum block position. + //double xCoolingBlockPosMin = -xModuleOffset + xCoolingBlockOffset; + //double yCoolingBlockPosMin = -yModuleOffset + yCoolingBlockOffset; + //double yCoolingBlockPosMin = yCoolingBlockOffset; + // 10th Aug 2005 S.Mima modified. + // double xCoolingPipePos = xCoolingBlockPosMin - (m_coolingPipeRadialOffset + + // 0.5 * m_coolingBlock->thickness() + m_coolingPipe->pipeRadius()); + double xCoolingPipePos = coolingPipeOffsetX() - m_coolingPipeRadialOffset; + //double yCoolingPipePos = yCoolingBlockPosMin + m_coolingPipePhiOffset; + double yCoolingPipePos = coolingPipeOffsetY() + m_coolingPipePhiOffset; + m_coolingPipePos = new GeoTransform(HepGeom::Translate3D(xCoolingPipePos, yCoolingPipePos, 0)); + + // + // + // + + int stagger_sign = m_firstStagger; + // Loop over modules in ski as we need their z positions. + for (int iModule = 0; iModule < m_modulesPerSki; iModule++) { + + // For compatibility with AGE we need to offset the module in y by -0.5*sep*sin(tilt) so that center + // of module lines up with radial line. (Not sure if this is what is done in reality) + + // Not sure if this needs to be alignable + double xModulePos = stagger_sign * xModuleOffset; + // *** 20:00 Fri 27th May 2005 D.Naito modified. (11)********************************* + //double yModulePos = stagger_sign * yModuleOffset; + // *** -->> (11)********************************* + double yModulePos = yModuleOffset; + // *** End of modified lines. ------------------ (04)********************************* + double zModulePos = m_zPos[iModule]; + CLHEP::HepRotation rot; + + // There is only one type of module and this is rotated one way or the other + // to get the phi-v (-ve), u-phi (+ve) orientations + rot.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + CLHEP::Hep3Vector pos(xModulePos, yModulePos, zModulePos); + m_modulePos.push_back(HepGeom::Transform3D(rot, pos)); + + // + // Calculate position of cooling block + // + + double xCoolingBlockPos = xCoolingBlockOffset + xModulePos; + double yCoolingBlockPos = yCoolingBlockOffset + yModulePos; + double zCoolingBlockPos = zCoolingBlockOffset + zModulePos; + m_coolingBlockPos.push_back(new GeoTransform(HepGeom::Translate3D(xCoolingBlockPos, yCoolingBlockPos, zCoolingBlockPos))); + + + // + // Calculate position of dogleg + // + double xDoglegPos = xDoglegOffset + xModulePos; + double yDoglegPos = yDoglegOffset + yModulePos; + double zDoglegPos = zDoglegOffset + zModulePos; + m_doglegPos.push_back(new GeoTransform(HepGeom::Translate3D(xDoglegPos, yDoglegPos, zDoglegPos))); + + // alternate staggering + stagger_sign = - stagger_sign; + + + } + + // + // calculate envelope for ski with just modules. Not all these are used. + // These are coordinates of corners of module's envelopes. + // + + CLHEP::Hep3Vector c0(0.0, + -(m_module->env1RefPointVector()->y()) + 0.5*(m_module->env1Width()), + -(m_module->env1RefPointVector()->z()) + 0.5*(m_module->env1Length())); + CLHEP::Hep3Vector c1(0.0, + -(m_module->env1RefPointVector()->y()) - 0.5*(m_module->env1Width()), + -(m_module->env1RefPointVector()->z()) + 0.5*(m_module->env1Length())); + CLHEP::Hep3Vector c2(0.0, + -(m_module->env1RefPointVector()->y()) - 0.5*(m_module->env1Width()), + -(m_module->env1RefPointVector()->z()) - 0.5*(m_module->env1Length())); + CLHEP::Hep3Vector c3(0.0, + -(m_module->env1RefPointVector()->y()) + 0.5*(m_module->env1Width()), + -(m_module->env1RefPointVector()->z()) - 0.5*(m_module->env1Length())); + CLHEP::Hep3Vector c4(0.0, + -(m_module->env2RefPointVector()->y()) + 0.5*(m_module->env2Width()), + -(m_module->env2RefPointVector()->z()) + 0.5*(m_module->env2Length())); + CLHEP::Hep3Vector c5(0.0, + -(m_module->env2RefPointVector()->y()) - 0.5*(m_module->env2Width()), + -(m_module->env2RefPointVector()->z()) + 0.5*(m_module->env2Length())); + CLHEP::Hep3Vector c6(0.0, + -(m_module->env2RefPointVector()->y()) - 0.5*(m_module->env2Width()), + -(m_module->env2RefPointVector()->z()) - 0.5*(m_module->env2Length())); + CLHEP::Hep3Vector c7(0.0, + -(m_module->env2RefPointVector()->y()) + 0.5*(m_module->env2Width()), + -(m_module->env2RefPointVector()->z()) - 0.5*(m_module->env2Length())); + + double moduleYMax = c4.y(); + double moduleYMin = c5.y(); + c0.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + c1.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + c2.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + c3.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + c4.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + c5.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + c6.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + c7.rotateX(0.5 * m_stereoSign * m_module->stereoAngle()); + + moduleYMax = std::max(std::max(c0.y(), c4.y()), std::max(c7.y(), c3.y())); + moduleYMin = std::min(std::min(c1.y(), c5.y()), std::min(c6.y(), c2.y())); + + double skiWidth = moduleYMax - moduleYMin + 2*rphiClearance; + + // + // 17:00 Fri 27th May 2005 D.Naito put some comments. + // m_module->thickness() corresponds to the thickness of envelope2 of SCT_Module. + // NB. The envelope is centered on x. + // + double skiThickness = m_module->thickness() + 2 * std::abs(xModuleOffset) + radialClearance; + //double skiLength = 2.0 * std::max(std::abs(m_zPos[0]), std::abs(m_zPos[m_modulesPerSki - 1])) + // + m_module->length(); + + // Due to the cooling block and dogleg being next to the module and + // as the modules are staggered it is no longer possible to have a + // simple envelope around the ski. + + // Calculate envelope needed. This is a boolean of two rectangles. + // 1. Contains the modules and dogleg. + // 2. Contains the cooling pipe and cooling block. + + double xmax1 = 0.5*skiThickness; + double xmin1 = -xModuleOffset + xDoglegOffset - 0.5*m_dogleg->thickness(); + double xmax2 = xmax1; + double xmin2 = xCoolingPipePos - m_coolingPipe->pipeRadius(); + + // Take into account possiblity that the dogleg extends past the module. + + // *** 17:00 Fri 27th May 2005 D.Naito modified. (07)********************************* + //double maxWidth = std::max(std::max(std::abs(-yModuleOffset + yDoglegOffset) + 0.5*m_dogleg->length(), + // std::abs(+yModuleOffset + yDoglegOffset) + 0.5*m_dogleg->length()), + // 0.5*skiWidth); + //double ymax1 = maxWidth; + //double ymin1 = -maxWidth; + // *** -->> (07)********************************* + double ymax1 = moduleYMax + rphiClearance; + double ymin1 = moduleYMin - rphiClearance; + // *** End of modified lines. ------------------ (07)********************************* + double ymin2,ymax2; + if (tiltSign > 0) { + ymax2 = std::max(-yModuleOffset + yCoolingBlockOffset + 0.5*m_coolingBlock->width(), + yCoolingPipePos + m_coolingPipe->pipeRadius()); + ymin2 = ymin1; + } else { + ymax2 = ymax1; + ymin2 = std::min(-yModuleOffset + yCoolingBlockOffset - 0.5*m_coolingBlock->width(), + yCoolingPipePos - m_coolingPipe->pipeRadius()); + } + + + // Add some safety + xmin1 -= m_safety; + xmax1 += m_safety; + ymin1 -= m_safety; + ymax1 += m_safety; + // std::cout << "xmin1,xmax1,ymin1,ymax1= " << xmin1 << " " << xmax1 << " " << ymin1 << " " << ymax1 << std::endl; + + xmin2 -= m_safety; + xmax2 += m_safety; + ymin2 -= m_safety; + ymax2 += m_safety; + // std::cout << "xmin2,xmax2,ymin2,ymax2= " << xmin2 << " " << xmax2 << " " << ymin2 << " " << ymax2 << std::endl; + + double xCenter = 0.5*(xmin1+xmax1); + double yCenter = 0.5*(ymin1+ymax1); + double xShift2 = 0.5*(xmin2+xmax2) - xCenter; + double yShift2 = 0.5*(ymin2+ymax2) - yCenter; + //double xCoolingPipeShift = xCoolingPipePos - xCenter; + //double yCoolingPipeShift = yCoolingPipePos - yCenter; + + m_refPointTransform = new GeoTransform(HepGeom::Translate3D(-xCenter, -yCenter, 0)); + // std::cout << "xCenter, yCenter = " << xCenter << " " << yCenter << std::endl; + // std::cout << "xShift2, yShift2 = " << xShift2 << " " << yShift2 << std::endl; + // std::cout << "xCoolingPipePos, yCoolingPipePos = " << xCoolingPipePos << " " << yCoolingPipePos << std::endl; + + // *** 10:00 Tue 31st May 2005 D.Naito modified. (14)********************************* + // *** -->> (14)********************************* + m_env1RefPointVector = new CLHEP::Hep3Vector(-xCenter, -yCenter, 0.0); + m_env2RefPointVector = new CLHEP::Hep3Vector(-xShift2, -yShift2, 0.0); + m_env1Thickness = xmax1-xmin1; + m_env1Width = ymax1-ymin1; + m_env2Thickness = xmax2-xmin2; + m_env2Width = ymax2-ymin2; + // *** End of modified lines. ------------------ (14)********************************* + + GeoBox * envelope1 = new GeoBox(0.5 * (xmax1-xmin1), 0.5 * (ymax1-ymin1), 0.5 * m_length); + GeoBox * envelope2 = new GeoBox(0.5 * (xmax2-xmin2), 0.5 * (ymax2-ymin2), 0.5 * m_length); + + const GeoShape * skiEnvelopeShape = 0; + + const GeoShape & tmpShape = (*envelope1). + add(*envelope2 << HepGeom::Translate3D(xShift2, yShift2, 0)); + skiEnvelopeShape = &tmpShape; + + + SCT_MaterialManager materials; + GeoLogVol * skiLog = new GeoLogVol(getName(), skiEnvelopeShape, materials.gasMaterial()); + + //GeoPhysVol * ski = new GeoPhysVol(skiLog); + + // Make names once only so we don't recreate them again again. + for (int iModule = 0; iModule < m_modulesPerSki; iModule++) { + // Add identifier to name. + std::ostringstream name; + name << "Module#" << m_id[iModule]; + m_nameTag.push_back(new GeoNameTag(name.str())); + } + + + // Define thickness, width, and length. This is chosen as bounding box centered on the ski rotation axis + // which contains the modules and dogleg (ie cooling blocks and cooling pipe is ignored.) + m_thickness = 2 * std::abs(xmin1); + // *** 17:00 Fri 27th May 2005 D.Naito modified. (08)********************************* + //m_width = 2 * maxWidth; + // *** -->> (08)********************************* + m_width = skiWidth; + // *** End of modified lines. ------------------ (08)********************************* + // m_length defined in constructor. + + + // Calculate the clearances. Module envelope1 is the thickness up to the sensors. This is used for the module to + // module distance + + //std::cout << "Clearance Module to Module: " + // << m_radialSep - m_module->env1Thickness() << std::endl; + //std::cout << "Clearance Module to Dogleg: " + // << std::abs(xDoglegOffset) - 0.5*m_dogleg->thickness() - 0.5*m_module->thickness() << std::endl; + //std::cout << "Clearance Module to Cooling Block: " + // << std::abs(xCoolingBlockOffset) - 0.5*m_coolingBlock->thickness() - 0.5 * m_module->baseBoard()->thickness() - m_safety + // << std::endl; + //std::cout << "Cooling block to pipe: " << std::abs(-xModuleOffset + xCoolingBlockOffset - xCoolingPipePos) + // - 0.5*m_coolingBlock->thickness() - m_coolingPipe->pipeRadius() + // << std::endl; + + return skiLog; + +} + + +GeoVPhysVol * +SCT_Ski::build(SCT_Identifier id) const +{ + GeoPhysVol * ski = new GeoPhysVol(m_logVolume); + + + for (int iModule = 0; iModule < m_modulesPerSki; iModule++) { + + // Add modules. + ski->add(m_refPointTransform); + GeoAlignableTransform * moduleTransform = new GeoAlignableTransform(m_modulePos[iModule]); + ski->add(moduleTransform); + ski->add(m_nameTag[iModule]); + ski->add(new GeoIdentifierTag(m_id[iModule])); + id.setEtaModule(m_id[iModule]); // Set identifier. + GeoVPhysVol * modulePV = m_module->build(id); + ski->add(modulePV); + + // Store alignable transform + detectorManager()->addAlignableTransform(1, id.getWaferId(), moduleTransform, modulePV); + + // Add dogleg + ski->add(m_refPointTransform); + ski->add(m_doglegPos[iModule]); + ski->add(m_dogleg->getVolume()); + + // and coolingblock + ski->add(m_refPointTransform); + ski->add(m_coolingBlockPos[iModule]); + ski->add(m_coolingBlock->getVolume()); + } + + // Add Cooling pipe + ski->add(m_refPointTransform); + ski->add(m_coolingPipePos); + ski->add(m_coolingPipe->getVolume()); + + return ski; +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx new file mode 100755 index 00000000000..b8740825317 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx @@ -0,0 +1,261 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// 1st Feb 2005 D.Naito modified. +// 28th Mar 2005 S.Mima modified. +// +#include "SCT_GeoModel/SCT_SkiAux.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" +#include "SCT_GeoModel/SCT_GeometryManager.h" + +#include "SCT_GeoModel/SCT_Ski.h" +#include "SCT_GeoModel/SCT_Module.h" +// 14th Aug 2005 S.Mima modified. +//#include "SCT_GeoModel/SCT_Bracket.h" +#include "SCT_GeoModel/SCT_Bracket.h" +#include "SCT_GeoModel/SCT_Harness.h" +#include "SCT_GeoModel/SCT_SkiPowerTape.h" + +#include "GeoModelKernel/GeoTubs.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <cmath> + +inline double sqr(double x) {return x*x;} + +// Small utility function to determine min and max angle of components. +void +calcMinMaxRatioS(double xCenter, double yCenter, + double xWidth, double yWidth, + double & minRatio, double & maxRatio); + +SCT_SkiAux::SCT_SkiAux(const std::string & name, + const SCT_Ski * ski, + // 14th Aug 2005 S.Mima modified. + //const SCT_Bracket * bracket, + const SCT_Bracket * bracket, + const SCT_Harness * harness, + const SCT_SkiPowerTape * skiPowerTape, + double innerRadius, + double bracketPhiOffset, + double powerTapePhiOffset, + double divisionAngle) : + SCT_SharedComponentFactory(name), + m_innerRadius(innerRadius), + m_bracketPhiOffset(bracketPhiOffset), + m_powerTapePhiOffset(powerTapePhiOffset), + m_sectorAngle(divisionAngle), + m_ski(ski), m_bracket(bracket), m_harness(harness), m_skiPowerTape(skiPowerTape) +{ + getParameters(); + m_physVolume = build(); +} + +void +SCT_SkiAux::getParameters() +{ +} + +GeoVPhysVol * +SCT_SkiAux::build() +{ + // SkiAux is a composition with all the elements that go along with + // ski but are not tilted with the ski. Currently the brackets, harness + // and powertapes. Harness is not present in older geometries. + // The reference point is the beam axis. + // The envelope is a tube sector. + + // + // Calculate Position of Brackets. Z position is calculated when it is positioned + // + // phi offset is calculated in SCT_Layer. For AGE compatible version it is positioned + // such that the lower edge of the bracket is lined up with the upper + // edge of the next module below it. + + // std::cout << "m_bracketPhiOffset = " << m_bracketPhiOffset << std::endl; + // std::cout << "m_powerTapePhiOffset = " << m_powerTapePhiOffset << std::endl; + // std::cout << "m_sectorAngle = " << m_sectorAngle << std::endl; + + // Define small distance for avoiding overlaps. + double radiusBracket = m_innerRadius + 0.5*m_bracket->thickness() + epsilon(); + double xBracketPos = radiusBracket * cos(m_bracketPhiOffset); + double yBracketPos = radiusBracket * sin(m_bracketPhiOffset); + + // std::cout << "Bracket x,y = " << xBracketPos << " " << yBracketPos << std::endl; + + // Calculate position of harness, if present. Phi offset is + // same as power tapes, and we leave a gap equal to one tape + // width + double xHarnessPos = 0; + double yHarnessPos = 0; + if(m_harness != 0) { + double radiusHarness = m_innerRadius + + 0.5 * m_harness->thickness() + + m_skiPowerTape->powerTapeThickness(); + xHarnessPos = radiusHarness * cos(m_powerTapePhiOffset); + yHarnessPos = radiusHarness * sin(m_powerTapePhiOffset); + } + // std::cout << "Harness x,y = " << xHarnessPos << " " << yHarnessPos << std::endl; + + // + // Calculate Position of PowerTapes + // + // Calculate x position of stack of tapes. + // If no harness is present, this is on the outer surface of the support + // cylinder with a gap equal to a tape width. In AGE there is a bug at the + // moment so this is not identical to AGE. + // If the harness is present, the power tapes are moved beyond the harness + + double radiusTape = m_innerRadius + + 0.5 * m_skiPowerTape->thickness() + + m_skiPowerTape->powerTapeThickness(); + if(m_harness != 0) {radiusTape += m_harness->thickness();} + double xTapePos = radiusTape * cos(m_powerTapePhiOffset); + double yTapePos = radiusTape * sin(m_powerTapePhiOffset); + + // std::cout << "Tape x,y = " << xTapePos << " " << yTapePos << std::endl; + + // + // Calculate envelope. + // + // Calculate the max radius that the components extend to. + // N.B. harness is inside power tape, so don't need to check it + double rMaxExtentOfPowerTape = + sqrt( sqr(radiusTape + 0.5 * m_skiPowerTape->thickness()) + + sqr(0.5 * m_skiPowerTape->width()) ); + + double rMaxExtentOfBracket = + sqrt( sqr(radiusBracket + 0.5 * m_bracket->thickness()) + + sqr(0.5 * m_bracket->width()) ); + + m_outerRadius = std::max(rMaxExtentOfBracket,rMaxExtentOfPowerTape) + epsilon(); + + + // calculate min and max tan(alpha) = y/x in order to work out + // maximum and minimum angle for the sector. + // Assumes angles are between -pi/2 and pi/2 and don't straddle pi/2 boarder. + double minAngle=0.; + double maxAngle=0.; + + double halfAngleBracket = atan(0.5 * m_bracket->width()/m_innerRadius); + double halfAnglePowerTape = atan(0.5 * m_skiPowerTape->width()/m_innerRadius); + // Harness and power tape are at same phi + if(m_harness != 0) { + double halfAngleHarness = atan(0.5 * m_harness->width()/m_innerRadius); + halfAnglePowerTape = std::max(halfAnglePowerTape, halfAngleHarness); + } + + if (m_powerTapePhiOffset > m_bracketPhiOffset) { + minAngle = m_bracketPhiOffset - halfAngleBracket; + maxAngle = m_powerTapePhiOffset + halfAnglePowerTape; + } else { + minAngle = m_powerTapePhiOffset - halfAnglePowerTape; + maxAngle = m_bracketPhiOffset + halfAngleBracket; + } + + + // Calculate extent so that min and max angle are equal distant to sector edge + double midAngle = 0.5 * (minAngle+maxAngle); + m_sectorStartAngle = midAngle - 0.5 * m_sectorAngle; + + // Length is same as power tape length + m_length = m_skiPowerTape->length(); + + + SCT_MaterialManager materials; + const GeoTubs * skiAuxShape = new GeoTubs(m_innerRadius, m_outerRadius, 0.5*m_length, + m_sectorStartAngle, m_sectorAngle); + const GeoLogVol *skiAuxLog = + new GeoLogVol(getName(), skiAuxShape, materials.gasMaterial()); + GeoPhysVol * skiAux = new GeoPhysVol(skiAuxLog); + // std::cout << "SCT_SkiAux: m_sectorStartAngle = " << m_sectorStartAngle + // << ", m_sectorAngle = " << m_sectorAngle << std::endl; + // + // std::cout << "minangle, maxangle, m_sectorStartAngle, m_sectorAngle = " + // << std::endl; + // std::cout << minAngle << "," << maxAngle << ", " + // << m_sectorStartAngle << "," + // << m_sectorAngle << std::endl; + + // + // Position brackets + // + + // Loop over modules in ski as we need their z positions. + for (int iModule = 0; iModule < m_ski->modulesPerSki(); iModule++) { + + // Z Position is position of the center of the baseBoard: + // 15th Aug 2005 S.Mima modified. + // double baseBoardPosZ = m_ski->zPos(iModule) + m_ski->module()->baseBoardCenter(); + double coolingCenterPosZ = m_ski->zPos(iModule) + m_ski->coolingBlockOffsetZ(); + CLHEP::Hep3Vector posBracket(xBracketPos, yBracketPos, coolingCenterPosZ); + CLHEP::HepRotation rotBracket; + rotBracket.rotateZ(m_bracketPhiOffset); + skiAux->add(new GeoTransform(HepGeom::Transform3D(rotBracket, posBracket))); + skiAux->add(m_bracket->getVolume()); + } + + // Position the harness + if(m_harness != 0) { + CLHEP::Hep3Vector posHarness(xHarnessPos, yHarnessPos, 0); + CLHEP::HepRotation rotHarness; + rotHarness.rotateZ(m_powerTapePhiOffset); + skiAux->add(new GeoTransform(HepGeom::Transform3D(rotHarness,posHarness))); + skiAux->add(m_harness->getVolume()); + } + + // + // Position the power tapes + // + CLHEP::Hep3Vector posTape(xTapePos, yTapePos, 0); + CLHEP::HepRotation rotTape; + rotTape.rotateZ(m_powerTapePhiOffset); + + skiAux->add(new GeoTransform(HepGeom::Transform3D(rotTape,posTape))); + skiAux->add(m_skiPowerTape->getVolume()); + + + // return the volume pointer of the top volume + return skiAux; + +} + +void +calcMinMaxRatioS(double xCenter, double yCenter, + double xWidth, double yWidth, + double & minRatio, double & maxRatio) +{ + // Returns minRatio and maxRatio + + // This function assumes x is always positive. + double x = 0.5 * xWidth; + double y = 0.5 * yWidth; + + double r00,r01,r10,r11; + + r11 = (yCenter + y) / (xCenter + x); + r00 = (yCenter - y) / (xCenter - x); + r10 = (yCenter + y) / (xCenter - x); + r01 = (yCenter - y) / (xCenter + x); + + //std::cout << "r11,r00,r10,r02: " + // << r11 << " " + // << r00 << " " + // << r10 << " " + // << r01 << " " << std::endl; + + minRatio = std::min(r11 , std::min(r00, std::min(r10, r01))); + maxRatio = std::max(r11 , std::max(r00, std::max(r10, r01))); + +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx new file mode 100755 index 00000000000..4e15b12f957 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx @@ -0,0 +1,173 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// 1st Feb 2005 D.Naito modified. +// 28th Mar 2005 S.Mima modified. +// +#include "SCT_GeoModel/SCT_SkiPowerTape.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +//#include "SCT_GeoModel/SCT_Dogleg.h" // Tue 30th Aug 2005 D.Naito removed. +#include "SCT_GeoModel/SCT_Ski.h" +//#include "SCT_GeoModel/SCT_PowerTape.h" +#include "SCT_GeoModel/SCT_PowerTape.h" +#include "SCT_GeoModel/SCT_Module.h" // 28th Mar 2005 S.Mima modified. + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/Vector/ThreeVector.h" +#include "CLHEP/Vector/Rotation.h" + +#include <sstream> +#include <cmath> + +#include "CLHEP/Units/SystemOfUnits.h" + + + +SCT_SkiPowerTape::SCT_SkiPowerTape(const std::string & name, + const SCT_Ski * ski, + double length) : + SCT_SharedComponentFactory(name), m_length(length), m_ski(ski) +{ + getParameters(); + m_physVolume = build(); +} + +void +SCT_SkiPowerTape::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + // Width is the same as the width of a single powertape. + m_powerTapeThickness = parameters->powerTapeThickness(); + m_width = parameters->powerTapeWidth(); + m_powerTapeStartPointOffset = parameters->powerTapeStartPointOffset(); +} + + +GeoVPhysVol * +SCT_SkiPowerTape::build() +{ + // The power tapes are stacked going from the nearest interlink to the + // nearset edge of the dogleg. + // + // --- --- + // ------ ------ + // --------- --------- + + + int nHalfModules = m_ski->modulesPerSki()/2; + + // Thickness of the stack. + m_thickness = nHalfModules * m_powerTapeThickness; + + + // This is a volume containing all the power tapes. + SCT_MaterialManager materials; + const GeoBox * skiPowerTapeShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length); + const GeoLogVol *skiPowerTapeLog = + new GeoLogVol(getName(), skiPowerTapeShape, materials.gasMaterial()); + GeoPhysVol * skiPowerTape = new GeoPhysVol(skiPowerTapeLog); + + // Loop over modules in ski as we need their z positions. + double mass = 0.; + double ltot = 0.; + for (int iModule = 0; iModule < m_ski->modulesPerSki(); iModule++) { + + // Position of center of hybrid: + // 15th Aug 2005 S.Mima modified. + // double baseBoardPos = m_ski->zPos(iModule) + m_ski->module()->baseBoardCenter(); + + + // Position PowerTapes + // These run from the nearest interlink to the edge of the dogleg + double tapeLength, tapeMid, tapeStart, tapeEnd; + + // nPos is used to stack the power tapes. Modules closest to interlink are + // furthest from support. The positive and negative z positions are + // syCLHEP::mmetric. nPos = 5,4,3,2,1,0,0,1,2,3,4,5 for the 12 modules. + int nPos; + + // test sign of zpos to determine whether the tape runs to the + // high z end or low z end. + + if (m_ski->zPos(iModule) > 0) { + + // Tape runs from high z end to edge of dogleg. NB width of dogleg is in z-direction + // 15th Aug 2005 S.Mima modified. + // tapeStart = baseBoardPos + 0.5 * m_ski->dogleg()->width(); + // tapeEnd = 0.5 * m_length; + tapeStart = m_ski->zPos(iModule) + m_ski->coolingBlockOffsetZ() + m_powerTapeStartPointOffset; + tapeEnd = 0.5 * m_length; + + // For 12 module: iModule = 6, 7, 8, ..., 11 --> nPos = 0, 1, 2, ..., 5 + nPos = iModule - nHalfModules; + + } else { + + // Tape runs from low z end to edge of dogleg. NB width of dogleg is in z-direction + // 15th Aug 2005 S.Mima modified. + // tapeStart = baseBoardPos - 0.5 * m_ski->dogleg()->width(); + // tapeEnd = -0.5 * m_length; + tapeStart = m_ski->zPos(iModule) + m_ski->coolingBlockOffsetZ() - m_powerTapeStartPointOffset; + tapeEnd = -0.5 * m_length; + + // For 12 module: iModule = 0, 1, 2, ..., 5 --> nPos = 5, 4, 3, ..., 0 + nPos = nHalfModules - iModule - 1; + + } + + tapeLength = std::abs(tapeEnd - tapeStart); + tapeMid = 0.5 * (tapeEnd + tapeStart); + // std::cout << "Tape length = " << tapeLength << std::endl; + + + // Make sure that first half are negative and secand half are positive. + // Checking that nPos is >= 0 is equivalent to this. + if (nPos < 0) { + std::cout << "SCT_SkiPowerTape: Module position inconsistent with assumption that\n" + << " first half has z < 0 and second half has z > 0" + << std::endl; + } + + // Create the tape + + // Label tape with M# at end of string + //std::ostringstream label; label << "PowerTapeM" << iModule + 1; + //SCT_PowerTape powerTape(label.str(), tapeLength); + //SCT_PowerTape powerTape(getName()+"PowerTapeM"+intToString(iModule + 1), tapeLength); + SCT_PowerTape powerTape(getName()+"PowerTapeM"+intToString(iModule + 1), tapeLength); + + // Calculate x position of tape. This will depend on the module number. + // The reference point is the middle of the stack. + double xTapePos = - 0.5 * m_thickness + + (nPos + 0.5) * powerTape.thickness(); + double yTapePos = 0; + + + // Position the tape + skiPowerTape->add(new GeoTransform(HepGeom::Translate3D(xTapePos, yTapePos, tapeMid))); + skiPowerTape->add(powerTape.getVolume()); + mass += (powerTape.getVolume()->getLogVol()->getShape()->volume()/CLHEP::cm3)*(powerTape.material()->getDensity()/CLHEP::g/CLHEP::cm3); + ltot += tapeLength; + + } + + // std::cout << "Total power tape mass = " << mass << std::endl; + // std::cout << "Total power tape length = " << ltot << std::endl; + return skiPowerTape; + +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx new file mode 100755 index 00000000000..6ac7338c912 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_Spider.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_Spider::SCT_Spider(const std::string & name) + : SCT_SharedComponentFactory(name) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_Spider::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_materialName = parameters->spiderMaterial(); + m_length = parameters->spiderDeltaZ(); + m_innerRadius = parameters->spiderInnerRadius(); + m_outerRadius = parameters->spiderOuterRadius(); +} + +GeoVPhysVol * +SCT_Spider::build() +{ + // Make the spider. A simple tube. + SCT_MaterialManager materials; + + const GeoTube * spiderShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + m_material = materials.getMaterialForVolume(m_materialName, spiderShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol * spiderLog = new GeoLogVol(getName(), spiderShape, m_material); + + GeoPhysVol * spider = new GeoPhysVol(spiderLog); + + return spider; +} + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx new file mode 100755 index 00000000000..eee354f84df --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx @@ -0,0 +1,53 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_GeoModel/SCT_SupportCyl.h" + +#include "SCT_GeoModel/SCT_MaterialManager.h" + +#include "SCT_GeoModel/SCT_GeometryManager.h" +#include "SCT_GeoModel/SCT_BarrelParameters.h" + +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "CLHEP/Units/SystemOfUnits.h" + + +SCT_SupportCyl::SCT_SupportCyl(const std::string & name, int iLayer, double length) + : SCT_SharedComponentFactory(name), m_iLayer(iLayer), m_length(length) +{ + getParameters(); + m_physVolume = build(); +} + + +void +SCT_SupportCyl::getParameters() +{ + const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + + m_materialName = parameters->supportCylMaterial(m_iLayer); + m_innerRadius = parameters->supportCylInnerRadius(m_iLayer); + m_outerRadius = parameters->supportCylOuterRadius(m_iLayer); + +} + +GeoVPhysVol * +SCT_SupportCyl::build() +{ + // Make the support cyliner. A simple tube. + SCT_MaterialManager materials; + + const GeoTube * supportCylShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length); + m_material = materials.getMaterialForVolume(m_materialName, supportCylShape->volume()); + if(!m_material) {m_material = materials.getMaterial(m_materialName);} + const GeoLogVol * supportCylLog = new GeoLogVol(getName(), supportCylShape, m_material); + + GeoPhysVol * supportCyl = new GeoPhysVol(supportCylLog); + + return supportCyl; +} + + diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/components/SCT_GeoModel_entries.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/components/SCT_GeoModel_entries.cxx new file mode 100755 index 00000000000..60f25f6b1a2 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/components/SCT_GeoModel_entries.cxx @@ -0,0 +1,9 @@ + +#include "SCT_GeoModel/SCT_DetectorTool.h" +#include "GaudiKernel/DeclareFactoryEntries.h" + +DECLARE_TOOL_FACTORY(SCT_DetectorTool) + +DECLARE_FACTORY_ENTRIES(SCT_GeoModel) { + DECLARE_ALGTOOL ( SCT_DetectorTool ) +} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/components/SCT_GeoModel_load.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/components/SCT_GeoModel_load.cxx new file mode 100755 index 00000000000..9f93d1816e1 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/components/SCT_GeoModel_load.cxx @@ -0,0 +1,5 @@ +#include "GaudiKernel/LoadFactoryEntries.h" + +LOAD_FACTORY_ENTRIES(SCT_GeoModel) + + -- GitLab