diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/README b/InnerDetector/InDetDetDescr/SCT_GeoModel/README old mode 100755 new mode 100644 diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..1b1dbc1b881d45f6190bbe3cabcb4fc280323f92 --- /dev/null +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +InnerDetector/InDetDetDescr/SCT_GeoModel diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h old mode 100755 new mode 100644 index 496da203672e3daed1571dc5aeda1af64d29b87f..8a58255181f7504ce714dec2098009d445e7c9c6 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h @@ -1,12 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 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; @@ -17,8 +16,11 @@ class SCT_Barrel : public SCT_UniqueComponentFactory { public: - SCT_Barrel(const std::string & name); - virtual GeoVPhysVol * build(SCT_Identifier id) const; + SCT_Barrel(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); + virtual GeoVPhysVol * build(SCT_Identifier id); public: int numLayers() const {return m_numLayers;} @@ -26,9 +28,6 @@ public: 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(); @@ -49,8 +48,6 @@ private: 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 old mode 100755 new mode 100644 index 7b40a6ffa3cb396d781dd7b1ea84937e66205f5f..09b6190c4a12311bde0ba19f59ebf66685eb4003 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GeoModel_SCT_BarrelModuleParameters_H @@ -14,7 +14,7 @@ class SCT_BarrelModuleParameters { public: // Constructor - SCT_BarrelModuleParameters(); + SCT_BarrelModuleParameters(SCT_DataBase* rdb); // Sensors double sensorThickness() const; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h old mode 100755 new mode 100644 index 111dbe08b8194cf4e426ccbac111bff45ae5c9d0..8ffb7388380ea1bb9265cc715bcb89c0309dd78c --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GeoModel_SCT_BarrelParameters_H @@ -14,7 +14,7 @@ class SCT_BarrelParameters { public: // Constructor - SCT_BarrelParameters(); + SCT_BarrelParameters(SCT_DataBase* rdb); // Ski int skiFirstStagger() const; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h old mode 100755 new mode 100644 index 42b689d5be700b5c83aee1fbef679485fbdadc66..ddd2d08c0600196f88443a1ec667ce853b18bf2e --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_BaseBoard_H @@ -15,7 +15,10 @@ class GeoVPhysVol; class SCT_BaseBoard: public SCT_SharedComponentFactory { public: - SCT_BaseBoard(const std::string & name); + SCT_BaseBoard(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h old mode 100755 new mode 100644 index 73057d438abceb5331c86f1e416974a69dc43283..2ccd94be4c7dfc542ae6935fb2a2d2d6ab646281 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_BRACKET_H @@ -18,7 +18,10 @@ class SCT_Bracket: public SCT_SharedComponentFactory { public: - SCT_Bracket(const std::string & name); + SCT_Bracket(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h old mode 100755 new mode 100644 index 78cb9c515998c686dcb617f2db1da40106dcc17a..2421ff0a773fd7eac15ac5879b1939cdaa124e9a --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_CLAMP_H @@ -16,7 +16,10 @@ class SCT_Clamp : public SCT_SharedComponentFactory public: SCT_Clamp(const std::string & name, int iLayer, - double innerRadius); + double innerRadius, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h old mode 100755 new mode 100644 index 4586a5856ba668d3be985abdfdc5df91319f066a..289d27f1891caf2b78278f7e4367809f9c884490 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_CLOSEOUT_H @@ -14,7 +14,10 @@ class SCT_CloseOut : public SCT_SharedComponentFactory { public: - SCT_CloseOut(const std::string & name, int iLayer); + SCT_CloseOut(const std::string & name, int iLayer, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h old mode 100755 new mode 100644 index a87f6f9f5c1fa212b41d86b0a690d398cddc0be7..cb3a123995b936eb5280df14291a405f0f2a1baa --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_COMPONENTFACTORY_H @@ -10,6 +10,7 @@ namespace InDetDD{class SCT_DetectorManager;} class SCT_GeometryManager; +class SCT_MaterialManager; class GeoLogVol; class GeoVPhysVol; @@ -19,30 +20,27 @@ class SCT_ComponentFactory { public: - SCT_ComponentFactory(const std::string & name); + SCT_ComponentFactory(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); 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); + std::string intToString(int i) const; protected: - InDetDD::SCT_DetectorManager * detectorManager() const {return s_detectorManager;} - const SCT_GeometryManager * geometryManager() const {return s_geometryManager;} + InDetDD::SCT_DetectorManager* m_detectorManager; + const SCT_GeometryManager* m_geometryManager; + SCT_MaterialManager* m_materials; 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; + const static double s_epsilon; }; @@ -51,12 +49,15 @@ class SCT_SharedComponentFactory : public SCT_ComponentFactory { public: - SCT_SharedComponentFactory(const std::string & name) : - SCT_ComponentFactory(name), - m_physVolume(0) + SCT_SharedComponentFactory(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials=nullptr) : + SCT_ComponentFactory(name, detectorManager, geometryManager, materials), + m_physVolume(nullptr) {}; - GeoVPhysVol * getVolume() const {return m_physVolume;} + GeoVPhysVol * getVolume() {return m_physVolume;} protected: GeoVPhysVol * m_physVolume; @@ -68,12 +69,15 @@ class SCT_UniqueComponentFactory : public SCT_ComponentFactory { public: - SCT_UniqueComponentFactory(const std::string & name) : - SCT_ComponentFactory(name), - m_logVolume(0) + SCT_UniqueComponentFactory(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials=nullptr) : + SCT_ComponentFactory(name, detectorManager, geometryManager, materials), + m_logVolume{nullptr} {}; - virtual GeoVPhysVol * build(SCT_Identifier id) const = 0; + virtual GeoVPhysVol * build(SCT_Identifier id) = 0; protected: const GeoLogVol * m_logVolume; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h old mode 100755 new mode 100644 index 65612b0e06ffd342f07c8ffac60473e58545301b..6ddfa222eb6712288a5d9efa21cfcc011ba8d57e --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_COOLINGBLOCK_H @@ -18,7 +18,10 @@ class SCT_CoolingBlock: public SCT_SharedComponentFactory { public: - SCT_CoolingBlock(const std::string & name); + SCT_CoolingBlock(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h old mode 100755 new mode 100644 index c089f8564d365545cb2603afe84592cf3a651049..8de3939bedfbb6f5d6af3144f4bd9e69bd2c2884 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_COOLINGEND_H @@ -16,8 +16,11 @@ class SCT_CoolingEnd : public SCT_SharedComponentFactory public: SCT_CoolingEnd(const std::string & name, int iLayer, - double innerRadius, - double length); + double innerRadius, + double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h old mode 100755 new mode 100644 index f538c271cd695d1b5b9b5277ef71685f4ec01c31..58194f645c87f687c04e341b024ebe22d1a1466e --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_COOLINGPIPE_H @@ -18,7 +18,10 @@ class SCT_CoolingPipe: public SCT_SharedComponentFactory { public: - SCT_CoolingPipe(const std::string & name, double length); + SCT_CoolingPipe(const std::string & name, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h old mode 100755 new mode 100644 index 933087e161a47e2a35c17925e3b1f6db20032d99..c1c561ef67e3db4c371e815251548f869975a76f --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GeoModel_SCT_DataBase_H @@ -18,18 +18,9 @@ class SCT_DataBase public: - // Get pointer to singleton instance. - static SCT_DataBase * instance(); + SCT_DataBase(const SCT_GeoModelAthenaComps* athenaComps); - // 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; + const SCT_GeoModelAthenaComps* athenaComps() const; IRDBRecordset_ptr weightTable() const; IRDBRecordset_ptr scalingTable() const; @@ -103,15 +94,12 @@ public: 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; + const SCT_GeoModelAthenaComps* m_athenaComps; std::string m_sctVersionTag; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h old mode 100755 new mode 100644 index 822cea24a084f1dc0b778720200895e2f518b63a..b6aac2cc9fc4a2b0818c531f8ad58f99dba8aaa9 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_DETECTORFACTORY_H @@ -10,9 +10,11 @@ #include "InDetReadoutGeometry/InDetDD_Defs.h" class GeoPhysVol; +class SCT_DataBase; class SCT_GeometryManager; -class SCT_Options; class SCT_GeoModelAthenaComps; +class SCT_MaterialManager; +class SCT_Options; class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase { @@ -38,6 +40,8 @@ class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase InDetDD::SCT_DetectorManager *m_detectorManager; SCT_GeometryManager *m_geometryManager; + SCT_DataBase* m_db; + SCT_MaterialManager* m_materials; bool m_useDynamicAlignFolders; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactoryCosmic.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactoryCosmic.h old mode 100755 new mode 100644 diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h old mode 100755 new mode 100644 diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h old mode 100755 new mode 100644 index 567c8d1c28d97686b218947175e7a95ba7d59457..1a29840ec840ee1355c311fe8669b65d9f601d0f --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -21,7 +21,10 @@ class SCT_Dogleg: public SCT_SharedComponentFactory { public: - SCT_Dogleg(const std::string & name); + SCT_Dogleg(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h old mode 100755 new mode 100644 index 7c437e9004242377aad05ca491589098c6343ce3..5a447e11670a74b21329d23bc5445210b30ccc4c --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FSIENDJEWEL_H @@ -15,7 +15,10 @@ class SCT_FSIEndJewel : public SCT_SharedComponentFactory { public: - SCT_FSIEndJewel(const std::string & name); + SCT_FSIEndJewel(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h old mode 100755 new mode 100644 index 63da137bdd680cd9c91324a980447734ae2d2d38..56e5a945d8dae866e050840a0c3112fecbac23bf --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FSIFIBREMASK_H @@ -15,7 +15,10 @@ class SCT_FSIFibreMask : public SCT_SharedComponentFactory { public: - SCT_FSIFibreMask(const std::string & name, int iLayer, double length); + SCT_FSIFibreMask(const std::string & name, int iLayer, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h old mode 100755 new mode 100644 diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h old mode 100755 new mode 100644 index ea18db3ca22e8d3064a4d78def46d3903c53857c..34fcf7a5426a43d7e4e9c124e101caef265ce813 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FSISCORPION_H @@ -15,7 +15,10 @@ class SCT_FSIScorpion : public SCT_SharedComponentFactory { public: - SCT_FSIScorpion(const std::string & name); + SCT_FSIScorpion(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h old mode 100755 new mode 100644 index 26b55e5a5618d7fae4cbcd4b0ac6e8e56ba215a9..5d231a3e3264e2f49bc0273a3157bae5c309a4c4 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FLANGE_H @@ -15,7 +15,10 @@ class SCT_Flange : public SCT_SharedComponentFactory { public: - SCT_Flange(const std::string & name, int iLayer); + SCT_Flange(const std::string & name, int iLayer, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h old mode 100755 new mode 100644 index 4c2934a77856bcad8db7c446a6e29cd849a63135..b515a77cbd52f07130d9576cd147282e037cd003 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FORWARD_H @@ -17,7 +17,10 @@ class SCT_Forward : public SCT_UniqueComponentFactory public: - SCT_Forward(const std::string & name, int ec); + SCT_Forward(const std::string & name, int ec, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_Forward(); // @@ -40,7 +43,7 @@ public: double length() const {return m_length;} double zCenter() const {return 0.5*(m_zMin+m_zMax);} - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); @@ -66,9 +69,9 @@ private: double m_outerRadiusCylinderServices; // Child detector elements - std::vector <const SCT_FwdWheel *> m_wheels; + std::vector <SCT_FwdWheel *> m_wheels; - std::vector <const SCT_FwdModule *> m_modules; + std::vector <SCT_FwdModule *> m_modules; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h old mode 100755 new mode 100644 index 6f90aa29f501a70ce3a3051847d4bb8d11e42ebc..c442145313af10fd65311c1b321c9bfe44de29f6 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GeoModel_SCT_ForwardModuleParameters_H @@ -14,7 +14,7 @@ class SCT_ForwardModuleParameters { public: // Constructor - SCT_ForwardModuleParameters(); + SCT_ForwardModuleParameters(SCT_DataBase* rdb); // Sensor // For Inner module there is only one sensor, diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h old mode 100755 new mode 100644 index a438c565917fda84e93b87e037041927be42a464..130c7146b4a43ba6f210add2fa82bc498757db14 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h @@ -1,10 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GeoModel_SCT_ForwardParameters_H #define SCT_GeoModel_SCT_ForwardParameters_H +#include <memory> #include <string> #include <vector> @@ -17,7 +18,7 @@ class SCT_ForwardParameters { public: // Constructor and destructor - SCT_ForwardParameters(); + SCT_ForwardParameters(SCT_DataBase* rdb); ~SCT_ForwardParameters(); ////////////////////////////////////////////////////////////////////////////// @@ -181,7 +182,7 @@ private: SCT_DataBase * m_rdb; - mutable FSIHelper * m_fsiHelper; + std::unique_ptr<FSIHelper> m_fsiHelper; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h old mode 100755 new mode 100644 index 14b7c5608c7d0f4d9bae9bb8a82979731dee43d4..bac694eab7e6e81406d3d0e298f726d42fbe5ff5 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDCOOLINGBLOCK_H @@ -19,7 +19,10 @@ class SCT_FwdCoolingBlock: public SCT_SharedComponentFactory public: - SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary); + SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); enum types {UPPER = 1, LOWER = -1, diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h old mode 100755 new mode 100644 index 311bcf19091c2a89263d3ce61a12b7309043a532..cef91098760a51073930db18e7247418273b260d --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDCOOLINGPIPE_H @@ -19,8 +19,10 @@ public: int numPipes, double innerRadius, double startPos, - double endPos); - + double endPos, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); const GeoMaterial * material() const {return m_material;} double pipeRadius() const {return m_pipeRadius;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h old mode 100755 new mode 100644 index 7e655f575cb94eddf0a73da1dfab7352f6f1d412..0766a478aa8f9f430d891bfa896b100df3bad4e5 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDCYLINDERSERVICES_H @@ -14,7 +14,10 @@ class SCT_FwdCylinderServices : public SCT_SharedComponentFactory public: - SCT_FwdCylinderServices(const std::string & name, double rmin, double rmax, double length); + SCT_FwdCylinderServices(const std::string & name, double rmin, double rmax, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_FwdCylinderServices(); // diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h old mode 100755 new mode 100644 index 8df7a7246f741b694ac62a63579fe644ff4b2258..d760b498291e533b1ba66320b193931e04ce2084 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDDISCFIXATION_H @@ -13,7 +13,10 @@ class SCT_FwdDiscFixation : public SCT_SharedComponentFactory { public: - SCT_FwdDiscFixation(const std::string & name); + SCT_FwdDiscFixation(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h old mode 100755 new mode 100644 index 94bdedc770c42cdf212f020eb2f74e1a82d6cf39..15d6461cd3a0df652a71caa2e68a3a1178ccd3d9 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDDISCPOWERTAPE_H @@ -13,7 +13,10 @@ class SCT_FwdDiscPowerTape : public SCT_SharedComponentFactory { public: - SCT_FwdDiscPowerTape(const std::string & name, int iRing); + SCT_FwdDiscPowerTape(const std::string & name, int iRing, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h old mode 100755 new mode 100644 index 97b6c4b80a16a9795a54850d544183423245f110..7867f6acea908863bf4d3da790d718b593c7cb92 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDDISCSUPPORT_H @@ -13,7 +13,10 @@ class SCT_FwdDiscSupport : public SCT_SharedComponentFactory { public: - SCT_FwdDiscSupport(const std::string & name, int iWheel); + SCT_FwdDiscSupport(const std::string & name, int iWheel, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h old mode 100755 new mode 100644 index 4f4b933ed71946947f989f4254254b0666d49f7a..c2c6a72f9ae7f700f0542b4f3d91555a2e51197d --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDFSI_H @@ -13,7 +13,10 @@ class SCT_FwdFSI : public SCT_SharedComponentFactory { public: - SCT_FwdFSI(const std::string & name, int type); + SCT_FwdFSI(const std::string & name, int type, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h old mode 100755 new mode 100644 index db0069b7b6cf6eb5cfbb9777bb5f323cc300555d..f9fe308161a5c4c20acfa04924ae1cdacc4253d2 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDHYBRID_H @@ -15,7 +15,10 @@ class GeoVPhysVol; class SCT_FwdHybrid : public SCT_SharedComponentFactory { public: - SCT_FwdHybrid(const std::string & name, int ringType); + SCT_FwdHybrid(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: //int hybridPart() const {return m_hybridPart;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h old mode 100755 new mode 100644 index 26c974a01e11c09b2cd0a372a67e260b1944c94e..5b2db9aa7dfebcb4c70bfa4f92bf1468e1ebfb29 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDMODULE_H @@ -26,7 +26,10 @@ class SCT_FwdModule : public SCT_UniqueComponentFactory { public: - SCT_FwdModule(const std::string & name, int ringType); + SCT_FwdModule(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_FwdModule(); //explicitly disallow copy, assignment to appease coverity SCT_FwdModule(const SCT_FwdModule &) = delete; @@ -35,7 +38,7 @@ public: // Ring type int ringType() const {return m_ringType;} - virtual GeoVPhysVol* build(SCT_Identifier id) const; + virtual GeoVPhysVol* build(SCT_Identifier id); double stereoAngle() const {return m_stereoAngle;} @@ -89,11 +92,11 @@ private: 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; + SCT_FwdModuleConnector * m_connector; + SCT_FwdHybrid * m_hybrid; + SCT_FwdSpine * m_spine; + SCT_FwdSubSpine * m_subspineL; + 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 old mode 100755 new mode 100644 index b0645070fb9451768390734bc7353b8d274b653a..728f492541cffcb1664ca7965d559fe238918f57 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDMODULECONNECTOR_H @@ -13,7 +13,10 @@ class SCT_FwdModuleConnector : public SCT_SharedComponentFactory { public: - SCT_FwdModuleConnector(const std::string & name, int ringType); + SCT_FwdModuleConnector(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h old mode 100755 new mode 100644 index 17b33116b628d019fed3c5c5e20a18497457ff15..39274fc8525b45955643103559f8affef74567cc --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDOPTOHARNESS_H @@ -13,7 +13,10 @@ class SCT_FwdOptoHarness : public SCT_SharedComponentFactory { public: - SCT_FwdOptoHarness(const std::string & name, int iType); + SCT_FwdOptoHarness(const std::string & name, int iType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h old mode 100755 new mode 100644 index b1032bb2231ca39301ccb02a77caf7bb9d156e5c..a3ca5e72366f9e34a162d0b5cc58a4a44248458f --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDPPCONNECTOR_H @@ -13,7 +13,10 @@ class SCT_FwdPPConnector : public SCT_SharedComponentFactory { public: - SCT_FwdPPConnector(const std::string & name); + SCT_FwdPPConnector(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h old mode 100755 new mode 100644 index 2b931c3a0b5373f2b992a2d10732b99ae5b3a68d..a9566aea2f0078b600bbbfb192cceee55546881a --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDPPCOOLING_H @@ -13,7 +13,10 @@ class SCT_FwdPPCooling : public SCT_SharedComponentFactory { public: - SCT_FwdPPCooling(const std::string & name); + SCT_FwdPPCooling(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h old mode 100755 new mode 100644 index 410e6063958fcaabdc743ed68beec20e7bd64bf2..f38de2d5df373059f09ceaede262b88c712c68b4 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDPATCHPANEL_H @@ -13,7 +13,10 @@ class SCT_FwdPatchPanel : public SCT_SharedComponentFactory { public: - SCT_FwdPatchPanel(const std::string & name, int type); + SCT_FwdPatchPanel(const std::string & name, int type, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h old mode 100755 new mode 100644 index aface8df71dc5e4a7dab4374af306ed25473e0b8..3b8ee4765ddddd2a78558263f348571f39c1fc4d --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDPOWERTAPE_H @@ -17,7 +17,10 @@ public: int numModules, double innerRadius, double startPos, - double endPos); + double endPos, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h old mode 100755 new mode 100644 index b5926772fa0dd8b08d1d37b89ea195bdce0370ff..f23a67ff9f37571c4adaaa3488475a6f6d7bbd96 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDRING_H @@ -22,10 +22,13 @@ class SCT_FwdRing : public SCT_UniqueComponentFactory public: SCT_FwdRing(const std::string & name, - const SCT_FwdModule * module, + SCT_FwdModule * module, int iWheel, int iRing, - int ec); + int ec, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_FwdRing(); @@ -56,7 +59,7 @@ public: bool discRotated() const {return m_discRotated;} - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); // Child elements const SCT_FwdModule* module() const {return m_module;} @@ -106,7 +109,7 @@ private: double m_maxModuleServicesBaseToRingCenter; // Child detector elements - const SCT_FwdModule* m_module; + SCT_FwdModule* m_module; SCT_FwdCoolingBlock * m_coolingBlockHiMain; SCT_FwdCoolingBlock * m_coolingBlockHiSec; SCT_FwdCoolingBlock * m_coolingBlockLoMain; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h old mode 100755 new mode 100644 index 2bce180c6b52c2afc9aa13ef89452ad6d3a043ef..b739896744422cc67504a26cfcff78d5252defbf --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDRINGCOOLING_H @@ -13,7 +13,10 @@ class SCT_FwdRingCooling : public SCT_SharedComponentFactory { public: - SCT_FwdRingCooling(const std::string & name, int ringType); + SCT_FwdRingCooling(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h old mode 100755 new mode 100644 index dfb518719b156c63b272055b5215329b730d21f3..e201263a3d2789b5fcc570c2ddf78df404ead6e0 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDSENSOR_H @@ -8,6 +8,7 @@ #include "SCT_GeoModel/SCT_ComponentFactory.h" +#include <atomic> #include <string> // sensor types @@ -31,7 +32,10 @@ namespace InDetDD{class SiDetectorDesign;} class SCT_FwdSensor : public SCT_UniqueComponentFactory { public: - SCT_FwdSensor(const std::string & name, int ringType); + SCT_FwdSensor(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_FwdSensor(); // Ring type @@ -72,7 +76,7 @@ public: double thicknessF() const {return m_thicknessF;} - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); GeoPhysVol * getInactive() {return m_inactive;} @@ -116,6 +120,7 @@ private: InDetDD::SiDetectorDesign * m_design; + mutable std::atomic_bool m_noElementWarning; }; #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 old mode 100755 new mode 100644 index 4b53f2e35cc7bce2a67031814f34c43f165e985d..bfc92c50cb5732695f32b91b79f948812709bd1d --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDSPINE_H @@ -16,7 +16,10 @@ class SCT_FwdSpine : public SCT_SharedComponentFactory { public: - SCT_FwdSpine(const std::string & name, int ringType); + SCT_FwdSpine(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h old mode 100755 new mode 100644 index 504d2047d97c72c4d1fcd5273ca6fa70a65e74ac..38a01d882786feccdc30afac6be75f8a69827d18 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDSUBSPINE_H @@ -20,7 +20,10 @@ class SCT_FwdSubSpine : public SCT_SharedComponentFactory { public: - SCT_FwdSubSpine(const std::string & name, int ringType, int spineSide); + SCT_FwdSubSpine(const std::string & name, int ringType, int spineSide, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h old mode 100755 new mode 100644 index f7eb1915e2a020df846d84a9dc7da26a3b9642e7..b94dfadac5828311bc55d4d13223d863fe355e65 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDSUPPORTFRAME_H @@ -15,7 +15,10 @@ class SCT_FwdSupportFrame : public SCT_SharedComponentFactory { public: - SCT_FwdSupportFrame(const std::string & name); + SCT_FwdSupportFrame(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h old mode 100755 new mode 100644 index e71ceb1664af576b4b32d8d3c5da85753bd2737c..302539bfbead347628b6eeeb5b65206476312229 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDTHERMALSHIELDELEMENT_H @@ -15,7 +15,10 @@ class SCT_FwdThermalShieldElement : public SCT_SharedComponentFactory { public: - SCT_FwdThermalShieldElement(const std::string & name, int iElement); + SCT_FwdThermalShieldElement(const std::string & name, int iElement, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h old mode 100755 new mode 100644 index 706cefb30d2c3c1d7e14359c77007bd5900b2ccd..b1d321982023a8e0517dd8d711edfd9fa6c65308 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_FWDWHEEL_H @@ -27,8 +27,11 @@ class SCT_FwdWheel : public SCT_UniqueComponentFactory public: SCT_FwdWheel(const std::string & name, int iWheel, - const std::vector<const SCT_FwdModule *> & modules, - int ec); + const std::vector<SCT_FwdModule *> & modules, + int ec, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_FwdWheel(); //Explicitly disallow copy and assignment to appease coverity SCT_FwdWheel(const SCT_FwdWheel &) = delete; @@ -52,7 +55,7 @@ public: double outerRadius() const {return m_outerRadius;} int totalModules() const {return m_totalModules;} - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); private: @@ -92,15 +95,15 @@ private: 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; + std::vector<SCT_FwdRing *> m_rings; + SCT_FwdDiscSupport * m_discSupport; + std::vector<SCT_FwdPatchPanel*> m_patchPanel; + SCT_FwdPPConnector* m_pPConnector; + SCT_FwdPPCooling* m_pPCooling; + std::vector<SCT_FwdFSI*> m_fsiType; + SCT_FwdDiscFixation* m_discFixation; + + const std::vector<SCT_FwdModule*> & m_modules; const std::vector<const FSIDetails *> * m_fsiVector; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h old mode 100755 new mode 100644 index 922a69f6fce3319641cd226b17b9b0b0ecdf17bc..5a104c6723c3118503a8fbdf2859852c68a0aa18 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GeoModel_SCT_GeneralParameters_H @@ -17,7 +17,7 @@ class SCT_GeneralParameters { public: - SCT_GeneralParameters(); + SCT_GeneralParameters(SCT_DataBase* rdb); ~SCT_GeneralParameters(); //Explicitly disallow copy, assignment to appease coverity SCT_GeneralParameters(const SCT_GeneralParameters &) = delete; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h old mode 100755 new mode 100644 index 5073f9e6fab2519248e49ef433a824299064a5e4..00f34f8ee4ae451ca6b486576b228f4fdb456cb5 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GeoModel_SCT_GeometryManager_H @@ -7,13 +7,16 @@ #include "SCT_GeoModel/SCT_Options.h" -namespace InDetDD{ +#include <memory> + +namespace InDetDD { class SiCommonItems; class DistortedMaterialManager; } class SCT_BarrelParameters; class SCT_BarrelModuleParameters; +class SCT_DataBase; class SCT_ForwardParameters; class SCT_ForwardModuleParameters; class SCT_GeneralParameters; @@ -24,7 +27,7 @@ class SCT_GeometryManager { public: // Constructor - SCT_GeometryManager(); + SCT_GeometryManager(SCT_DataBase* rdb); // Destructor ~SCT_GeometryManager(); @@ -35,11 +38,9 @@ public: // 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 InDetDD::SiCommonItems * commonItems() const; const SCT_BarrelParameters * barrelParameters() const; const SCT_BarrelModuleParameters * barrelModuleParameters() const; @@ -56,13 +57,14 @@ private: SCT_Options m_options; const SCT_GeoModelAthenaComps * m_athenaComps; InDetDD::SiCommonItems * m_commonItems; + SCT_DataBase* m_rdb; - 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; + std::unique_ptr<SCT_BarrelParameters> m_barrelParameters; + std::unique_ptr<SCT_BarrelModuleParameters> m_barrelModuleParameters; + std::unique_ptr<SCT_ForwardParameters> m_forwardParameters; + std::unique_ptr<SCT_ForwardModuleParameters> m_forwardModuleParameters; + std::unique_ptr<SCT_GeneralParameters> m_generalParameters; + std::unique_ptr<InDetDD::DistortedMaterialManager> m_distortedMatManager; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h old mode 100755 new mode 100644 index 06a9b5f2c294f5837b4f1eed2d375ee138c9fd6e..79243c1aae913245374fd1a62e19e30cf5adc2a6 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_HARNESS_H @@ -15,7 +15,10 @@ class SCT_Harness : public SCT_SharedComponentFactory { public: - SCT_Harness(const std::string & name, double length); + SCT_Harness(const std::string & name, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h old mode 100755 new mode 100644 index 032fdc70867ee3f81aaffbb824b8687d9911621d..7046e978bb4c9ffbf703bd96c6f1edf8c566c05f --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_Hybrid_H @@ -16,7 +16,10 @@ class SCT_Hybrid: public SCT_SharedComponentFactory { public: - SCT_Hybrid(const std::string & name); + SCT_Hybrid(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h old mode 100755 new mode 100644 index c74fad15348fabb54c8c9e47b3356a6760c05b00..675062812259884a6ade843061e0abf507d9a683 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_IDENTIFIER_H @@ -12,16 +12,18 @@ class SCT_Identifier { public: - SCT_Identifier(int barrelEC = 0, + SCT_Identifier(const SCT_ID* idHelper, + 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) + : m_idHelper{idHelper}, + m_barrelEC{barrelEC}, + m_layerDisk{layerDisk}, + m_phiModule{phiModule}, + m_etaModule{etaModule}, + m_side{side} {}; @@ -40,20 +42,18 @@ public: 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: + const SCT_ID* m_idHelper; 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 old mode 100755 new mode 100644 index fd91a3788d0175bd1e4b52a075126bed8718858e..72f7065edf6603d92f4288c44dda304dfb931ec3 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -29,22 +29,25 @@ class SCT_InnerSide: public SCT_UniqueComponentFactory { public: - SCT_InnerSide(const std::string & name); + SCT_InnerSide(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); //explicitly disallow copy, assign, to appease coverity SCT_InnerSide(const SCT_InnerSide &) = delete; SCT_InnerSide & operator=(const SCT_InnerSide &) = delete; ~SCT_InnerSide(); - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); public: double thickness() const {return m_thickness;} double width() const {return m_width;} double length() const {return m_length;} - GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} - GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} + const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} + const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} // *** End of modified lines. ------------------ (00)********************************* diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h old mode 100755 new mode 100644 index 620f029b15a260d35f4592ad438ba67e74209fd7..518e168a23b3b68bdaa22aa9317618e0f48d639f --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_INTERLINK_H @@ -21,7 +21,10 @@ class SCT_InterLink : public SCT_SharedComponentFactory { public: - SCT_InterLink(const std::string & name); + SCT_InterLink(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_InterLink(); public: diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h old mode 100755 new mode 100644 index 8309e86487355fbd340e9c6a404d552238546fed..e29c3db798042adae4ba879b563df3d6a1425d94 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -37,14 +37,17 @@ class SCT_Layer: public SCT_UniqueComponentFactory public: SCT_Layer(const std::string & name, int iLayer, - const SCT_Module * module); + SCT_Module * module, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_Layer(); //Explicitly disallow copy, assign to appease coverity SCT_Layer(const SCT_Layer &) = delete; SCT_Layer & operator=(const SCT_Layer &) = delete; - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); public: @@ -100,19 +103,19 @@ private: 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; + SCT_Module * m_module; + SCT_Ski * m_ski; + SCT_Clamp * m_clamp; + SCT_CoolingEnd * m_coolingEnd; + SCT_Bracket * m_bracket; + SCT_Harness * m_harness; + SCT_SkiPowerTape * m_skiPowerTape; + SCT_SkiAux * m_skiAux; + SCT_Flange * m_flange; + SCT_SupportCyl * m_supportCyl; + SCT_FSIEndJewel * m_endJewel; + SCT_FSIScorpion * m_scorpion; + SCT_FSIFibreMask * m_fibreMask; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h old mode 100755 new mode 100644 index 9cdb4ec633d8400024f0d8b693a3df95d8ddcd6f..0bbd85ac9ef9691e6afe8b3f873882300f13029c --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_MATERIALMANAGER_H @@ -7,21 +7,22 @@ // SCT_MaterialManager. This provides an interface to the InDetMaterialManager which in turn // is an interface to GeoModel Material Manager with some additional functionality. +#include "InDetGeoModelUtils/InDetMaterialManager.h" + +#include <memory> +#include <string> class GeoMaterial; class GeoElement; class InDetMaterialManager; - -#include <string> +class SCT_DataBase; class SCT_MaterialManager { public: - SCT_MaterialManager(); - - static void reinit(); + SCT_MaterialManager(SCT_DataBase* db); const GeoMaterial* getMaterial(const std::string & materialName) const; const GeoElement* getElement(const std::string & elementName) const; @@ -31,22 +32,15 @@ public: 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; + std::unique_ptr<InDetMaterialManager> m_materialManager; + const GeoMaterial* m_gasMaterial; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h old mode 100755 new mode 100644 index cd739b6b249d5f9ebeaffb8f3e6b61a3e5f184e9..f34e82b520bea1dc98c579c6a2b24f564e05e00b --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_MODULE_H @@ -24,14 +24,17 @@ class SCT_Module: public SCT_UniqueComponentFactory { public: - SCT_Module(const std::string & name); + SCT_Module(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_Module(); //Explicitly disallow copy, assign to appease coverity SCT_Module(const SCT_Module &) = delete; SCT_Module & operator=(const SCT_Module &) = delete; - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); public: double thickness() const {return m_thickness;} @@ -45,8 +48,8 @@ public: double env2Width() const {return m_env2Width;} double env2Length() const {return m_env2Length;} - GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} - GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} + const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} + const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} double sensorGap() const {return m_sensorGap;} double stereoInner() const {return m_stereoInner;} @@ -91,9 +94,9 @@ private: int m_upperSide; double m_safety; - const SCT_InnerSide * m_innerSide; - const SCT_OuterSide * m_outerSide; - const SCT_BaseBoard * m_baseBoard; + SCT_InnerSide * m_innerSide; + SCT_OuterSide * m_outerSide; + SCT_BaseBoard * m_baseBoard; //const SCT_Sensor * m_sensor; // 14:00 Thu 14th Jul 2005 D.Naito removed. GeoTrf::Transform3D * m_innerSidePos; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Options.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Options.h old mode 100755 new mode 100644 diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h old mode 100755 new mode 100644 index d3fd0dab87777e53379a9c22d98f25971cbfb637..e8c8840bbdc8c2d19228dea87faf6b1c6ee53766 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_OUTERSIDE_H @@ -25,21 +25,24 @@ class SCT_OuterSide: public SCT_UniqueComponentFactory { public: - SCT_OuterSide(const std::string & name); + SCT_OuterSide(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_OuterSide(); //Explicitly disallow copy, assign to appease coverity SCT_OuterSide(const SCT_OuterSide &) = delete; SCT_OuterSide & operator=(const SCT_OuterSide &) = delete; - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); public: double thickness() const {return m_thickness;} double width() const {return m_width;} double length() const {return m_length;} - GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} - GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} + const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} + const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} const SCT_Hybrid * hybrid() const {return m_hybrid;} const SCT_Pigtail * pigtail() const {return m_pigtail;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h old mode 100755 new mode 100644 index a7f8c685f00500b06c2486b157f29eb841fbd47f..7ad7ef872c8c40fdd3610c8cf6c7e5d6e7a79d71 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_Pigtail_H @@ -16,7 +16,10 @@ class SCT_Pigtail: public SCT_SharedComponentFactory { public: - SCT_Pigtail(const std::string & name); + SCT_Pigtail(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h old mode 100755 new mode 100644 index 5a8b6355486f69a2f6c97734b869945b4c0f1477..f847054549587ea040a8b9ed7529f482a0cea497 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_PIXELATTACHMENT_H @@ -15,7 +15,10 @@ class SCT_PixelAttachment : public SCT_SharedComponentFactory { public: - SCT_PixelAttachment(const std::string & name); + SCT_PixelAttachment(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h old mode 100755 new mode 100644 index ce77d46dfe5c326c901ed804ca69c7367eedc32b..6440152146a34d63a92f3892b8ce31d159c873df --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_POWERTAPE_H @@ -18,7 +18,10 @@ class SCT_PowerTape: public SCT_SharedComponentFactory { public: - SCT_PowerTape(const std::string & name, double length); + SCT_PowerTape(const std::string & name, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h old mode 100755 new mode 100644 index 735437710d90e1c7360a1c5f29a35d75d6578368..d77710e9d46b6e00e789d2c814ed6d99ba09b5db --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_SENSOR_H @@ -7,6 +7,7 @@ #include "SCT_GeoModel/SCT_ComponentFactory.h" +#include <atomic> #include <string> class GeoMaterial; @@ -16,7 +17,10 @@ namespace InDetDD{class SiDetectorDesign;} class SCT_Sensor: public SCT_UniqueComponentFactory { public: - SCT_Sensor(const std::string & name); + SCT_Sensor(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} @@ -24,7 +28,7 @@ public: double width() const {return m_width;} double length() const {return m_length;} - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); private: void getParameters(); @@ -38,6 +42,7 @@ private: InDetDD::SiDetectorDesign * m_design; + mutable std::atomic_bool m_noElementWarning; }; #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 old mode 100755 new mode 100644 index 63b035611703e85256e707e1b7d9c180e6a9c52e..01dd72fa0feb25898cfbe4be1dbbcfed50ea067c --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_SKI_H @@ -30,13 +30,16 @@ class SCT_Ski: public SCT_UniqueComponentFactory { public: SCT_Ski(const std::string & name, - const SCT_Module * module, - int stereoSign, - double tilt, - double length); + SCT_Module * module, + int stereoSign, + double tilt, + double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); ~SCT_Ski(); - virtual GeoVPhysVol * build(SCT_Identifier id) const; + virtual GeoVPhysVol * build(SCT_Identifier id); public: double thickness() const {return m_thickness;} @@ -57,9 +60,9 @@ public: const SCT_CoolingBlock * coolingBlock() const {return m_coolingBlock;} const SCT_CoolingPipe * coolingPipe() const {return m_coolingPipe;} - GeoTransform * getRefPointTransform() const {return m_refPointTransform;} - GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} - GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} + const GeoTransform * getRefPointTransform() const {return m_refPointTransform;} + const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;} + const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;} double env1Thickness() const {return m_env1Thickness;} double env1Width() const {return m_env1Width;} double env2Thickness() const {return m_env2Thickness;} @@ -115,10 +118,10 @@ private: 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; + SCT_Module* m_module; + SCT_Dogleg* m_dogleg; + SCT_CoolingBlock* m_coolingBlock; + SCT_CoolingPipe* m_coolingPipe; GeoTransform * m_refPointTransform; GeoTransform * m_coolingPipePos; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h old mode 100755 new mode 100644 index 8445a0ccf7a687e6675d6e17e14d14c3b62f4358..3985d43a1e1471c139e9e4030adcdcab8f42958f --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_SKIAUX_H @@ -11,7 +11,6 @@ class SCT_Ski; // 14th Aug 2005 S.Mima modified. -//class SCT_Bracket; class SCT_Bracket; class SCT_Harness; class SCT_SkiPowerTape; @@ -24,16 +23,17 @@ 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); + SCT_Ski * ski, + SCT_Bracket * bracket, + SCT_Harness * harness, + SCT_SkiPowerTape * skiPowerTape, + double innerRadius, + double bracketPhiOffset, + double powerTapePhiOffset, + double divisionAngle, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Retrieve basic/derived parameters @@ -71,12 +71,10 @@ private: 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; + SCT_Ski * m_ski; + SCT_Bracket * m_bracket; + SCT_Harness * m_harness; + SCT_SkiPowerTape * m_skiPowerTape; }; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h old mode 100755 new mode 100644 index c536ca0de7dee931f46b8ab3fcf819e9faa448e6..1542267f6e0ce2b4f4d424bb6391f0eeb9ef43cf --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_SKIPOWERTAPE_H @@ -18,7 +18,10 @@ public: SCT_SkiPowerTape(const std::string & name, const SCT_Ski * ski, - double length); + double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); // // Methods to return basic and derived parameters. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h old mode 100755 new mode 100644 index d8ed217cbed32373cd7168e230aec396aa8cb78d..35bfe08ba7901759e732100c5ac14285d22d29c1 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_SPIDER_H @@ -15,7 +15,10 @@ class SCT_Spider : public SCT_SharedComponentFactory { public: - SCT_Spider(const std::string & name); + SCT_Spider(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h old mode 100755 new mode 100644 index 3e8778c558dd0d4853acccbda6581546b9c1f80d..2f671952e1a0394c19f6e7995b740f98c6d71183 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_GEOMODEL_SCT_SUPPORTCYL_H @@ -15,7 +15,10 @@ class SCT_SupportCyl : public SCT_SharedComponentFactory { public: - SCT_SupportCyl(const std::string & name, int iLayer, double length); + SCT_SupportCyl(const std::string & name, int iLayer, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials); public: const GeoMaterial * material() const {return m_material;} diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx old mode 100755 new mode 100644 index f9daf218931f6e89004d0f1c9493aa9de7161567..a1177453e4f103fb4edab918cc9fa8271e9782ee --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Barrel.h" @@ -37,8 +37,11 @@ #include <iostream> -SCT_Barrel::SCT_Barrel(const std::string & name) - : SCT_UniqueComponentFactory(name) +SCT_Barrel::SCT_Barrel(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_logVolume = preBuild(); @@ -48,8 +51,8 @@ SCT_Barrel::SCT_Barrel(const std::string & name) void SCT_Barrel::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); + m_innerRadius = parameters->barrelInnerRadius(); m_outerRadius = parameters->barrelOuterRadius(); m_length = parameters->barrelLength(); @@ -59,13 +62,13 @@ SCT_Barrel::getParameters() m_thermalShieldEndWallThickness = parameters->thermalShieldEndCapThickness(); // Clearannce in z between layer and interlink. - m_zClearance = 1*Gaudi::Units::mm; + m_zClearance = 1.*Gaudi::Units::mm; // Layer internal structure and services depend on geometry version m_isOldGeometry = parameters->isOldGeometry(); // Set numerology - detectorManager()->numerology().setNumLayers(m_numLayers); + m_detectorManager->numerology().setNumLayers(m_numLayers); } @@ -74,30 +77,28 @@ 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()); + GeoLogVol * barrelLog = new GeoLogVol(getName(), barrelEnvelopeShape, m_materials->gasMaterial()); return barrelLog; } GeoVPhysVol * -SCT_Barrel::build(SCT_Identifier id) const +SCT_Barrel::build(SCT_Identifier id) { 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" << endmsg; + std::cout << "SCT_Barrel Old barrel geometry versions are not supported" << std::endl; 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"); + SCT_Module module("Module", m_detectorManager, m_geometryManager, m_materials); // Create the interlinks - SCT_InterLink interLink("InterLink"); + SCT_InterLink interLink("InterLink", m_detectorManager, m_geometryManager, m_materials); // Calculte the length of the layer cylinder. This is the barrel length less the thermal // shield and interlink width. @@ -113,7 +114,7 @@ SCT_Barrel::build(SCT_Identifier id) const // Create the layers layerLength = 0.; - SCT_Layer layer("Layer"+intToString(iLayer), iLayer, &module); + SCT_Layer layer("Layer"+intToString(iLayer), iLayer, &module, m_detectorManager, m_geometryManager, m_materials); barrel->add(new GeoNameTag("Layer#"+intToString(iLayer))); barrel->add(new GeoIdentifierTag(iLayer)); // Identifier layer= iLayer id.setLayerDisk(iLayer); @@ -122,7 +123,7 @@ SCT_Barrel::build(SCT_Identifier id) const GeoVPhysVol * layerPV = layer.build(id); barrel->add(layerPV); // Store alignable transform - detectorManager()->addAlignableTransform(2, id.getWaferId(), transform, layerPV); + m_detectorManager->addAlignableTransform(2, id.getWaferId(), transform, layerPV); layerLength = std::max(layerLength,layer.length()); } @@ -136,7 +137,7 @@ SCT_Barrel::build(SCT_Identifier id) const // Build and place the cooling spiders double spiderZPos = 0.; - SCT_Spider spider("Spider"); + SCT_Spider spider("Spider", m_detectorManager, m_geometryManager, m_materials); spiderZPos = interLinkZPos + 0.5*interLink.length() + 0.5*spider.length(); barrel->add(new GeoTransform(GeoTrf::TranslateZ3D(+spiderZPos))); barrel->add(spider.getVolume()); @@ -150,14 +151,14 @@ SCT_Barrel::build(SCT_Identifier id) const buildEMIShield(barrel); // Build and place SCT to Pixel attachment - SCT_PixelAttachment pixelAttachment("AttachmentPixelToSCT"); + SCT_PixelAttachment pixelAttachment("AttachmentPixelToSCT", m_detectorManager, m_geometryManager, m_materials); barrel->add(new GeoTransform(GeoTrf::TranslateZ3D(+pixelAttachment.zPosition()))); // +ve z barrel->add(pixelAttachment.getVolume()); barrel->add(new GeoTransform(GeoTrf::TranslateZ3D(-pixelAttachment.zPosition()))); // -ve z barrel->add(pixelAttachment.getVolume()); // Extra Material - InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager()); + InDetDD::ExtraMaterial xMat(m_geometryManager->distortedMatManager()); xMat.add(barrel, "SCTBarrel"); return barrel; @@ -173,8 +174,7 @@ void SCT_Barrel::buildThermalShield(GeoFullPhysVol * parent) const // (c) end panels // The inner cylinder is called 'EMI shield' for backwards compatibility - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - SCT_MaterialManager materials; + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); double cylinderOuterRadius = parameters->thermalShieldOuterRadius(); double cylinderInnerRadius = parameters->thermalShieldInnerRadius(); @@ -194,14 +194,14 @@ void SCT_Barrel::buildThermalShield(GeoFullPhysVol * parent) const // 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 GeoMaterial* cylinderMaterial = m_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 GeoMaterial* bulkheadMaterial = m_materials->getMaterialForVolume(bulkheadMaterialName,bulkheadShape->volume()); const GeoLogVol * bulkheadLog = new GeoLogVol("ThShieldBulkhead", bulkheadShape, bulkheadMaterial); GeoPhysVol * bulkhead = new GeoPhysVol(bulkheadLog); GeoTransform * bulkheadPosPlus = new GeoTransform(GeoTrf::TranslateZ3D(+(endPanelZMax-endPanelThickness-0.5*bulkheadThickness))); @@ -213,7 +213,7 @@ void SCT_Barrel::buildThermalShield(GeoFullPhysVol * parent) const // The end panels const GeoTube * endPanelShape = new GeoTube(endPanelInnerRadius, endPanelOuterRadius, 0.5*endPanelThickness); - const GeoMaterial* endPanelMaterial = materials.getMaterialForVolume(endPanelMaterialName,endPanelShape->volume()); + const GeoMaterial* endPanelMaterial = m_materials->getMaterialForVolume(endPanelMaterialName,endPanelShape->volume()); const GeoLogVol * endPanelLog = new GeoLogVol("ThShieldEndPanel", endPanelShape, endPanelMaterial); GeoPhysVol * endPanel = new GeoPhysVol(endPanelLog); GeoTransform * endPanelPosPlus = new GeoTransform(GeoTrf::TranslateZ3D(+(endPanelZMax-0.5*endPanelThickness))); @@ -228,8 +228,7 @@ void SCT_Barrel::buildThermalShield(GeoFullPhysVol * parent) const void SCT_Barrel::buildEMIShield(GeoFullPhysVol * parent) const { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - SCT_MaterialManager materials; + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); // Parameters of cylinder double innerRadius = parameters->emiShieldInnerRadius(); @@ -258,13 +257,13 @@ void SCT_Barrel::buildEMIShield(GeoFullPhysVol * parent) const const GeoTube * emiShieldTube = new GeoTube(innerRadius, outerRadius, 0.5*length); if (m_isOldGeometry) { emiShieldShape = emiShieldTube; - material = materials.getMaterial(materialName); + material = m_materials->getMaterial(materialName); } else { const GeoTube* cutOut = new GeoTube(innerRadius, outerRadius, 0.5*pixelAttachmentLength); const GeoShape* emiTemp = (GeoShape*)&(emiShieldTube->subtract(*cutOut << GeoTrf::TranslateZ3D(pixelAttachmentZpos))); emiShieldShape = (GeoShape*)&emiTemp->subtract(*cutOut << GeoTrf::TranslateZ3D(-pixelAttachmentZpos)); double emiVolume = emiShieldTube->volume() - 2. * cutOut->volume(); - material = materials.getMaterialForVolume(materialName, emiVolume); + material = m_materials->getMaterialForVolume(materialName, emiVolume); } const GeoLogVol * emiShieldLog = new GeoLogVol("EMIShield", emiShieldShape, material); GeoPhysVol * emiShield = new GeoPhysVol(emiShieldLog); @@ -280,7 +279,7 @@ void SCT_Barrel::buildEMIShield(GeoFullPhysVol * parent) const const GeoShape* jointTemp = (GeoShape*)&(emiJointTubs->subtract(*jointCutOut << GeoTrf::TranslateZ3D(pixelAttachmentZpos))); const GeoShape* emiJointShape = (GeoShape*)&jointTemp->subtract(*jointCutOut << GeoTrf::TranslateZ3D(-pixelAttachmentZpos)); double jointVolume = emiJointTubs->volume() - 2. * jointCutOut->volume(); - const GeoMaterial * jointMaterial = materials.getMaterialForVolume(jointMaterialName, jointVolume); + const GeoMaterial * jointMaterial = m_materials->getMaterialForVolume(jointMaterialName, jointVolume); const GeoLogVol * emiJointLog = new GeoLogVol("EMIShieldJoint", emiJointShape, jointMaterial); GeoPhysVol * emiJoint = new GeoPhysVol(emiJointLog); // Place 3 copies diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx old mode 100755 new mode 100644 index 96f390bc501aa638c93237ebff242b3e30d606ba..5fd468fef6128d189e5cdc40f26e2b2e56784240 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_BarrelModuleParameters.h" @@ -15,9 +15,9 @@ using std::abs; -SCT_BarrelModuleParameters::SCT_BarrelModuleParameters() +SCT_BarrelModuleParameters::SCT_BarrelModuleParameters(SCT_DataBase* rdb) { - m_rdb = SCT_DataBase::instance(); + m_rdb = rdb; } // diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx old mode 100755 new mode 100644 index c9cdeb4c5dd079b8382cca7bdd079d6710233967..468c88ea01511cfc29cbdd37cda95d6c9043d342 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_BarrelParameters.h" @@ -13,9 +13,9 @@ #include <cmath> -SCT_BarrelParameters::SCT_BarrelParameters() +SCT_BarrelParameters::SCT_BarrelParameters(SCT_DataBase* rdb) { - m_rdb = SCT_DataBase::instance(); + m_rdb = rdb; } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx old mode 100755 new mode 100644 index 08b804b7dcb84709a873b41095efcb620422a610..1866d3583a2725772b46da919cad233805f5ee3e --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_BaseBoard.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/GeoPhysVol.h" #include "GeoModelKernel/GeoMaterial.h" -SCT_BaseBoard::SCT_BaseBoard(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_BaseBoard::SCT_BaseBoard(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -25,12 +28,10 @@ SCT_BaseBoard::SCT_BaseBoard(const std::string & name) void SCT_BaseBoard::getParameters() { - const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); - const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters(); + const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters(); - SCT_MaterialManager materials; - - m_material = materials.getMaterial(parameters->baseBoardMaterial()); + m_material = m_materials->getMaterial(parameters->baseBoardMaterial()); m_safety = generalParameters->safety(); m_thickness = parameters->baseBoardThickness(); m_width = parameters->baseBoardWidth(); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx old mode 100755 new mode 100644 index 599d5081a5cf2a03085433b3e746c9dccca40a66..43323a0eee5b67f46abc0955169b4bf1b91442bb --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -18,8 +18,11 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_Bracket::SCT_Bracket(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_Bracket::SCT_Bracket(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -29,10 +32,9 @@ SCT_Bracket::SCT_Bracket(const std::string & name) void SCT_Bracket::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - SCT_MaterialManager materials; + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); - m_material = materials.getMaterial(parameters->bracketMaterial()); + m_material = m_materials->getMaterial(parameters->bracketMaterial()); m_thickness = parameters->bracketThickness(); m_length = parameters->bracketLength(); m_width = parameters->bracketWidth(); @@ -47,8 +49,7 @@ SCT_Bracket::build() // 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); + 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 old mode 100755 new mode 100644 index a85fb7efcdf376c2b353aa9bc4b91c288645c8f3..e61cea9e49b372b4df875c854d1b35bc5654bf27 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Clamp.h" @@ -16,9 +16,12 @@ SCT_Clamp::SCT_Clamp(const std::string & name, int iLayer, - double innerRadius) - : SCT_SharedComponentFactory(name), m_iLayer(iLayer), - m_innerRadius(innerRadius) + double innerRadius, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_iLayer(iLayer), m_innerRadius(innerRadius) { getParameters(); m_physVolume = build(); @@ -28,7 +31,7 @@ SCT_Clamp::SCT_Clamp(const std::string & name, int iLayer, void SCT_Clamp::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); m_materialName = parameters->clampMaterial(m_iLayer); m_length = parameters->clampDeltaZ(m_iLayer); @@ -41,11 +44,10 @@ 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);} + m_material = m_materials->getMaterialForVolume(m_materialName, clampShape->volume()); + if(!m_material) {m_material = m_materials->getMaterial(m_materialName);} const GeoLogVol * clampLog = new GeoLogVol(getName(), clampShape, m_material); GeoPhysVol * clamp = new GeoPhysVol(clampLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx old mode 100755 new mode 100644 index b4b6db173cf9f9079c9ebd299f50e6ed4d54cf5c..4c229c9abc76d933b93fca9e3f0c1739fcf9db8e --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_CloseOut.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/Units.h" -SCT_CloseOut::SCT_CloseOut(const std::string & name, int iLayer) - : SCT_SharedComponentFactory(name), m_iLayer(iLayer) +SCT_CloseOut::SCT_CloseOut(const std::string & name, int iLayer, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_iLayer(iLayer) { getParameters(); m_physVolume = build(); @@ -26,10 +30,9 @@ SCT_CloseOut::SCT_CloseOut(const std::string & name, int iLayer) void SCT_CloseOut::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - SCT_MaterialManager materials; + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); - m_material = materials.getMaterial(parameters->closeOutMaterial(m_iLayer)); + m_material = m_materials->getMaterial(parameters->closeOutMaterial(m_iLayer)); m_length = parameters->closeOutDeltaZ(m_iLayer); // Same inner and outer radius of support cylinder. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx old mode 100755 new mode 100644 index cee35aa92f6f025439e7ad61aaadfaeff9c88404..614c31349ff7bdfa9d9a4e7ddb7d4328f29f22c4 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_ComponentFactory.h" @@ -10,41 +10,29 @@ using InDetDD::SCT_DetectorManager; -SCT_DetectorManager * SCT_ComponentFactory::s_detectorManager = 0; -const SCT_GeometryManager * SCT_ComponentFactory::s_geometryManager = 0; +const double SCT_ComponentFactory::s_epsilon = 1.0e-6 * Gaudi::Units::mm; -double SCT_ComponentFactory::s_epsilon = 1.0e-6 * Gaudi::Units::mm; - -SCT_ComponentFactory::SCT_ComponentFactory(const std::string & name) - : m_name(name) +SCT_ComponentFactory::SCT_ComponentFactory(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : m_detectorManager(detectorManager), + m_geometryManager(geometryManager), + m_materials(materials), + 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) +SCT_ComponentFactory::intToString(int i) const { std::ostringstream str; str << i; return str.str(); } - - double SCT_ComponentFactory::epsilon() const { diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx old mode 100755 new mode 100644 index 5db571788fa8949b60130de4947ae25e2e8a78bd..991a4e10a7aa9b850e5554fdc85b26fa7bad74e8 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_CoolingBlock.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_CoolingBlock::SCT_CoolingBlock(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_CoolingBlock::SCT_CoolingBlock(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -26,7 +29,7 @@ SCT_CoolingBlock::SCT_CoolingBlock(const std::string & name) void SCT_CoolingBlock::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); m_materialName = parameters->coolingBlockMaterial(); m_thickness = parameters->coolingBlockThickness(); @@ -42,10 +45,8 @@ SCT_CoolingBlock::build() // 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()); + m_material = m_materials->getMaterialForVolume(m_materialName, coolingBlockShape->volume()); const GeoLogVol *coolingBlockLog = new GeoLogVol(getName(), coolingBlockShape, m_material); GeoPhysVol * coolingBlock = new GeoPhysVol(coolingBlockLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx old mode 100755 new mode 100644 index 969f719c3ebb6f60807844ee522ab581aa20fdcd..cbaaeeab225c759713f696f557826534f21eb041 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_CoolingEnd.h" @@ -17,8 +17,12 @@ SCT_CoolingEnd::SCT_CoolingEnd(const std::string & name, int iLayer, double innerRadius, - double length) - : SCT_SharedComponentFactory(name), m_iLayer(iLayer), + double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_iLayer(iLayer), m_innerRadius(innerRadius), m_length(length) { @@ -30,7 +34,7 @@ SCT_CoolingEnd::SCT_CoolingEnd(const std::string & name, int iLayer, void SCT_CoolingEnd::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); m_materialName = parameters->coolingEndMaterial(m_iLayer); m_radialWidth = parameters->clampDeltaR(m_iLayer); @@ -42,11 +46,9 @@ 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);} + m_material = m_materials->getMaterialForVolume(m_materialName, coolShape->volume()); + if(!m_material) m_material = m_materials->getMaterial(m_materialName); const GeoLogVol * coolLog = new GeoLogVol(getName(), coolShape, m_material); GeoPhysVol * cool = new GeoPhysVol(coolLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx old mode 100755 new mode 100644 index cf1d88eaa641bba281c0ad5480393737532ac93e..17f7b184ed3dd14c6bac0a8415f3677396660b2a --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_CoolingPipe.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_CoolingPipe::SCT_CoolingPipe(const std::string & name, double length) - : SCT_SharedComponentFactory(name), m_length(length) +SCT_CoolingPipe::SCT_CoolingPipe(const std::string & name, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_length(length) { getParameters(); m_physVolume = build(); @@ -26,7 +30,7 @@ SCT_CoolingPipe::SCT_CoolingPipe(const std::string & name, double length) void SCT_CoolingPipe::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); m_materialName = parameters->coolingPipeMaterial(); m_pipeRadius = parameters->coolingPipeRadius(); @@ -37,11 +41,9 @@ 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);} + m_material = m_materials->getMaterialForVolume(m_materialName, coolingPipeShape->volume()); + if(!m_material) m_material = m_materials->getMaterial(m_materialName); const GeoLogVol *coolingPipeLog = new GeoLogVol(getName(), coolingPipeShape, m_material); GeoPhysVol * coolingPipe = new GeoPhysVol(coolingPipeLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx old mode 100755 new mode 100644 index 35264aee4d29c4491c9d8190c45732db3b18793e..ef69ebbaa5a9a4e0c1499935a6a5022c10641918 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_DataBase.h" @@ -15,41 +15,11 @@ #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) +SCT_DataBase::SCT_DataBase(const SCT_GeoModelAthenaComps * athenaComps) { - s_athenaComps = athenaComps; -} - -SCT_DataBase::SCT_DataBase() + m_athenaComps = athenaComps; -{ - IGeoDbTagSvc * geoDbTag = s_athenaComps->geoDbTagSvc(); + IGeoDbTagSvc * geoDbTag = m_athenaComps->geoDbTagSvc(); // Get version tag and node for SCT DecodeVersionKey versionKey(geoDbTag,"SCT"); @@ -60,7 +30,7 @@ SCT_DataBase::SCT_DataBase() DecodeVersionKey indetVersionKey(geoDbTag,"InnerDetector"); // Access the RDB - IRDBAccessSvc* rdbSvc = s_athenaComps->rdbAccessSvc(); + IRDBAccessSvc* rdbSvc = m_athenaComps->rdbAccessSvc(); // SCT version tag m_sctVersionTag = rdbSvc->getChildTag("SCT", versionKey.tag(), versionKey.node()); @@ -218,6 +188,7 @@ SCT_DataBase::SCT_DataBase() } +const SCT_GeoModelAthenaComps* SCT_DataBase::athenaComps() const { return m_athenaComps; } IRDBRecordset_ptr SCT_DataBase::weightTable() const {return m_weightTable;} @@ -293,5 +264,5 @@ const std::string & SCT_DataBase::versionTag() const { MsgStream& SCT_DataBase::msg (MSG::Level lvl) const { - return s_athenaComps->msg(lvl); + return m_athenaComps->msg(lvl); } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx old mode 100755 new mode 100644 index 94b2350d3ac814ea93b2f23630760bbda38f0c6a..8d0f1d555fd90333d999fcb0e00c94cdefa32c19 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -8,6 +8,8 @@ #include "SCT_GeoModel/SCT_DetectorFactory.h" + +#include "SCT_GeoModel/SCT_DataBase.h" #include "SCT_GeoModel/SCT_Identifier.h" #include "SCT_GeoModel/SCT_GeometryManager.h" #include "SCT_GeoModel/SCT_MaterialManager.h" @@ -70,24 +72,18 @@ SCT_DetectorFactory::SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaC // Create the detector manager m_detectorManager = new SCT_DetectorManager(detStore()); - // + // Create the database + m_db = new SCT_DataBase{athenaComps}; + + // Create the material manager + m_materials = new SCT_MaterialManager{m_db}; + // Create the geometry manager. - // - - m_geometryManager = new SCT_GeometryManager(); + m_geometryManager = new SCT_GeometryManager{m_db}; m_geometryManager->setOptions(options); - m_geometryManager->setAthenaComps(athenaComps); m_useDynamicAlignFolders = options.dynamicAlignFolders(); - // 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()); - m_geometryManager->setCommonItems(commonItems); - - // Set Version information // Get the geometry tag DecodeVersionKey versionKey(geoDbTagSvc(),"SCT"); @@ -118,12 +114,6 @@ SCT_DetectorFactory::SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaC 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()); - } @@ -131,8 +121,9 @@ 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_db; + delete m_materials; delete m_geometryManager; - } void SCT_DetectorFactory::create(GeoPhysVol *world) @@ -147,10 +138,6 @@ void SCT_DetectorFactory::create(GeoPhysVol *world) // 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(); GeoTrf::Transform3D sctTransform = sctGeneral->partTransform("SCT"); @@ -175,9 +162,9 @@ void SCT_DetectorFactory::create(GeoPhysVol *world) m_detectorManager->numerology().addBarrel(0); // Create the SCT Barrel - SCT_Barrel sctBarrel("SCT_Barrel"); + SCT_Barrel sctBarrel("SCT_Barrel", m_detectorManager, m_geometryManager, m_materials); - SCT_Identifier id; + SCT_Identifier id{m_geometryManager->athenaComps()->getIdHelper()}; id.setBarrelEC(0); GeoVPhysVol * barrelPV = sctBarrel.build(id); GeoAlignableTransform * barrelTransform = new GeoAlignableTransform(sctTransform * sctGeneral->partTransform(barrelLabel)); @@ -206,9 +193,9 @@ void SCT_DetectorFactory::create(GeoPhysVol *world) m_detectorManager->numerology().addEndcap(2); // Create the Forward - SCT_Forward sctForwardPlus("SCT_ForwardA", +2); + SCT_Forward sctForwardPlus("SCT_ForwardA", +2, m_detectorManager, m_geometryManager, m_materials); - SCT_Identifier idFwdPlus; + SCT_Identifier idFwdPlus{m_geometryManager->athenaComps()->getIdHelper()}; idFwdPlus.setBarrelEC(2); GeoVPhysVol * forwardPlusPV = sctForwardPlus.build(idFwdPlus); GeoTrf::Transform3D fwdTransformPlus(sctTransform @@ -239,9 +226,9 @@ void SCT_DetectorFactory::create(GeoPhysVol *world) m_detectorManager->numerology().addEndcap(-2); - SCT_Forward sctForwardMinus("SCT_ForwardC",-2); + SCT_Forward sctForwardMinus("SCT_ForwardC", -2, m_detectorManager, m_geometryManager, m_materials); - SCT_Identifier idFwdMinus; + SCT_Identifier idFwdMinus{m_geometryManager->athenaComps()->getIdHelper()}; idFwdMinus.setBarrelEC(-2); GeoVPhysVol * forwardMinusPV = sctForwardMinus.build(idFwdMinus); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx old mode 100755 new mode 100644 index c3c00a5bd7a567c585cf45dc8b41c17c74dec78d..93b7e54b5c7dad8b9358808e52331f6118e9e645 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx @@ -50,10 +50,6 @@ SCT_DetectorTool::SCT_DetectorTool(const std::string& type, StatusCode SCT_DetectorTool::create() { - // Reinit various singleton type objects. - SCT_DataBase::reinit(); - SCT_MaterialManager::reinit(); - // Get the detector configuration. ATH_CHECK(m_geoDbTagSvc.retrieve()); @@ -156,10 +152,6 @@ SCT_DetectorTool::create() ATH_CHECK(detStore()->symLink(m_manager, siDetManager)); } - // Delete unneeded singleton objects - SCT_DataBase::reinit(); - SCT_MaterialManager::reinit(); - return StatusCode::SUCCESS; } @@ -175,7 +167,7 @@ SCT_DetectorTool::clear() } StatusCode -SCT_DetectorTool::registerCallback() +SCT_DetectorTool::registerCallback ATLAS_NOT_THREAD_SAFE () { StatusCode sc{StatusCode::FAILURE, true}; if (m_alignable.value()) { diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx old mode 100755 new mode 100644 index e79d3211d0a27bae118b0241115ebaeb0b686ed3..b5c0345cec58f4adb6c675d5432919c980004b1f --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -18,8 +18,11 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_Dogleg::SCT_Dogleg(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_Dogleg::SCT_Dogleg(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -29,10 +32,9 @@ SCT_Dogleg::SCT_Dogleg(const std::string & name) void SCT_Dogleg::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - SCT_MaterialManager materials; - - m_material = materials.getMaterial(parameters->doglegMaterial()); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); + + m_material = m_materials->getMaterial(parameters->doglegMaterial()); m_thickness = parameters->doglegThickness(); m_length = parameters->doglegLength(); m_width = parameters->doglegWidth(); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx old mode 100755 new mode 100644 index f05175588911f798bfaec00f44cd4f2cfd5884cd..21c6277b383abd7070e89f5574519392f6d66770 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FSIEndJewel.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_FSIEndJewel::SCT_FSIEndJewel(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_FSIEndJewel::SCT_FSIEndJewel(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -26,8 +29,7 @@ SCT_FSIEndJewel::SCT_FSIEndJewel(const std::string & name) void SCT_FSIEndJewel::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - SCT_MaterialManager materials; + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); m_materialName = parameters->fsiEndJewelMaterial(); m_radialWidth = parameters->fsiEndJewelRadialWidth(); @@ -41,12 +43,9 @@ 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); + m_material = m_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 old mode 100755 new mode 100644 index 96c53597a00d66b52e86cba972027de4ccfa111c..b16d678153db65551d6521858719b5747fb740fa --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FSIFibreMask.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/Units.h" -SCT_FSIFibreMask::SCT_FSIFibreMask(const std::string & name, int iLayer, double length) - : SCT_SharedComponentFactory(name), m_iLayer(iLayer), m_length(length) +SCT_FSIFibreMask::SCT_FSIFibreMask(const std::string & name, int iLayer, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_iLayer(iLayer), m_length(length) { getParameters(); m_physVolume = build(); @@ -26,8 +30,8 @@ SCT_FSIFibreMask::SCT_FSIFibreMask(const std::string & name, int iLayer, double void SCT_FSIFibreMask::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); + m_materialName = parameters->fsiFibreMaskMaterial(); m_outerRadius = parameters->supportCylInnerRadius(m_iLayer); m_innerRadius = m_outerRadius - parameters->fsiFibreMaskDeltaR(); @@ -38,15 +42,11 @@ 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()); + m_material = m_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 old mode 100755 new mode 100644 diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx old mode 100755 new mode 100644 index 57a8a419a60b2aecbbd29dbe299d3c4c5d2d5fe4..a94a913277da6f27cca6ab4dcaafea053b1b48bf --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FSIScorpion.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_FSIScorpion::SCT_FSIScorpion(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_FSIScorpion::SCT_FSIScorpion(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -26,9 +29,7 @@ SCT_FSIScorpion::SCT_FSIScorpion(const std::string & name) void SCT_FSIScorpion::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - SCT_MaterialManager materials; - + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); m_materialName = parameters->fsiScorpionMaterial(); m_radialWidth = parameters->fsiScorpionRadialWidth(); m_rPhiWidth = parameters->fsiScorpionRPhiWidth(); @@ -40,13 +41,10 @@ SCT_FSIScorpion::build() { // Build the barrel FSI scorpion. Just a simple box. - // Length is in z-direction. - SCT_MaterialManager materials; - + // Length is in z-direction. 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); + m_material = m_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 old mode 100755 new mode 100644 index 4422b3f751c0a1da9299bb72d606d9279c8d6380..14e0cb9e72267a2d4fb31414a9c6c2ecb09cd2b0 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Flange.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/Units.h" -SCT_Flange::SCT_Flange(const std::string & name, int iLayer) - : SCT_SharedComponentFactory(name), m_iLayer(iLayer) +SCT_Flange::SCT_Flange(const std::string & name, int iLayer, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_iLayer(iLayer) { getParameters(); m_physVolume = build(); @@ -26,7 +30,7 @@ SCT_Flange::SCT_Flange(const std::string & name, int iLayer) void SCT_Flange::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); m_materialName = parameters->flangeMaterial(m_iLayer); m_length = parameters->flangeDeltaZ(m_iLayer); @@ -47,11 +51,9 @@ 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);} + m_material = m_materials->getMaterialForVolume(m_materialName, flangeShape->volume()); + if(!m_material) {m_material = m_materials->getMaterial(m_materialName);} const GeoLogVol * flangeLog = new GeoLogVol(getName(), flangeShape, m_material); GeoPhysVol * flange = new GeoPhysVol(flangeLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx old mode 100755 new mode 100644 index 405c90423da59034bf55eb628f0490f939702844..a9700ebd9dcb69bc44ed5e28665c0d74ece4c016 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Forward.h" @@ -13,7 +13,6 @@ #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" @@ -37,8 +36,11 @@ #include <sstream> #include <cmath> -SCT_Forward::SCT_Forward(const std::string & name, int ec) - : SCT_UniqueComponentFactory(name), +SCT_Forward::SCT_Forward(const std::string & name, int ec, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), m_endcap(ec) { getParameters(); @@ -55,8 +57,8 @@ void SCT_Forward::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); - const SCT_ForwardModuleParameters * moduleParameters = geometryManager()->forwardModuleParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); + const SCT_ForwardModuleParameters * moduleParameters = m_geometryManager->forwardModuleParameters(); //m_numRingTypes = parameters->fwdNumRingTypes(); m_numModuleTypes = moduleParameters->fwdModuleNumTypes(); @@ -84,7 +86,7 @@ SCT_Forward::getParameters() // Set numerology - detectorManager()->numerology().setNumDisks(m_numWheels); + m_detectorManager->numerology().setNumDisks(m_numWheels); } @@ -98,35 +100,36 @@ SCT_Forward::preBuild() // 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)); + m_modules.push_back(new SCT_FwdModule("FwdModule"+intToString(iModuleType), iModuleType, + m_detectorManager, m_geometryManager, m_materials)); } for (int iWheel = 0; iWheel < m_numWheels; iWheel++){ // Build Wheels 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); + SCT_FwdWheel * wheel = new SCT_FwdWheel(name.str(), iWheel, m_modules, m_endcap, + m_detectorManager, m_geometryManager, m_materials); 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()); + new GeoLogVol(getName(), forwardEnvelopeShape, m_materials->gasMaterial()); return forwardLog; } GeoVPhysVol * -SCT_Forward::build(SCT_Identifier id) const +SCT_Forward::build(SCT_Identifier id) { GeoFullPhysVol * forward = new GeoFullPhysVol(m_logVolume); for (int iWheel = 0; iWheel < m_numWheels; iWheel++){ - const SCT_FwdWheel * wheel = m_wheels[iWheel]; + SCT_FwdWheel * wheel = m_wheels[iWheel]; std::ostringstream wheelName; wheelName << "Wheel#" << iWheel; double zpos = wheel->zPosition() - zCenter(); forward->add(new GeoNameTag(wheelName.str())); @@ -138,13 +141,13 @@ SCT_Forward::build(SCT_Identifier id) const forward->add(wheelPV); // Store the alignable transform - detectorManager()->addAlignableTransform(2, id.getWaferId(), transform, wheelPV); + m_detectorManager->addAlignableTransform(2, id.getWaferId(), transform, wheelPV); } // // Place SupportFrame // - SCT_FwdSupportFrame supportFrame("SupportFrame"); + SCT_FwdSupportFrame supportFrame("SupportFrame", m_detectorManager, m_geometryManager, m_materials); double supportFrameZPos = supportFrame.zPosition() - zCenter(); forward->add(new GeoTransform(GeoTrf::TranslateZ3D(supportFrameZPos))); forward->add(supportFrame.getVolume()); @@ -157,7 +160,8 @@ SCT_Forward::build(SCT_Identifier id) const SCT_FwdCylinderServices cylinderServices("CylinderServices", supportFrame.outerRadius(), m_outerRadiusCylinderServices, - supportFrame.length()); + supportFrame.length(), + m_detectorManager, m_geometryManager, m_materials); forward->add(new GeoTransform(GeoTrf::TranslateZ3D(supportFrameZPos))); forward->add(cylinderServices.getVolume()); @@ -188,7 +192,8 @@ SCT_Forward::build(SCT_Identifier id) const // Label Cooling pipe with W# at end of string SCT_FwdCoolingPipe coolingPipe("OffDiskCoolingPipeW"+intToString(iWheel), - numPipes, rStart, startPos, endPos); + numPipes, rStart, startPos, endPos, + m_detectorManager, m_geometryManager, m_materials); // Place the cooling pipes double coolingPipeZPos = coolingPipe.zPosition() - zCenter(); @@ -227,7 +232,8 @@ SCT_Forward::build(SCT_Identifier id) const // Label power tape with W# at end of string SCT_FwdPowerTape powerTape("OffDiskPowerTapeW"+intToString(iWheel), - numModules, rStart, startPos, endPos); + numModules, rStart, startPos, endPos, + m_detectorManager, m_geometryManager, m_materials); // Place Power Tapes double powerTapeZPos = powerTape.zPosition() - zCenter(); @@ -245,14 +251,14 @@ SCT_Forward::build(SCT_Identifier id) const // for (int iElement = 0; iElement < m_numThermalShieldElements; iElement++){ SCT_FwdThermalShieldElement thermalShieldElement("FwdThermalShieldElement"+intToString(iElement), - iElement); + iElement, m_detectorManager, m_geometryManager, m_materials); double elementZPos = thermalShieldElement.zPosition() - zCenter(); forward->add(new GeoTransform(GeoTrf::TranslateZ3D(elementZPos))); forward->add(thermalShieldElement.getVolume()); } // Extra Material - InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager()); + InDetDD::ExtraMaterial xMat(m_geometryManager->distortedMatManager()); xMat.add(forward, "SCTEndcap", zCenter()); if (m_endcap > 0) { xMat.add(forward, "SCTEndcapA", zCenter()); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx old mode 100755 new mode 100644 index fb09c3900adb960314417fe6ec5df4da25b79130..ef6af4c275dd7e994ee79f39486e6ce6d56c6ba1 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_ForwardModuleParameters.h" @@ -14,9 +14,9 @@ #include <cmath> -SCT_ForwardModuleParameters::SCT_ForwardModuleParameters() +SCT_ForwardModuleParameters::SCT_ForwardModuleParameters(SCT_DataBase* rdb) { - m_rdb = SCT_DataBase::instance(); + m_rdb = rdb; } // diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx old mode 100755 new mode 100644 index 80fc94334cbbc2b0454874d57d8df59a3979e572..f72533b1ed77d179bb36f09e7315296642e842e9 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_ForwardParameters.h" @@ -15,15 +15,14 @@ #include <iostream> #include <cmath> -SCT_ForwardParameters::SCT_ForwardParameters() - : m_fsiHelper(0) +SCT_ForwardParameters::SCT_ForwardParameters(SCT_DataBase* rdb) { - m_rdb = SCT_DataBase::instance(); + m_rdb = rdb; + m_fsiHelper = std::make_unique<FSIHelper>(m_rdb); } SCT_ForwardParameters::~SCT_ForwardParameters() { - delete m_fsiHelper; } // @@ -574,7 +573,6 @@ SCT_ForwardParameters::fwdFSIGeomZOffset(int iType) const const FSIHelper & SCT_ForwardParameters::fsiHelper() const { - if (!m_fsiHelper) m_fsiHelper = new FSIHelper(m_rdb); return *m_fsiHelper; } @@ -776,18 +774,12 @@ SCT_ForwardParameters& SCT_ForwardParameters::operator=(const SCT_ForwardParameters& right) { if (this != &right) { m_rdb = right.m_rdb; - m_fsiHelper = nullptr; - if (right.m_fsiHelper!=nullptr) { - m_fsiHelper = new FSIHelper(m_rdb); - } + m_fsiHelper.reset(new FSIHelper(m_rdb)); } return *this; } SCT_ForwardParameters::SCT_ForwardParameters(const SCT_ForwardParameters& right) { m_rdb = right.m_rdb; - m_fsiHelper = nullptr; - if (right.m_fsiHelper!=nullptr) { - m_fsiHelper = new FSIHelper(m_rdb); - } + m_fsiHelper.reset(new FSIHelper(m_rdb)); } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx old mode 100755 new mode 100644 index b3420cf13797aabf14b2c13852b2fb6eb2a869d2..2ec1b74a90dc4e1b73ef8f4cea6668bd140819d3 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdCoolingBlock.h" @@ -17,8 +17,12 @@ #include <iostream> -SCT_FwdCoolingBlock::SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary) - : SCT_SharedComponentFactory(name), m_hiLo(hiLo), m_mainSec(mainOrSecondary) +SCT_FwdCoolingBlock::SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_hiLo(hiLo), m_mainSec(mainOrSecondary) { getParameters(); m_physVolume = build(); @@ -28,7 +32,7 @@ SCT_FwdCoolingBlock::SCT_FwdCoolingBlock(const std::string & name, int hiLo, int void SCT_FwdCoolingBlock::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_coolingBlockIndex = -1; for (int i = 0; i < 4; i++){ @@ -38,7 +42,7 @@ SCT_FwdCoolingBlock::getParameters() } if (m_coolingBlockIndex < 0){ - std::cout << "SCT_FwdRing: ERROR. Cooling block type is missing. HiLo = " << m_hiLo + std::cout << "SCT_FwdCoolingBlock: ERROR. Cooling block type is missing. HiLo = " << m_hiLo << ", MainSecondary = " << m_mainSec << std::endl; // Will crash or give unpredictable results } @@ -57,11 +61,8 @@ 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()); + m_material = m_materials->getMaterialForVolume(m_materialName, coolingBlockShape->volume()); const GeoLogVol *coolingBlockLog = new GeoLogVol(getName(), coolingBlockShape, m_material); GeoPhysVol * coolingBlock = new GeoPhysVol(coolingBlockLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx old mode 100755 new mode 100644 index bd06f571ebd0ef284f2fcd21af6af02499cbd7b5..0ac7f63c0b60af43620262852ec71f72bafedbff --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdCoolingPipe.h" @@ -22,8 +22,12 @@ 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) + double endPos, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_numPipes(numPipes), m_innerRadius(innerRadius) { m_length = std::abs(endPos - startPos); m_zPosition = 0.5 * (startPos + endPos); @@ -35,11 +39,9 @@ SCT_FwdCoolingPipe::SCT_FwdCoolingPipe(const std::string & name, void SCT_FwdCoolingPipe::getParameters() -{ - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); - SCT_MaterialManager materials; - - m_material = materials.getMaterial(parameters->fwdCoolingPipeMaterial()); +{ + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); + m_material = m_materials->getMaterial(parameters->fwdCoolingPipeMaterial()); m_pipeRadius = parameters->fwdCoolingPipeRadius(); } @@ -65,4 +67,3 @@ SCT_FwdCoolingPipe::build() return pipe; } - diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx old mode 100755 new mode 100644 index e8bf3e68b7cc0d35dd5984f9a73ca9e01c7693a8..586ca2294c0f6056e9763ee4bfd8dfe847d3fbdf --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdCylinderServices.h" @@ -26,8 +26,12 @@ 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) + double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_innerRadius(rmin), m_outerRadius(rmax), m_length(length) { getParameters(); m_physVolume = build(); @@ -41,36 +45,36 @@ SCT_FwdCylinderServices::~SCT_FwdCylinderServices() void SCT_FwdCylinderServices::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); // Retrieve parameters for each service for (int iType = 0; iType < parameters->fwdNumCylinderServiceTypes(); iType++) { - if(parameters->fwdCylinderServiceName(iType) == "CoolingPipe") { + 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") { + 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") { + 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") { + 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") { + 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") { + if (parameters->fwdCylinderServiceName(iType) == "Rail") { m_railDeltaR = parameters->fwdCylinderServiceDeltaR(iType); m_railRPhi = parameters->fwdCylinderServiceRPhi(iType); m_railMaterialName = parameters->fwdCylinderServiceMaterial(iType); @@ -79,22 +83,22 @@ SCT_FwdCylinderServices::getParameters() // Retrieve angles for each service for (int iLoc = 0; iLoc < parameters->fwdNumCylinderServiceLocs(); iLoc++) { - if(parameters->fwdCylinderServiceLocName(iLoc) == "CoolingPipe") { + if (parameters->fwdCylinderServiceLocName(iLoc) == "CoolingPipe") { m_coolingLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); } - if(parameters->fwdCylinderServiceLocName(iLoc) == "LMT") { + if (parameters->fwdCylinderServiceLocName(iLoc) == "LMT") { m_lmtLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); } - if(parameters->fwdCylinderServiceLocName(iLoc) == "LMTCooling") { + if (parameters->fwdCylinderServiceLocName(iLoc) == "LMTCooling") { m_lmtCoolingLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); } - if(parameters->fwdCylinderServiceLocName(iLoc) == "Fibres") { + if (parameters->fwdCylinderServiceLocName(iLoc) == "Fibres") { m_fibreLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); } - if(parameters->fwdCylinderServiceLocName(iLoc) == "NPipe") { + if (parameters->fwdCylinderServiceLocName(iLoc) == "NPipe") { m_nPipeLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); } - if(parameters->fwdCylinderServiceLocName(iLoc) == "Rail") { + if (parameters->fwdCylinderServiceLocName(iLoc) == "Rail") { m_railLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc)); } } @@ -110,9 +114,8 @@ 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()); + const GeoLogVol * cylinderLog = new GeoLogVol(getName(), cylinderShape, m_materials->gasMaterial()); GeoPhysVol * cylinder = new GeoPhysVol(cylinderLog); // Create All Services @@ -132,7 +135,7 @@ SCT_FwdCylinderServices::build() const GeoCons* coolingShape = new GeoCons(coolingRmin, coolingRmin, coolingRmax1, coolingRmax2, 0.5 * m_length, -0.5 * coolingDPhi * Gaudi::Units::radian, coolingDPhi * Gaudi::Units::radian); - const GeoLogVol * coolingLog = new GeoLogVol("CoolingPipe", coolingShape, materials.getMaterialForVolume(m_coolingMaterialName, coolingShape->volume())); + const GeoLogVol * coolingLog = new GeoLogVol("CoolingPipe", coolingShape, m_materials->getMaterialForVolume(m_coolingMaterialName, coolingShape->volume())); GeoPhysVol * coolingPipe = new GeoPhysVol(coolingLog); // Low Mass Tapes @@ -142,7 +145,7 @@ SCT_FwdCylinderServices::build() double lmtDPhi = m_lmtRPhi / lmtRmin; const GeoCons* lmtShape = new GeoCons(lmtRmin, lmtRmin, lmtRmax1, lmtRmax2, 0.5 * m_length, -0.5 * lmtDPhi * Gaudi::Units::radian, lmtDPhi * Gaudi::Units::radian); - const GeoLogVol * lmtLog = new GeoLogVol("LMT", lmtShape, materials.getMaterialForVolume(m_lmtMaterialName,lmtShape->volume())); + const GeoLogVol * lmtLog = new GeoLogVol("LMT", lmtShape, m_materials->getMaterialForVolume(m_lmtMaterialName,lmtShape->volume())); GeoPhysVol * lmt = new GeoPhysVol(lmtLog); // LMT Cooling: must be outside LMTs @@ -152,7 +155,7 @@ SCT_FwdCylinderServices::build() double lmtLength = m_length - 2. * m_lmtCoolingZOffset; const GeoTubs* lmtCoolingShape = new GeoTubs(lmtCoolingRmin, lmtCoolingRmax, 0.5 * lmtLength, -0.5 * lmtCoolingDPhi * Gaudi::Units::radian, lmtCoolingDPhi * Gaudi::Units::radian); - const GeoLogVol * lmtCoolingLog = new GeoLogVol("LMTCooling", lmtCoolingShape, materials.getMaterialForVolume(m_lmtCoolingMaterialName,lmtCoolingShape->volume())); + const GeoLogVol * lmtCoolingLog = new GeoLogVol("LMTCooling", lmtCoolingShape, m_materials->getMaterialForVolume(m_lmtCoolingMaterialName,lmtCoolingShape->volume())); GeoPhysVol * lmtCooling = new GeoPhysVol(lmtCoolingLog); // Fibres @@ -162,7 +165,7 @@ SCT_FwdCylinderServices::build() double fibreDPhi = m_fibreRPhi / fibreRmin; const GeoCons* fibreShape = new GeoCons(fibreRmin, fibreRmin, fibreRmax1, fibreRmax2, 0.5 * m_length, -0.5 * fibreDPhi * Gaudi::Units::radian, fibreDPhi * Gaudi::Units::radian); - const GeoLogVol * fibreLog = new GeoLogVol("Fibres", fibreShape, materials.getMaterialForVolume(m_fibreMaterialName,fibreShape->volume())); + const GeoLogVol * fibreLog = new GeoLogVol("Fibres", fibreShape, m_materials->getMaterialForVolume(m_fibreMaterialName,fibreShape->volume())); GeoPhysVol * fibres = new GeoPhysVol(fibreLog); // N2 Pipe @@ -171,7 +174,7 @@ SCT_FwdCylinderServices::build() double nPipeDPhi = m_nPipeRPhi / nPipeRmin; const GeoTubs* nPipeShape = new GeoTubs(nPipeRmin, nPipeRmax, 0.5 * m_length, -0.5 * nPipeDPhi * Gaudi::Units::radian, nPipeDPhi * Gaudi::Units::radian); - const GeoLogVol * nPipeLog = new GeoLogVol("NPipe", nPipeShape, materials.getMaterialForVolume(m_nPipeMaterialName,nPipeShape->volume())); + const GeoLogVol * nPipeLog = new GeoLogVol("NPipe", nPipeShape, m_materials->getMaterialForVolume(m_nPipeMaterialName,nPipeShape->volume())); GeoPhysVol * nPipe = new GeoPhysVol(nPipeLog); // Rails: must be outside Cooling and N2 Pipes @@ -180,7 +183,7 @@ SCT_FwdCylinderServices::build() double railDPhi = m_railRPhi / railRmin; const GeoTubs* railShape = new GeoTubs(railRmin, railRmax, 0.5 * m_length, -0.5 * railDPhi * Gaudi::Units::radian, railDPhi * Gaudi::Units::radian); - const GeoLogVol * railLog = new GeoLogVol("Rail", railShape, materials.getMaterialForVolume(m_railMaterialName,railShape->volume())); + const GeoLogVol * railLog = new GeoLogVol("Rail", railShape, m_materials->getMaterialForVolume(m_railMaterialName,railShape->volume())); GeoPhysVol * rail = new GeoPhysVol(railLog); // Services are repeated for each quadrant @@ -228,4 +231,3 @@ SCT_FwdCylinderServices::build() return cylinder; } - diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx old mode 100755 new mode 100644 index 0bd1309dc1643f5384805c733315c037c983cd63..8ff57e6d8bb3430773486acc3889c7086ec8b487 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdDiscFixation.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/Units.h" -SCT_FwdDiscFixation::SCT_FwdDiscFixation(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_FwdDiscFixation::SCT_FwdDiscFixation(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -26,7 +29,7 @@ SCT_FwdDiscFixation::SCT_FwdDiscFixation(const std::string & name) void SCT_FwdDiscFixation::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName= parameters->fwdDiscFixationMaterial(); m_thickness = parameters->fwdDiscFixationThickness(); @@ -36,11 +39,8 @@ SCT_FwdDiscFixation::getParameters() 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()); + m_material = m_materials->getMaterialForVolume(m_materialName, discFixationShape->volume()); const GeoLogVol * discFixationLog = new GeoLogVol(getName(), discFixationShape, m_material); GeoPhysVol * discFixation = new GeoPhysVol(discFixationLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx old mode 100755 new mode 100644 index bb71f56acd3dcc47a878be091486c33df00c9741..47473f65ca0861f1db61bf814f974e285c73e55f --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdDiscPowerTape.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/Units.h" -SCT_FwdDiscPowerTape::SCT_FwdDiscPowerTape(const std::string & name, int iRing) - : SCT_SharedComponentFactory(name), m_ringNumber(iRing) +SCT_FwdDiscPowerTape::SCT_FwdDiscPowerTape(const std::string & name, int iRing, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_ringNumber(iRing) { getParameters(); m_physVolume = build(); @@ -26,7 +30,7 @@ SCT_FwdDiscPowerTape::SCT_FwdDiscPowerTape(const std::string & name, int iRing) void SCT_FwdDiscPowerTape::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName = parameters->fwdDiscPowerTapeMaterial(m_ringNumber); m_innerRadius = parameters->fwdDiscPowerTapeInnerRadius(m_ringNumber); @@ -38,12 +42,9 @@ SCT_FwdDiscPowerTape::getParameters() 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()); + m_material = m_materials->getMaterialForVolume(m_materialName, powerTapeShape->volume()); const GeoLogVol * powerTapeLog = new GeoLogVol(getName(), powerTapeShape, m_material); GeoPhysVol * powerTape = new GeoPhysVol(powerTapeLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx old mode 100755 new mode 100644 index 9e66dc2944b76834c3a4c3529ea72c8ab8ade1f6..9952f315e45ce64ebe75fc669eab9de49739a09b --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdDiscSupport.h" @@ -14,8 +14,12 @@ #include "GeoModelKernel/GeoPhysVol.h" #include "GeoModelKernel/Units.h" -SCT_FwdDiscSupport::SCT_FwdDiscSupport(const std::string & name, int iWheel) - : SCT_SharedComponentFactory(name), m_iWheel(iWheel) +SCT_FwdDiscSupport::SCT_FwdDiscSupport(const std::string & name, int iWheel, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_iWheel(iWheel) { getParameters(); m_physVolume = build(); @@ -25,7 +29,7 @@ SCT_FwdDiscSupport::SCT_FwdDiscSupport(const std::string & name, int iWheel) void SCT_FwdDiscSupport::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName = parameters->fwdDiscSupportMaterial(); m_thickness = parameters->fwdDiscSupportThickness(); @@ -37,11 +41,9 @@ 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);} + m_material = m_materials->getMaterialForVolume(m_materialName+intToString(m_iWheel), discSupportShape->volume()); + if(!m_material) m_material = m_materials->getMaterial(m_materialName); const GeoLogVol * discSupportLog = new GeoLogVol(getName(), discSupportShape, m_material); GeoPhysVol * discSupport = new GeoPhysVol(discSupportLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx old mode 100755 new mode 100644 index 98c77903a3f0ce3891165b5276435619e78a5446..5597aaf4555092b45e8f4fcf1a2da53207e7c919 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdFSI.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/Units.h" -SCT_FwdFSI::SCT_FwdFSI(const std::string & name, int type) - : SCT_SharedComponentFactory(name), m_type(type) +SCT_FwdFSI::SCT_FwdFSI(const std::string & name, int type, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_type(type) { getParameters(); m_physVolume = build(); @@ -26,7 +30,7 @@ SCT_FwdFSI::SCT_FwdFSI(const std::string & name, int type) void SCT_FwdFSI::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName= parameters->fwdFSIGeomMaterial(m_type); m_thickness = parameters->fwdFSIGeomThickness(m_type); @@ -38,10 +42,8 @@ SCT_FwdFSI::getParameters() 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()); + m_material = m_materials->getMaterialForVolume(m_materialName, fsiShape->volume()); const GeoLogVol * fsiLog = new GeoLogVol(getName(), fsiShape, m_material); GeoPhysVol * fsi = new GeoPhysVol(fsiLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx old mode 100755 new mode 100644 index 99b73df0b4d4e3ca155b3e1961da9f682eccab2b..6944ff4bbb3b580c5256af42ed97960ab27a3953 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////// @@ -35,8 +35,12 @@ #include <cmath> -SCT_FwdHybrid::SCT_FwdHybrid(const std::string & name, int ringType) - : SCT_SharedComponentFactory(name), m_ringType(ringType) +SCT_FwdHybrid::SCT_FwdHybrid(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_ringType(ringType) { getParameters(); m_physVolume = build(); @@ -48,7 +52,7 @@ void SCT_FwdHybrid::getParameters() { - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); m_materialName = parameters->fwdHybridMaterial(); @@ -80,7 +84,7 @@ SCT_FwdHybrid::getParameters() GeoVPhysVol * SCT_FwdHybrid::build() { - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); // Make a hybrid. This is a TRD + BOX const GeoTrd * hybridShape1 = new GeoTrd(0.5 * m_thickness, 0.5 * m_thickness, @@ -108,11 +112,9 @@ GeoVPhysVol * SCT_FwdHybrid::build() const GeoShape & hybridPos2 = (*hybridShape1 << GeoTrf::RotateX3D(rotation) << GeoTrf::TranslateZ3D(position) ); - - SCT_MaterialManager materials; const GeoShapeUnion & hybridShape = hybridPos1.add(hybridPos2); // error getting volume directly. - m_material = materials.getMaterialForVolume(m_materialName, hybridShape1->volume()+hybridShape2->volume()); + m_material = m_materials->getMaterialForVolume(m_materialName, hybridShape1->volume()+hybridShape2->volume()); const GeoLogVol * hybridLog = new GeoLogVol(getName(), &hybridShape, m_material); GeoPhysVol * hybrid = new GeoPhysVol(hybridLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx old mode 100755 new mode 100644 index c1170044dc732543df542cc07246e476227a0414..09bb0a3d8d702e321fd1696cae376c3b094bc998 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////// @@ -45,22 +45,30 @@ inline double sqr(double x) {return x*x;} -SCT_FwdModule::SCT_FwdModule(const std::string & name, int ringType) - : SCT_UniqueComponentFactory(name), m_ringType(ringType) +SCT_FwdModule::SCT_FwdModule(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), + 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); + m_hybrid = new SCT_FwdHybrid("SCT_FwdHybrid"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials); + m_spine = new SCT_FwdSpine("SCT_FwdSpine"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials); + m_subspineL = new SCT_FwdSubSpine("SCT_FwdSubSpineL"+intToString(ringType), m_ringType, SUBSPINE_LEFT, + m_detectorManager, m_geometryManager, materials); + m_subspineR = new SCT_FwdSubSpine("SCT_FwdSubSpineR"+intToString(ringType), m_ringType, SUBSPINE_RIGHT, + m_detectorManager, m_geometryManager, materials); + m_sensor = new SCT_FwdSensor("ECSensor"+intToString(ringType), m_ringType, + m_detectorManager, m_geometryManager, materials); if (m_connectorPresent) { - m_connector = new SCT_FwdModuleConnector("SCT_FwdModuleConnector"+intToString(ringType), m_ringType); + m_connector = new SCT_FwdModuleConnector("SCT_FwdModuleConnector"+intToString(ringType), m_ringType, + m_detectorManager, m_geometryManager, materials); } else { - m_connector = NULL; + m_connector = nullptr; } m_logVolume = preBuild(); @@ -81,7 +89,7 @@ SCT_FwdModule::~SCT_FwdModule() void SCT_FwdModule::getParameters() { - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); m_glueThickness = parameters->fwdModuleGlueThickness(m_ringType); m_distBtwMountPoints = parameters->fwdModuleDistBtwMountPoints(m_ringType); m_mountPointToCenter = parameters->fwdModuleMountPoint(m_ringType); @@ -97,7 +105,7 @@ const GeoLogVol * SCT_FwdModule::preBuild() { // module volume preparing - const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters(); double safety = generalParameters->safety(); double safetyTmp = safety * Gaudi::Units::cm; // For compatibility with minor bug in older version - safety already in CLHEP units; @@ -159,14 +167,13 @@ const GeoLogVol * SCT_FwdModule::preBuild() 0.5 * m_length); const GeoShapeShift & moduleEnvelope = (*moduleEnvelopeShape << GeoTrf::TranslateZ3D(m_moduleShift) ); - SCT_MaterialManager materials; - GeoLogVol * moduleLog = new GeoLogVol(getName(), &moduleEnvelope, materials.gasMaterial()); + GeoLogVol * moduleLog = new GeoLogVol(getName(), &moduleEnvelope, m_materials->gasMaterial()); return moduleLog; } -GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) const +GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) { // build method for creating module parent physical volume @@ -174,7 +181,7 @@ GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) const // - relative position of component is part of its shape GeoFullPhysVol * module = new GeoFullPhysVol(m_logVolume); - if(m_connector != NULL) module->add(m_connector->getVolume()); + if (m_connector != NULL) module->add(m_connector->getVolume()); module->add(m_hybrid->getVolume()); module->add(m_spine->getVolume()); module->add(m_subspineL->getVolume()); @@ -207,7 +214,7 @@ GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) const module->add(bottomSensorPV); // Store transform - detectorManager()->addAlignableTransform(0, id.getWaferId(), bottomTransform, bottomSensorPV); + m_detectorManager->addAlignableTransform(0, id.getWaferId(), bottomTransform, bottomSensorPV); if (m_ringType == 2) { // Place glass pieces in place of sensor @@ -235,7 +242,7 @@ GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) const module->add(topSensorPV); // Store transform - detectorManager()->addAlignableTransform(0, id.getWaferId(), topTransform, topSensorPV); + m_detectorManager->addAlignableTransform(0, id.getWaferId(), topTransform, topSensorPV); if (m_ringType == 2) { // Place glass pieces in place of sensor module->add(new GeoTransform(GeoTrf::Transform3D(vecT*rotT))); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx old mode 100755 new mode 100644 index 5ba0a82cba9aef8700f98ee1584593d333ad7a09..5d1174cd24bbe07bcc41306303aae4a80453c0b0 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdModuleConnector.h" @@ -18,8 +18,12 @@ #include <cmath> -SCT_FwdModuleConnector::SCT_FwdModuleConnector(const std::string & name, int ringType) - : SCT_SharedComponentFactory(name), m_ringType(ringType) +SCT_FwdModuleConnector::SCT_FwdModuleConnector(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_ringType(ringType) { getParameters(); m_physVolume = build(); @@ -29,7 +33,7 @@ SCT_FwdModuleConnector::SCT_FwdModuleConnector(const std::string & name, int rin void SCT_FwdModuleConnector::getParameters() { - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); m_materialName= parameters->fwdModuleConnectorMaterial(); m_deltaR = parameters->fwdModuleConnectorDeltaR(); @@ -40,12 +44,11 @@ SCT_FwdModuleConnector::getParameters() GeoVPhysVol * SCT_FwdModuleConnector::build() { - SCT_MaterialManager materials; - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + const SCT_ForwardModuleParameters * parameters = m_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()); + m_material = m_materials->getMaterialForVolume(m_materialName, moduleConnShape->volume()); // Shift to correct position within module double xposition = 0.5 * (parameters->fwdHybridThickness() + m_thickness); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx old mode 100755 new mode 100644 index 0a25774b19791a3b6b913a2cd812fc19c7a86f29..222377aa76eec945cfdfe56b308d7b0f74ef837d --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdOptoHarness.h" @@ -19,8 +19,12 @@ inline double sqr(double x) {return x*x;} -SCT_FwdOptoHarness::SCT_FwdOptoHarness(const std::string & name, int itype) - : SCT_SharedComponentFactory(name), m_type(itype) +SCT_FwdOptoHarness::SCT_FwdOptoHarness(const std::string & name, int itype, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_type(itype) { getParameters(); m_physVolume = build(); @@ -30,7 +34,7 @@ SCT_FwdOptoHarness::SCT_FwdOptoHarness(const std::string & name, int itype) void SCT_FwdOptoHarness::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_index = -1; for(int i=0; i<3; ++i) { @@ -52,10 +56,8 @@ SCT_FwdOptoHarness::getParameters() 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 = m_materials->getMaterialForVolume(m_materialName, optoHarnessShape->volume()); const GeoLogVol * optoHarnessLog = new GeoLogVol(getName(), optoHarnessShape, m_material); GeoPhysVol * optoHarness = new GeoPhysVol(optoHarnessLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx old mode 100755 new mode 100644 index 29b530629e481c1c1773e5e48197a28edd04c905..55325f9c75f7595c03920667ac0d1bef8083bfbc --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdPPConnector.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/Units.h" -SCT_FwdPPConnector::SCT_FwdPPConnector(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_FwdPPConnector::SCT_FwdPPConnector(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -26,7 +29,7 @@ SCT_FwdPPConnector::SCT_FwdPPConnector(const std::string & name) void SCT_FwdPPConnector::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName= parameters->fwdPPConnectorMaterial(); m_thickness = parameters->fwdPPConnectorThickness(); @@ -37,11 +40,8 @@ SCT_FwdPPConnector::getParameters() 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()); + m_material = m_materials->getMaterialForVolume(m_materialName, pPConnectorShape->volume()); const GeoLogVol * pPConnectorLog = new GeoLogVol(getName(), pPConnectorShape, m_material); GeoPhysVol * pPConnector = new GeoPhysVol(pPConnectorLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx old mode 100755 new mode 100644 index ef6c3b76ee745e00f9d99f57d538b72827b85493..37a100c3fbad8e402d6e09114b23d1e77687ceb8 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdPPCooling.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/Units.h" -SCT_FwdPPCooling::SCT_FwdPPCooling(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_FwdPPCooling::SCT_FwdPPCooling(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -26,7 +29,7 @@ SCT_FwdPPCooling::SCT_FwdPPCooling(const std::string & name) void SCT_FwdPPCooling::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName= parameters->fwdPPCoolingMaterial(); m_thickness = parameters->fwdPPCoolingThickness(); @@ -37,11 +40,8 @@ SCT_FwdPPCooling::getParameters() 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()); + m_material = m_materials->getMaterialForVolume(m_materialName, pPCoolingShape->volume()); const GeoLogVol * pPCoolingLog = new GeoLogVol(getName(), pPCoolingShape, m_material); GeoPhysVol * pPCooling = new GeoPhysVol(pPCoolingLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx old mode 100755 new mode 100644 index 514a6bf0270a66836b51eccea72821be89e005c3..b3e3ff84cc48927eb8b1498b00c90465639394e2 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdPatchPanel.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/Units.h" -SCT_FwdPatchPanel::SCT_FwdPatchPanel(const std::string & name, int type) - : SCT_SharedComponentFactory(name), m_type(type) +SCT_FwdPatchPanel::SCT_FwdPatchPanel(const std::string & name, int type, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_type(type) { getParameters(); m_physVolume = build(); @@ -26,7 +30,7 @@ SCT_FwdPatchPanel::SCT_FwdPatchPanel(const std::string & name, int type) void SCT_FwdPatchPanel::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName= parameters->fwdPatchPanelMaterial(m_type); m_thickness = parameters->fwdPatchPanelThickness(m_type); @@ -38,11 +42,8 @@ SCT_FwdPatchPanel::getParameters() 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()); + m_material = m_materials->getMaterialForVolume(m_materialName, patchPanelShape->volume()); const GeoLogVol * patchPanelLog = new GeoLogVol(getName(), patchPanelShape, m_material); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx old mode 100755 new mode 100644 index 26eb848821793cc0bfb53e27f94541722c5f25ea..39a7dbced8434d42b797364215c946a48714ee81 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdPowerTape.h" @@ -20,8 +20,12 @@ 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) + double endPos, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_numModules(numModules), m_innerRadius(innerRadius) { m_length = std::abs(endPos - startPos); m_zPosition = 0.5 * (startPos + endPos); @@ -33,11 +37,9 @@ SCT_FwdPowerTape::SCT_FwdPowerTape(const std::string & name, void SCT_FwdPowerTape::getParameters() -{ - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); - SCT_MaterialManager materials; - - m_material = materials.getMaterial(parameters->fwdPowerTapeMaterial()); +{ + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); + m_material = m_materials->getMaterial(parameters->fwdPowerTapeMaterial()); m_crossSectArea = parameters->fwdPowerTapeCrossSectArea(); } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx old mode 100755 new mode 100644 index 4ba75ed8c4e9051e0f8d2b1475c1f4915daf7fe7..7546002b12cb757c4004a4d0aa7659943a9eb27f --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdRing.h" @@ -34,11 +34,14 @@ inline double sqr(double x) {return x*x;} SCT_FwdRing::SCT_FwdRing(const std::string & name, - const SCT_FwdModule * module, + SCT_FwdModule * module, int iWheel, int iRing, - int ec) - : SCT_UniqueComponentFactory(name), + int ec, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), m_iWheel(iWheel), m_iRing(iRing), m_endcap(ec), @@ -52,8 +55,8 @@ void SCT_FwdRing::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); - const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); + const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters(); m_safety = generalParameters->safety(); @@ -71,7 +74,7 @@ SCT_FwdRing::getParameters() m_identifier = m_iRing; // Set numerology - detectorManager()->numerology().setNumPhiModulesForDiskRing(m_iWheel,m_iRing,m_numModules); + m_detectorManager->numerology().setNumPhiModulesForDiskRing(m_iWheel,m_iRing,m_numModules); } @@ -152,10 +155,9 @@ SCT_FwdRing::preBuild() // 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 << GeoTrf::Translate3D(0, 0, envelopeShift)); - GeoLogVol * ringLog = new GeoLogVol(getName(), &ringEnvelopeShape, materials.gasMaterial()); + GeoLogVol * ringLog = new GeoLogVol(getName(), &ringEnvelopeShape, m_materials->gasMaterial()); return ringLog; } @@ -163,7 +165,7 @@ SCT_FwdRing::preBuild() GeoVPhysVol * -SCT_FwdRing::build(SCT_Identifier id) const +SCT_FwdRing::build(SCT_Identifier id) { // Physical volume for the half ring @@ -235,7 +237,7 @@ SCT_FwdRing::build(SCT_Identifier id) const ring->add(modulePV); // Store alignable transform - detectorManager()->addAlignableTransform(1, id.getWaferId(), moduleTransform, modulePV); + m_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 @@ -280,11 +282,15 @@ SCT_FwdRing::makeModuleServices() // 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); + m_coolingBlockHiMain = new SCT_FwdCoolingBlock("CoolingBlkHiMain",SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::MAIN, + m_detectorManager, m_geometryManager, m_materials); + m_coolingBlockHiSec = new SCT_FwdCoolingBlock("CoolingBlkHiSec", SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::SECONDARY, + m_detectorManager, m_geometryManager, m_materials); // 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); + m_coolingBlockLoMain = new SCT_FwdCoolingBlock("CoolingBlkLoMain",SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::MAIN, + m_detectorManager, m_geometryManager, m_materials); + m_coolingBlockLoSec = new SCT_FwdCoolingBlock("CoolingBlkLoSec", SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::SECONDARY, + m_detectorManager, m_geometryManager, m_materials); double coolingBlkMainR = m_module->mainMountPointRadius(); double coolingBlkSecR = m_module->endModuleRadius(); // This is the end of the module. Align block with the end. @@ -320,15 +326,14 @@ SCT_FwdRing::makeModuleServices() 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()); + const GeoLogVol * moduleServicesHiLog = new GeoLogVol("ModuleServicesHi", moduleServicesHiShape, m_materials->gasMaterial()); + const GeoLogVol * moduleServicesLoLog = new GeoLogVol("ModuleServicesLo", moduleServicesLoShape, m_materials->gasMaterial()); m_moduleServicesHi = new GeoPhysVol(moduleServicesHiLog); m_moduleServicesLo = new GeoPhysVol(moduleServicesLoLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx old mode 100755 new mode 100644 index 4c321aa924e41565c6d3af50cbf3693d16c0ec7d..04bc673355937b0f15d58036d2ff809d723bfa50 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdRingCooling.h" @@ -18,8 +18,12 @@ inline double sqr(double x) {return x*x;} -SCT_FwdRingCooling::SCT_FwdRingCooling(const std::string & name, int ringType) - : SCT_SharedComponentFactory(name), m_ringType(ringType) +SCT_FwdRingCooling::SCT_FwdRingCooling(const std::string & name, int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_ringType(ringType) { getParameters(); m_physVolume = build(); @@ -29,7 +33,7 @@ SCT_FwdRingCooling::SCT_FwdRingCooling(const std::string & name, int ringType) void SCT_FwdRingCooling::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName= parameters->fwdRingCoolingMaterial(m_ringType); m_innerRadius = parameters->fwdRingCoolingInnerRadius(m_ringType); @@ -41,10 +45,8 @@ SCT_FwdRingCooling::getParameters() 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()); + m_material = m_materials->getMaterialForVolume(m_materialName, ringCoolingShape->volume()); const GeoLogVol * ringCoolingLog = new GeoLogVol(getName(), ringCoolingShape, m_material); GeoPhysVol * ringCooling = new GeoPhysVol(ringCoolingLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx old mode 100755 new mode 100644 index c8cd1d7aa2eb08f2ce1bb6d2c5a7d4cd466683df..1f47acf4994bda792cbccf3470d26e4b293aae1a --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////// @@ -47,8 +47,13 @@ using namespace InDetDD; SCT_FwdSensor::SCT_FwdSensor(const std::string & name, - int ringType) - : SCT_UniqueComponentFactory(name), m_ringType(ringType) + int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), + m_ringType{ringType}, + m_noElementWarning{true} { getParameters(); m_logVolume = preBuild(); @@ -62,15 +67,14 @@ void SCT_FwdSensor::getParameters() { - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); - SCT_MaterialManager materials; + const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); - m_materialSensor = materials.getMaterial(parameters->fwdSensorMaterialFar(m_ringType)); + m_materialSensor = m_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_materialGlass = m_materials->getMaterial(parameters->fwdSensorMaterialNear(m_ringType)); } m_thicknessN = m_thicknessF = parameters->fwdSensorThickness(m_ringType); @@ -168,7 +172,7 @@ const GeoLogVol * SCT_FwdSensor::preBuild() // Make the moduleside design for this sensor makeDesign(); - detectorManager()->addDesign(m_design); + m_detectorManager->addDesign(m_design); return sensorLog; } @@ -225,7 +229,7 @@ void SCT_FwdSensor::makeDesign() // eta coordinate of crystal center // phi coordinate of crystal center - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); double radius1=0; double radius2=0; @@ -306,7 +310,7 @@ void SCT_FwdSensor::makeDesign() -GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id) const +GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id) { GeoFullPhysVol * sensor = new GeoFullPhysVol(m_logVolume); @@ -315,7 +319,7 @@ GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id) const // Only do so if we have a valid id helper. //id.print(); // for debugging only - SiCommonItems* commonItems = geometryManager()->commonItems(); + const SiCommonItems* commonItems = m_geometryManager->commonItems(); if (commonItems->getIdHelper()) { @@ -325,13 +329,12 @@ GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id) const commonItems); // Add the detector element. - detectorManager()->addDetectorElement(detElement); + m_detectorManager->addDetectorElement(detElement); } else { - static bool noElementWarning = true; // So we don't get the message thousands of times. - if (noElementWarning) { + if (m_noElementWarning) { std::cout << "WARNING!!!!: No SCT id helper and so no elements being produced." << std::endl; - noElementWarning = false; + m_noElementWarning = false; } } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx old mode 100755 new mode 100644 index 6c6f13e57d7c97994394c4e5ce1405c1373e2f74..128c2418ab294c51d78b3d7ff52b5f22589e2cce --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////// @@ -30,19 +30,21 @@ #include <cmath> SCT_FwdSpine::SCT_FwdSpine(const std::string & name, - int ringType) - : SCT_SharedComponentFactory(name), m_ringType(ringType) + int ringType, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_ringType(ringType) { getParameters(); m_physVolume = build(); } - - void SCT_FwdSpine::getParameters() { - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); m_materialName = parameters->fwdSpineMaterial(m_ringType); @@ -91,10 +93,8 @@ SCT_FwdSpine::build() //position = position / 2. * HybPos; - SCT_MaterialManager materials; - const GeoShape & spinePosMain = (*spineShapeMain << GeoTrf::TranslateZ3D(position) ); - m_material = materials.getMaterialForVolume(m_materialName, spineShapeMain->volume()); + m_material = m_materials->getMaterialForVolume(m_materialName, spineShapeMain->volume()); GeoLogVol * spineLog = new GeoLogVol(getName(), &spinePosMain, m_material); GeoPhysVol * spine = new GeoPhysVol(spineLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx old mode 100755 new mode 100644 index 20b6b3db60229ba902f8649e3b3512e457d2eb4c..8a547d3e722fd3934540d92b5c7d46d73a01b32c --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////// @@ -35,8 +35,12 @@ SCT_FwdSubSpine::SCT_FwdSubSpine(const std::string & name, - int ringType, int spineSide) - : SCT_SharedComponentFactory(name), m_ringType(ringType), m_spineSide(spineSide) + int ringType, int spineSide, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_ringType(ringType), m_spineSide(spineSide) { getParameters(); m_physVolume = build(); @@ -47,10 +51,9 @@ SCT_FwdSubSpine::SCT_FwdSubSpine(const std::string & name, void SCT_FwdSubSpine::getParameters() { - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); - SCT_MaterialManager materials; + const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); - m_material = materials.getMaterial(parameters->fwdSubSpineMaterial(m_ringType)); + m_material = m_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) @@ -73,7 +76,7 @@ GeoVPhysVol * SCT_FwdSubSpine::build() { // x,y,z are in the geomodel module coordinates - const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters(); + const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters(); const GeoBox * spineShape1 = new GeoBox( m_thickness1/2., m_width1/2., m_length1/2.); const GeoBox * spineShape2 = 0; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx old mode 100755 new mode 100644 index cdac143bd99834bcc32bb06244b739f056eb32f0..3bb364e71c397fabf7cf5d5f976364f1386ee401 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdSupportFrame.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/Units.h" -SCT_FwdSupportFrame::SCT_FwdSupportFrame(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_FwdSupportFrame::SCT_FwdSupportFrame(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -26,7 +29,7 @@ SCT_FwdSupportFrame::SCT_FwdSupportFrame(const std::string & name) void SCT_FwdSupportFrame::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName = parameters->fwdSupportFrameMaterial(); m_thickness = parameters->fwdSupportFrameRadialThickness(); @@ -42,12 +45,10 @@ SCT_FwdSupportFrame::getParameters() 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);} + m_material = m_materials->getMaterialForVolume(m_materialName, supportFrameShape->volume()); + if(!m_material) m_material = m_materials->getMaterial(m_materialName); const GeoLogVol * supportFrameLog = new GeoLogVol(getName(), supportFrameShape, m_material); GeoPhysVol * supportFrame = new GeoPhysVol(supportFrameLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx old mode 100755 new mode 100644 index d956aca563facace248629163cb2cc25c90caa18..dceaa95de3a20c7d7dcacdebd009b182e2e452d0 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdThermalShieldElement.h" @@ -16,8 +16,12 @@ #include <cmath> -SCT_FwdThermalShieldElement::SCT_FwdThermalShieldElement(const std::string & name, int iElement) - : SCT_SharedComponentFactory(name), m_iElement(iElement) +SCT_FwdThermalShieldElement::SCT_FwdThermalShieldElement(const std::string & name, int iElement, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_iElement(iElement) { getParameters(); m_physVolume = build(); @@ -27,7 +31,7 @@ SCT_FwdThermalShieldElement::SCT_FwdThermalShieldElement(const std::string & nam void SCT_FwdThermalShieldElement::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); m_materialName = parameters->fwdThermalShieldMaterial(m_iElement); m_innerRadius = parameters->fwdThermalShieldInnerRadius(m_iElement); @@ -42,12 +46,10 @@ SCT_FwdThermalShieldElement::getParameters() 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);} + m_material = m_materials->getMaterialForVolume(m_materialName, elementShape->volume()); + if (!m_material) m_material = m_materials->getMaterial(m_materialName); const GeoLogVol * elementLog = new GeoLogVol(getName(), elementShape, m_material); GeoPhysVol * element = new GeoPhysVol(elementLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx old mode 100755 new mode 100644 index a8df7a8d0623536f9115c4109e9a7f963ef76d2d..24f8b07c1639e94d94a123930709b79ae69621c3 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_FwdWheel.h" @@ -49,9 +49,12 @@ 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), + const std::vector<SCT_FwdModule *> & modules, + int ec, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), m_iWheel(iWheel), m_endcap(ec), m_pPConnector(0), @@ -87,8 +90,8 @@ SCT_FwdWheel::~SCT_FwdWheel() void SCT_FwdWheel::getParameters() { - const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters(); - + const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters(); + m_zPosition = parameters->fwdWheelZPosition(m_iWheel); m_numRings = parameters->fwdWheelNumRings(m_iWheel); for (int iRing = 0; iRing < m_numRings; iRing++) { @@ -134,10 +137,10 @@ SCT_FwdWheel::getParameters() } } - m_safety = geometryManager()->generalParameters()->safety(); + m_safety = m_geometryManager->generalParameters()->safety(); // Set numerology - detectorManager()->numerology().setNumRingsForDisk(m_iWheel,m_numRings); + m_detectorManager->numerology().setNumRingsForDisk(m_iWheel,m_numRings); } @@ -146,28 +149,39 @@ SCT_FwdWheel::preBuild() { // Create disc support. - m_discSupport = new SCT_FwdDiscSupport("DiscSupport"+intToString(m_iWheel), m_iWheel); + m_discSupport = new SCT_FwdDiscSupport("DiscSupport"+intToString(m_iWheel), m_iWheel, + m_detectorManager, m_geometryManager, m_materials); // 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)); + m_rings.push_back(new SCT_FwdRing(ringName, m_modules[ringType], m_iWheel, iRing, m_endcap, + m_detectorManager, m_geometryManager, m_materials)); } // 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)); + m_patchPanel.push_back(new SCT_FwdPatchPanel("PatchPanel"+intToString(iPPType), iPPType, + m_detectorManager, m_geometryManager, m_materials)); } // 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");} - + if (m_pPConnectorPresent) { + m_pPConnector = new SCT_FwdPPConnector("PPConnector", + m_detectorManager, m_geometryManager, m_materials); + } + if (m_pPCoolingPresent) { + m_pPCooling = new SCT_FwdPPCooling("PPCooling", + m_detectorManager, m_geometryManager, m_materials); + } + if (m_discFixationPresent) { + m_discFixation = new SCT_FwdDiscFixation("DiscFixation", + m_detectorManager, m_geometryManager, m_materials); + } // Calculate total number of modules m_totalModules = 0; @@ -181,7 +195,8 @@ SCT_FwdWheel::preBuild() 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); + m_fsiType[type] = new SCT_FwdFSI("FSI"+intToString(type), type, + m_detectorManager, m_geometryManager, m_materials); } } @@ -245,14 +260,12 @@ SCT_FwdWheel::preBuild() // m_thickness = 100 * Gaudi::Units::mm; // 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 << GeoTrf::Translate3D(0, 0, envelopeShift); const GeoLogVol * fwdWheelLog = - new GeoLogVol(getName(), &fwdWheelEnvelopeShape, materials.gasMaterial()); + new GeoLogVol(getName(), &fwdWheelEnvelopeShape, m_materials->gasMaterial()); return fwdWheelLog; @@ -260,7 +273,7 @@ SCT_FwdWheel::preBuild() } GeoVPhysVol * -SCT_FwdWheel::build(SCT_Identifier id) const +SCT_FwdWheel::build(SCT_Identifier id) { GeoFullPhysVol * wheel = new GeoFullPhysVol(m_logVolume); @@ -277,7 +290,7 @@ SCT_FwdWheel::build(SCT_Identifier id) const for (int iRing = 0; iRing < m_numRings; iRing++){ - const SCT_FwdRing * ring = m_rings[iRing]; + SCT_FwdRing * ring = m_rings[iRing]; // Position ring double ringZpos = ring->ringSide() * ring->ringOffset(); @@ -294,7 +307,7 @@ SCT_FwdWheel::build(SCT_Identifier id) const // Position cooling // Get a pointer to the cooling ring. SCT_FwdRingCooling cooling("RingCoolingW"+intToString(m_iWheel)+"R"+intToString(iRing), - iRing); + iRing, m_detectorManager, m_geometryManager, m_materials); double coolingZpos = ring->ringSide() * (0.5*(m_discSupport->thickness() + cooling.thickness())); wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(coolingZpos))); wheel->add(cooling.getVolume()); @@ -302,7 +315,8 @@ SCT_FwdWheel::build(SCT_Identifier id) const // Power Tapes // Get a pointer to the power tape SCT_FwdDiscPowerTape powerTape("PowerTapeW"+intToString(m_iWheel)+ - "R"+intToString(iRing), iRing); + "R"+intToString(iRing), iRing, + m_detectorManager, m_geometryManager, m_materials); double powerTapeZpos = ring->ringSide() * (0.5*(m_discSupport->thickness() + powerTape.thickness()) + cooling.thickness()); @@ -419,7 +433,8 @@ SCT_FwdWheel::build(SCT_Identifier id) const 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); + SCT_FwdOptoHarness optoharness(optoharnessName+"W"+intToString(m_iWheel), m_numRings, + m_detectorManager, m_geometryManager, m_materials); double optoHarnessZpos = 0.5*m_rotateWheel*(m_discSupport->thickness() + optoharness.thickness()); wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(optoHarnessZpos))); wheel->add(optoharness.getVolume()); @@ -488,7 +503,7 @@ SCT_FwdWheel::build(SCT_Identifier id) const // Extra Material - InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager()); + InDetDD::ExtraMaterial xMat(m_geometryManager->distortedMatManager()); xMat.add(wheel, "SCTDisc"); xMat.add(wheel, "SCTDisc"+intToString(m_iWheel)); if (m_endcap > 0) { diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx old mode 100755 new mode 100644 index cd861f5e53325c686e460e3f88f98c6b1a284258..bfc74c74349c2c41d15e7dece87b2ba79120dd9c --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_GeneralParameters.h" @@ -14,9 +14,9 @@ const double SCT_SAFETY = 0.01 * Gaudi::Units::mm; // Used in some places to mak // no overlaps due to rounding errors. -SCT_GeneralParameters::SCT_GeneralParameters() +SCT_GeneralParameters::SCT_GeneralParameters(SCT_DataBase* rdb) { - m_rdb = SCT_DataBase::instance(); + m_rdb = rdb; m_placements = new TopLevelPlacements(m_rdb->topLevelTable()); } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx old mode 100755 new mode 100644 index febbf924122612566045b6c700a58a8096573c9d..1b30a9a0adc4d3e78610469bf0fbe11f5bebfbe7 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx @@ -1,37 +1,37 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_GeometryManager.h" +#include "InDetGeoModelUtils/DistortedMaterialManager.h" +#include "InDetIdentifier/SCT_ID.h" +#include "InDetReadoutGeometry/SiCommonItems.h" #include "SCT_GeoModel/SCT_BarrelParameters.h" #include "SCT_GeoModel/SCT_BarrelModuleParameters.h" +#include "SCT_GeoModel/SCT_DataBase.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(SCT_DataBase* rdb) + : m_athenaComps{rdb->athenaComps()}, + m_rdb{rdb} +{ + // This class uses reference counting. Should not be delete'd in destructor. + m_commonItems = new InDetDD::SiCommonItems(m_athenaComps->getIdHelper()); + + m_barrelParameters = std::make_unique<SCT_BarrelParameters>(m_rdb); + m_barrelModuleParameters = std::make_unique<SCT_BarrelModuleParameters>(m_rdb); + m_forwardParameters = std::make_unique<SCT_ForwardParameters>(m_rdb); + m_forwardModuleParameters = std::make_unique<SCT_ForwardModuleParameters>(m_rdb); + m_generalParameters = std::make_unique<SCT_GeneralParameters>(m_rdb); + m_distortedMatManager = std::make_unique<InDetDD::DistortedMaterialManager>(); +} SCT_GeometryManager::~SCT_GeometryManager() { - delete m_barrelParameters; - delete m_barrelModuleParameters; - delete m_forwardParameters; - delete m_forwardModuleParameters; - delete m_generalParameters; - delete m_distortedMatManager; } // @@ -55,81 +55,53 @@ 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 * +const 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; + return m_barrelParameters.get(); } const SCT_BarrelModuleParameters * SCT_GeometryManager::barrelModuleParameters() const { - if (!m_barrelModuleParameters) { - m_barrelModuleParameters = new SCT_BarrelModuleParameters; - } - return m_barrelModuleParameters; + return m_barrelModuleParameters.get(); } const SCT_ForwardModuleParameters * SCT_GeometryManager::forwardModuleParameters() const { - if (!m_forwardModuleParameters) { - m_forwardModuleParameters = new SCT_ForwardModuleParameters; - } - return m_forwardModuleParameters; + return m_forwardModuleParameters.get(); } const SCT_ForwardParameters * SCT_GeometryManager::forwardParameters() const { - if (!m_forwardParameters) { - m_forwardParameters = new SCT_ForwardParameters; - } - return m_forwardParameters; + return m_forwardParameters.get(); } const SCT_GeneralParameters * SCT_GeometryManager::generalParameters() const { - if (!m_generalParameters) m_generalParameters = new SCT_GeneralParameters; - return m_generalParameters; + return m_generalParameters.get(); } const InDetDD::DistortedMaterialManager * SCT_GeometryManager::distortedMatManager() const { - if (!m_distortedMatManager) m_distortedMatManager = new InDetDD::DistortedMaterialManager; - return m_distortedMatManager; + return m_distortedMatManager.get(); } SCT_GeometryManager& @@ -138,12 +110,13 @@ SCT_GeometryManager::operator=(const SCT_GeometryManager& right) { m_options = right.m_options; m_athenaComps = right.m_athenaComps; m_commonItems = right.m_commonItems; - m_barrelParameters = nullptr; - m_barrelModuleParameters = nullptr; - m_forwardParameters = nullptr; - m_forwardModuleParameters = nullptr; - m_generalParameters = nullptr; - m_distortedMatManager = nullptr; + m_rdb = right.m_rdb; + m_barrelParameters.reset(new SCT_BarrelParameters(m_rdb)); + m_barrelModuleParameters.reset(new SCT_BarrelModuleParameters(m_rdb)); + m_forwardParameters.reset(new SCT_ForwardParameters(m_rdb)); + m_forwardModuleParameters.reset(new SCT_ForwardModuleParameters(m_rdb)); + m_generalParameters.reset(new SCT_GeneralParameters(m_rdb)); + m_distortedMatManager.reset(new InDetDD::DistortedMaterialManager()); } return *this; } @@ -152,10 +125,11 @@ SCT_GeometryManager::SCT_GeometryManager(const SCT_GeometryManager& right) { m_options = right.m_options; m_athenaComps = right.m_athenaComps; m_commonItems = right.m_commonItems; - m_barrelParameters = nullptr; - m_barrelModuleParameters = nullptr; - m_forwardParameters = nullptr; - m_forwardModuleParameters = nullptr; - m_generalParameters = nullptr; - m_distortedMatManager = nullptr; + m_rdb = right.m_rdb; + m_barrelParameters.reset(new SCT_BarrelParameters(m_rdb)); + m_barrelModuleParameters.reset(new SCT_BarrelModuleParameters(m_rdb)); + m_forwardParameters.reset(new SCT_ForwardParameters(m_rdb)); + m_forwardModuleParameters.reset(new SCT_ForwardModuleParameters(m_rdb)); + m_generalParameters.reset(new SCT_GeneralParameters(m_rdb)); + m_distortedMatManager.reset(new InDetDD::DistortedMaterialManager()); } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx old mode 100755 new mode 100644 index a713cba01739d2a60d5b374a57cffed8c429912d..1de3ead94e8ecd6c9921db825a116c89a306234b --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Harness.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_Harness::SCT_Harness(const std::string & name, double length) - : SCT_SharedComponentFactory(name), m_length(length) +SCT_Harness::SCT_Harness(const std::string & name, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_length(length) { getParameters(); m_physVolume = build(); @@ -26,8 +30,8 @@ SCT_Harness::SCT_Harness(const std::string & name, double length) void SCT_Harness::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); + m_materialName = parameters->harnessMaterial(); m_thickness = parameters->harnessThickness(); m_width = parameters->harnessWidth(); @@ -38,13 +42,10 @@ 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); + m_material = m_materials->getMaterialForVolume(m_materialName, harnessShape->volume()); + if (!m_material) m_material = m_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 old mode 100755 new mode 100644 index 3572f1656085ffc753ec12284399aec1f029a100..83bb9f309ca6c2ad22aca87059ebde701013f76e --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Hybrid.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_Hybrid::SCT_Hybrid(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_Hybrid::SCT_Hybrid(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManage, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManage, materials) { getParameters(); m_physVolume = build(); @@ -25,10 +28,8 @@ SCT_Hybrid::SCT_Hybrid(const std::string & name) void SCT_Hybrid::getParameters() { - const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); - SCT_MaterialManager materials; - - m_material = materials.getMaterial(parameters->hybridMaterial()); + const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters(); + m_material = m_materials->getMaterial(parameters->hybridMaterial()); m_thickness = parameters->hybridThickness(); m_length = parameters->hybridLength(); m_width = parameters->hybridWidth(); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx old mode 100755 new mode 100644 index 91b846a5f9bd171fc28dd6e6851feff5aa24e17d..ca4fbc14c040a848ea0fa7180d8c84b9ead99036 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Identifier.h" @@ -9,13 +9,11 @@ #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); + assert (m_idHelper); + return m_idHelper->wafer_id(m_barrelEC, m_layerDisk, m_phiModule, m_etaModule, m_side); } void SCT_Identifier::print() diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx old mode 100755 new mode 100644 index c350e121281a8be185265854862f8fc9344cb7dd..cb8168fa07e53a6dc74f05e64f63d97abb588213 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -37,8 +37,11 @@ #include <cmath> -SCT_InnerSide::SCT_InnerSide(const std::string & name) - : SCT_UniqueComponentFactory(name), +SCT_InnerSide::SCT_InnerSide(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), m_hybrid(0), m_sensor(0) { @@ -61,8 +64,8 @@ SCT_InnerSide::~SCT_InnerSide() void SCT_InnerSide::getParameters() { - const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); - const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters(); + const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters(); m_safety = generalParameters->safety(); m_hybridOffsetZ = parameters->hybridOffsetZ(); @@ -73,11 +76,9 @@ SCT_InnerSide::getParameters() const GeoLogVol * SCT_InnerSide::preBuild() { - SCT_MaterialManager materials; - // Create child components - m_sensor = new SCT_Sensor("BRLSensor"); - m_hybrid = new SCT_Hybrid("Hybrid"); + m_sensor = new SCT_Sensor("BRLSensor", m_detectorManager, m_geometryManager, m_materials); + m_hybrid = new SCT_Hybrid("Hybrid", m_detectorManager, m_geometryManager, m_materials); // // Define constants for convenience. @@ -163,7 +164,7 @@ SCT_InnerSide::preBuild() const GeoLogVol * InnerSideEnvelopeLog = new GeoLogVol("InnerSideEnvelope", &InnerSideEnvelopeShape, - materials.gasMaterial()); + m_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; @@ -178,7 +179,7 @@ SCT_InnerSide::preBuild() GeoVPhysVol * -SCT_InnerSide::build(SCT_Identifier id) const +SCT_InnerSide::build(SCT_Identifier id) { GeoFullPhysVol * innerSide = new GeoFullPhysVol(m_logVolume); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx old mode 100755 new mode 100644 index d30351c0efc8830695fc7d7b123a3a799379ab36..a5cd9cfadbc462421e7ee0254975b73ad5c4c501 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_InterLink.h" @@ -16,8 +16,11 @@ #include "GeoModelKernel/GeoTransform.h" #include "GaudiKernel/SystemOfUnits.h" -SCT_InterLink::SCT_InterLink(const std::string & name) - : SCT_SharedComponentFactory(name), +SCT_InterLink::SCT_InterLink(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), m_interLinkShape(nullptr), m_interLinkLog(nullptr), m_interLink(nullptr), @@ -45,7 +48,7 @@ SCT_InterLink::~SCT_InterLink() { void SCT_InterLink::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); // Interlink parameters m_materialName = parameters->interLinkMaterial(); @@ -86,14 +89,11 @@ GeoVPhysVol * SCT_InterLink::build() { // Make the interlink. - - SCT_MaterialManager materials; - if(m_nRepeat == 1) { // For old geometry interlink is a simple tube of material m_interLinkShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5*m_length); - const GeoMaterial* material = materials.getMaterialForVolume(m_materialName, m_interLinkShape->volume()); - if(!material) {material = materials.getMaterial(m_materialName);} + const GeoMaterial* material = m_materials->getMaterialForVolume(m_materialName, m_interLinkShape->volume()); + if(!material) {material = m_materials->getMaterial(m_materialName);} m_interLinkLog = new GeoLogVol(getName(), m_interLinkShape, material); m_interLink = new GeoPhysVol(m_interLinkLog); m_interLink->ref(); @@ -104,13 +104,13 @@ SCT_InterLink::build() // And also include FSI flange segments if defined // Air tube: m_interLinkShape = new GeoTube(m_innerRadius, m_outerRadiusBearing, 0.5*m_length); - m_interLinkLog = new GeoLogVol(getName(), m_interLinkShape, materials.gasMaterial()); + m_interLinkLog = new GeoLogVol(getName(), m_interLinkShape, m_materials->gasMaterial()); m_interLink = new GeoPhysVol(m_interLinkLog); m_interLink->ref(); // Interlink segments: m_interLinkSegShape = new GeoTubs(m_innerRadius, m_outerRadius, 0.5*m_length, - 0.5*m_dPhi*Gaudi::Units::radian, m_dPhi*Gaudi::Units::radian); - m_interLinkSegLog = new GeoLogVol("InterlinkSegment", m_interLinkSegShape, materials.getMaterialForVolume(m_materialName, m_interLinkSegShape->volume())); + m_interLinkSegLog = new GeoLogVol("InterlinkSegment", m_interLinkSegShape, m_materials->getMaterialForVolume(m_materialName, m_interLinkSegShape->volume())); m_interLinkSeg = new GeoPhysVol(m_interLinkSegLog); m_interLinkSeg->ref(); @@ -124,7 +124,7 @@ SCT_InterLink::build() // B6 bearings m_bearingShape = new GeoTubs(m_innerRadiusBearing, m_outerRadiusBearing, 0.5*m_lengthBearing, - 0.5*m_dPhiBearing*Gaudi::Units::radian, m_dPhiBearing*Gaudi::Units::radian); - m_bearingLog = new GeoLogVol("Bearing", m_bearingShape, materials.getMaterialForVolume(m_materialNameBearing, m_bearingShape->volume())); + m_bearingLog = new GeoLogVol("Bearing", m_bearingShape, m_materials->getMaterialForVolume(m_materialNameBearing, m_bearingShape->volume())); m_bearing = new GeoPhysVol(m_bearingLog); m_bearing->ref(); @@ -141,7 +141,7 @@ SCT_InterLink::build() if(m_includeFSIFlange) { double dPhiFSI = (360./m_nRepeat)*Gaudi::Units::deg - m_dPhi; m_FSIFlangeShape = new GeoTubs(m_innerRadiusFSIFlange, m_outerRadiusFSIFlange, 0.5*m_length, - 0.5*dPhiFSI*Gaudi::Units::radian, dPhiFSI*Gaudi::Units::radian); - m_FSIFlangeLog = new GeoLogVol("FSIFlangeSegment", m_FSIFlangeShape, materials.getMaterialForVolume(m_materialNameFSIFlange, m_FSIFlangeShape->volume())); + m_FSIFlangeLog = new GeoLogVol("FSIFlangeSegment", m_FSIFlangeShape, m_materials->getMaterialForVolume(m_materialNameFSIFlange, m_FSIFlangeShape->volume())); m_FSIFlange = new GeoPhysVol(m_FSIFlangeLog); m_FSIFlange->ref(); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx old mode 100755 new mode 100644 index 451ca68a6f01989e7fc82434222c8f2dfa5a2dc7..f30d0a0b3717e779740b4510bf64585b4dee9bf4 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -49,8 +49,11 @@ 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), + SCT_Module * module, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), m_iLayer(iLayer), m_module(module) { @@ -69,7 +72,7 @@ SCT_Layer::~SCT_Layer() delete m_skiAux; delete m_skiPowerTape; delete m_supportCyl; - if(m_includeFSI) { + if (m_includeFSI) { delete m_endJewel; delete m_scorpion; delete m_fibreMask; @@ -79,8 +82,8 @@ SCT_Layer::~SCT_Layer() void SCT_Layer::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); + const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters(); m_safety = generalParameters->safety(); m_radius = parameters->radius(m_iLayer); @@ -95,7 +98,7 @@ SCT_Layer::getParameters() m_cylinderLength = parameters->cylinderLength(); m_includeFSI = parameters->includeFSI(); - if(m_includeFSI) { + if (m_includeFSI) { m_nRepeatEndJewel = parameters->fsiEndJewelNRepeat(m_iLayer); m_phiEndJewel = parameters->fsiEndJewelPhi(m_iLayer); m_zEndJewel = parameters->fsiEndJewelZ(m_iLayer); @@ -105,8 +108,8 @@ SCT_Layer::getParameters() } // Set numerology - detectorManager()->numerology().setNumPhiModulesForLayer(m_iLayer,m_skisPerLayer); - detectorManager()->numerology().setNumEtaModulesForLayer(m_iLayer,parameters->modulesPerSki()); + m_detectorManager->numerology().setNumPhiModulesForLayer(m_iLayer,m_skisPerLayer); + m_detectorManager->numerology().setNumEtaModulesForLayer(m_iLayer,parameters->modulesPerSki()); } @@ -120,30 +123,32 @@ SCT_Layer::preBuild() std::string layerNumStr = intToString(m_iLayer); // Build the Flanges - m_flange = new SCT_Flange("Flange"+layerNumStr, m_iLayer); + m_flange = new SCT_Flange("Flange"+layerNumStr, m_iLayer, m_detectorManager, m_geometryManager, m_materials); // Build the SupportCyl - m_supportCyl = new SCT_SupportCyl("SupportCyl"+layerNumStr, m_iLayer, m_cylinderLength); + m_supportCyl = new SCT_SupportCyl("SupportCyl"+layerNumStr, m_iLayer, m_cylinderLength, + m_detectorManager, m_geometryManager, m_materials); // 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); + if (m_includeFSI) { + m_endJewel = new SCT_FSIEndJewel("FSIEndJewel"+layerNumStr, m_detectorManager, m_geometryManager, m_materials); + m_scorpion = new SCT_FSIScorpion("FSIScorpion"+layerNumStr, m_detectorManager, m_geometryManager, m_materials); double length_mask = 0.5*m_cylinderLength - m_flange->length() - m_zScorpion - 0.5*m_scorpion->length(); - m_fibreMask = new SCT_FSIFibreMask("FSIFibreMask"+layerNumStr, m_iLayer, length_mask); + m_fibreMask = new SCT_FSIFibreMask("FSIFibreMask"+layerNumStr, m_iLayer, length_mask, + m_detectorManager, m_geometryManager, m_materials); } else { - m_endJewel = 0; - m_scorpion = 0; - m_fibreMask = 0; + m_endJewel = nullptr; + m_scorpion = nullptr; + m_fibreMask = nullptr; } // // Calculations for making active layer components - called ski. // This is the modules + doglegs + cooling blocks + coolingpipe // - double divisionAngle = 360 * Gaudi::Units::degree / m_skisPerLayer; + double divisionAngle = 360. * Gaudi::Units::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. @@ -155,7 +160,8 @@ SCT_Layer::preBuild() // 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); + m_ski = new SCT_Ski("Ski"+layerNumStr, m_module, m_stereoSign, m_tilt, m_activeLength, + m_detectorManager, m_geometryManager, m_materials); // // Make SkiAux - This is the brackets, harness and power tape. @@ -163,10 +169,12 @@ SCT_Layer::preBuild() // 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_bracket = new SCT_Bracket("Bracket"+layerNumStr, m_detectorManager, m_geometryManager, m_materials); - m_harness = new SCT_Harness("Harness"+layerNumStr, m_cylinderLength); - m_skiPowerTape = new SCT_SkiPowerTape("SkiPowerTape"+layerNumStr, m_ski, m_cylinderLength); + m_harness = new SCT_Harness("Harness"+layerNumStr, m_cylinderLength, + m_detectorManager, m_geometryManager, m_materials); + m_skiPowerTape = new SCT_SkiPowerTape("SkiPowerTape"+layerNumStr, m_ski, m_cylinderLength, + m_detectorManager, m_geometryManager, m_materials); int tiltSign = (m_tilt < 0) ? -1 : +1; @@ -185,17 +193,22 @@ SCT_Layer::preBuild() m_outerRadiusOfSupport, bracketOffset, powerTapeOffset, - divisionAngle); + divisionAngle, + m_detectorManager, + m_geometryManager, + m_materials); // 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()); + m_clamp = new SCT_Clamp("Clamp"+layerNumStr, m_iLayer, m_skiAux->outerRadius(), + m_detectorManager, m_geometryManager, m_materials); // 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*Gaudi::Units::mm; double coolingLength = 0.5*m_cylinderLength - 0.5*m_activeLength - clearance; - m_coolingEnd = new SCT_CoolingEnd("CoolingEnd"+layerNumStr, m_iLayer, coolingInnerRadius, coolingLength); + m_coolingEnd = new SCT_CoolingEnd("CoolingEnd"+layerNumStr, m_iLayer, coolingInnerRadius, coolingLength, + m_detectorManager, m_geometryManager, m_materials); // // Calculate the envelopes. @@ -235,13 +248,12 @@ SCT_Layer::preBuild() // // 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); - GeoLogVol * layerLog = new GeoLogVol(getName(), layerEnvelopeTube, materials.gasMaterial()); + GeoLogVol * layerLog = new GeoLogVol(getName(), layerEnvelopeTube, m_materials->gasMaterial()); // Check for overlap. @@ -253,11 +265,8 @@ SCT_Layer::preBuild() } GeoVPhysVol * -SCT_Layer::build(SCT_Identifier id) const +SCT_Layer::build(SCT_Identifier id) { - - SCT_MaterialManager materials; - // We make this a fullPhysVol for alignment code. GeoFullPhysVol * layer = new GeoFullPhysVol(m_logVolume); @@ -269,7 +278,7 @@ SCT_Layer::build(SCT_Identifier id) const // Make envelope for active layer // const GeoTube * activeLayerEnvelopeShape = new GeoTube(m_innerRadiusActive, m_outerRadiusActive, 0.5 * m_cylinderLength); - GeoLogVol * activeLayerLog = new GeoLogVol(getName()+"Active", activeLayerEnvelopeShape, materials.gasMaterial()); + GeoLogVol * activeLayerLog = new GeoLogVol(getName()+"Active", activeLayerEnvelopeShape, m_materials->gasMaterial()); GeoPhysVol * activeLayer = new GeoPhysVol(activeLayerLog); for (int iSki = 0; iSki < m_skisPerLayer; iSki++){ @@ -311,7 +320,7 @@ SCT_Layer::build(SCT_Identifier id) const // 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()); + GeoLogVol * auxLayerLog = new GeoLogVol(getName()+"Aux", auxLayerEnvelopeShape, m_materials->gasMaterial()); GeoPhysVol * auxLayer = new GeoPhysVol(auxLayerLog); for (int iSki = 0; iSki < m_skisPerLayer; iSki++){ @@ -331,7 +340,7 @@ SCT_Layer::build(SCT_Identifier id) const // const GeoTube * supportLayerTube = new GeoTube(m_innerRadius, m_outerRadiusOfSupport, 0.5 * m_cylinderLength); GeoLogVol * supportLayerLog = new GeoLogVol(getName()+"Support", supportLayerTube, - materials.gasMaterial()); + m_materials->gasMaterial()); GeoPhysVol * supportLayer = new GeoPhysVol(supportLayerLog); // Position flanges. One at each end. @@ -374,7 +383,7 @@ SCT_Layer::build(SCT_Identifier id) const } // Extra Material - InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager()); + InDetDD::ExtraMaterial xMat(m_geometryManager->distortedMatManager()); xMat.add(supportLayer, "SCTLayer"+intToString(m_iLayer)); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx old mode 100755 new mode 100644 index b36f72e11de383f19901a7c8d8cd5a6b35985725..101cf3e67c2f4bc2b48301ec930dad0013a1d6ed --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx @@ -3,7 +3,6 @@ */ #include "SCT_GeoModel/SCT_MaterialManager.h" -#include "InDetGeoModelUtils/InDetMaterialManager.h" #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/GeoElement.h" #include "SCT_GeoModel/SCT_DataBase.h" @@ -15,46 +14,27 @@ #include <iostream> -InDetMaterialManager * SCT_MaterialManager::s_materialManager = 0; -const GeoMaterial * SCT_MaterialManager::s_gasMaterial = 0; - // Constructor -SCT_MaterialManager::SCT_MaterialManager() +SCT_MaterialManager::SCT_MaterialManager(SCT_DataBase* db) { - // 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", rdb->athenaComps()); - s_materialManager->addWeightTable(rdb->weightTable(), "sct"); - s_materialManager->addScalingTable(rdb->scalingTable()); - - loadMaterials(); + // Get my material manager. + 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; } - if (!s_gasMaterial) { - s_gasMaterial = s_materialManager->getMaterial("std::Air"); - } + m_materialManager = std::make_unique<InDetMaterialManager>("SCT_MaterialManager", db->athenaComps()); + m_materialManager->addWeightTable(db->weightTable(), "sct"); + m_materialManager->addScalingTable(db->scalingTable()); -} + loadMaterials(); -void -SCT_MaterialManager::reinit() -{ - s_gasMaterial = 0; - delete s_materialManager; - s_materialManager = 0; + m_gasMaterial = m_materialManager->getMaterial("std::Air"); } - // Add materials not yet in the database void SCT_MaterialManager::loadMaterials() @@ -64,19 +44,19 @@ SCT_MaterialManager::loadMaterials() const GeoElement* SCT_MaterialManager::getElement(const std::string & elementName) const { - return s_materialManager->getElement(elementName); + return m_materialManager->getElement(elementName); } const GeoMaterial* SCT_MaterialManager::getMaterial(const std::string & materialName) const { - return s_materialManager->getMaterial(materialName); + return m_materialManager->getMaterial(materialName); } void SCT_MaterialManager::addMaterial(GeoMaterial* material) { - return s_materialManager->addMaterial(material); + return m_materialManager->addMaterial(material); } const GeoMaterial* @@ -85,13 +65,13 @@ SCT_MaterialManager::getMaterial(const std::string & originalMaterial, const std::string & newName) { - return s_materialManager->getMaterial(originalMaterial, density, newName); + return m_materialManager->getMaterial(originalMaterial, density, newName); } const GeoMaterial * SCT_MaterialManager::getMaterialForVolume(const std::string & materialName, double volume) { - return s_materialManager->getMaterialForVolume(materialName, volume); + return m_materialManager->getMaterialForVolume(materialName, volume); } @@ -99,21 +79,5 @@ SCT_MaterialManager::getMaterialForVolume(const std::string & materialName, doub const GeoMaterial* SCT_MaterialManager::gasMaterial() const { - return s_gasMaterial; + return m_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 old mode 100755 new mode 100644 index f48ab25d870ed3d8b07f508bee64d91c4fda58ee..22a44d2e87e0a0ace1fb9ae1649be53fcb65d9ba --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Module.h" @@ -39,8 +39,11 @@ #include <cmath> -SCT_Module::SCT_Module(const std::string & name) - : SCT_UniqueComponentFactory(name), +SCT_Module::SCT_Module(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) +: SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), m_innerSide(0), m_outerSide(0), m_baseBoard(0) @@ -58,7 +61,6 @@ SCT_Module::~SCT_Module() 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; @@ -71,10 +73,8 @@ SCT_Module::~SCT_Module() 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. + const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters(); + const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters(); m_safety = generalParameters->safety(); @@ -86,9 +86,6 @@ SCT_Module::getParameters() 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(); } @@ -97,13 +94,10 @@ SCT_Module::getParameters() 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. + m_outerSide = new SCT_OuterSide("OuterSide", m_detectorManager, m_geometryManager, m_materials); + m_baseBoard = new SCT_BaseBoard("BaseBoard", m_detectorManager, m_geometryManager, m_materials); + m_innerSide = new SCT_InnerSide("InnerSide", m_detectorManager, m_geometryManager, m_materials); // // We have 2 envelopes. @@ -307,7 +301,7 @@ SCT_Module::preBuild() add(*envelope2 << GeoTrf::Translate3D(xCenterEnv2, yCenterEnv2, zCenterEnv2)). subtract(*subBox << GeoTrf::Translate3D(xCenterSubBox, yCenterSubBox, zCenterSubBox)); - const GeoLogVol * moduleLog = new GeoLogVol(getName(), &moduleEnvelope, materials.gasMaterial()); + const GeoLogVol * moduleLog = new GeoLogVol(getName(), &moduleEnvelope, m_materials->gasMaterial()); // // inner side @@ -335,7 +329,7 @@ SCT_Module::preBuild() GeoVPhysVol * -SCT_Module::build(SCT_Identifier id) const +SCT_Module::build(SCT_Identifier id) { GeoFullPhysVol * module = new GeoFullPhysVol(m_logVolume); @@ -362,7 +356,7 @@ SCT_Module::build(SCT_Identifier id) const GeoVPhysVol * innerSide = m_innerSide->build(id); module->add(innerSide); // Store alignable transform - detectorManager()->addAlignableTransform(0, innerId, innerTransform, innerSide); + m_detectorManager->addAlignableTransform(0, innerId, innerTransform, innerSide); // Add outerside GeoAlignableTransform * outerTransform = new GeoAlignableTransform(*m_outerSidePos); @@ -375,7 +369,7 @@ SCT_Module::build(SCT_Identifier id) const GeoVPhysVol * outerSide = m_outerSide->build(id); module->add(outerSide); // Store alignable transform - detectorManager()->addAlignableTransform(0, outerId, outerTransform, outerSide); + m_detectorManager->addAlignableTransform(0, outerId, outerTransform, outerSide); return module; } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx old mode 100755 new mode 100644 index 1a4ee321aeba14e8c90aa2d1910caea0616248d3..a2362fda251f39d5e003be8aff9fb2be7956b4f7 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_OuterSide.h" @@ -32,8 +32,11 @@ #include <cmath> -SCT_OuterSide::SCT_OuterSide(const std::string & name) - : SCT_UniqueComponentFactory(name), +SCT_OuterSide::SCT_OuterSide(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), m_hybrid(0), m_pigtail(0), m_sensor(0) @@ -59,8 +62,8 @@ SCT_OuterSide::~SCT_OuterSide() void SCT_OuterSide::getParameters() { - const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); - const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters(); + const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters(); m_safety = generalParameters->safety(); m_hybridOffsetZ = parameters->hybridOffsetZ(); @@ -71,12 +74,10 @@ SCT_OuterSide::getParameters() 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"); + m_sensor = new SCT_Sensor("BRLSensor", m_detectorManager, m_geometryManager, m_materials); + m_hybrid = new SCT_Hybrid("Hybrid", m_detectorManager, m_geometryManager, m_materials); + m_pigtail = new SCT_Pigtail("Pigtail", m_detectorManager, m_geometryManager, m_materials); // // Define constants for convenience. @@ -170,7 +171,7 @@ SCT_OuterSide::preBuild() const GeoLogVol * OuterSideEnvelopeLog = new GeoLogVol("OuterSideEnvelope", &OuterSideEnvelopeShape, - materials.gasMaterial()); + m_materials->gasMaterial()); // 28th Mar S.Mima modified. // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (03)********************************* @@ -186,7 +187,7 @@ SCT_OuterSide::preBuild() GeoVPhysVol * -SCT_OuterSide::build(SCT_Identifier id) const +SCT_OuterSide::build(SCT_Identifier id) { GeoFullPhysVol * outerSide = new GeoFullPhysVol(m_logVolume); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx old mode 100755 new mode 100644 index 11ae5d4618b0ca5ca6ec10a5cdfb2ecffea6c858..74db2bdcec5bcd36578465651a6b03093b2b6acf --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Pigtail.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_Pigtail::SCT_Pigtail(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_Pigtail::SCT_Pigtail(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -25,10 +28,8 @@ SCT_Pigtail::SCT_Pigtail(const std::string & name) void SCT_Pigtail::getParameters() { - const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); - SCT_MaterialManager materials; - - m_material = materials.getMaterial(parameters->pigtailMaterial()); + const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters(); + m_material = m_materials->getMaterial(parameters->pigtailMaterial()); m_thickness = parameters->pigtailThickness(); m_length = parameters->pigtailLength(); m_width = parameters->pigtailWidth(); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx old mode 100755 new mode 100644 index 3d3a11f4aba4a6ca84b395625c2755098b27cede..e8fb7d4e7e3381092d1c64821faa5ee58eb3262c --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_PixelAttachment.h" @@ -17,8 +17,11 @@ // 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) +SCT_PixelAttachment::SCT_PixelAttachment(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -28,10 +31,8 @@ SCT_PixelAttachment::SCT_PixelAttachment(const std::string & name) void SCT_PixelAttachment::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - SCT_MaterialManager materials; - - m_material = materials.getMaterial(parameters->pixelAttachmentMaterial()); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); + m_material = m_materials->getMaterial(parameters->pixelAttachmentMaterial()); m_length = parameters->pixelAttachmentDeltaZ(); m_innerRadius = parameters->pixelAttachmentInnerRadius(); m_outerRadius = parameters->pixelAttachmentOuterRadius(); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx old mode 100755 new mode 100644 index 2449ed9c07c25ed709ab44912f415fa8a96ca3b8..41a3bce1552ad695308d2b7a3ca66077663cb01d --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_PowerTape.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/GeoMaterial.h" #include "GeoModelKernel/Units.h" -SCT_PowerTape::SCT_PowerTape(const std::string & name, double length) - : SCT_SharedComponentFactory(name), m_length(length) +SCT_PowerTape::SCT_PowerTape(const std::string & name, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_length(length) { getParameters(); m_physVolume = build(); @@ -26,12 +30,8 @@ SCT_PowerTape::SCT_PowerTape(const std::string & name, double length) 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()); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); + m_material = m_materials->getMaterial(parameters->powerTapeMaterial()); m_thickness = parameters->powerTapeThickness(); m_width = parameters->powerTapeWidth(); } diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx old mode 100755 new mode 100644 index 4a3b15f269e5585be9b93066739a8134f1e1d1ec..b5ae55a5f8418345bebb31f764fcfc0d4b72a68e --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Sensor.h" @@ -24,8 +24,12 @@ using namespace InDetDD; -SCT_Sensor::SCT_Sensor(const std::string & name) - : SCT_UniqueComponentFactory(name) +SCT_Sensor::SCT_Sensor(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), + m_noElementWarning{true} { getParameters(); m_logVolume = preBuild(); @@ -36,10 +40,8 @@ void SCT_Sensor::getParameters() { - const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); - SCT_MaterialManager materials; - - m_material = materials.getMaterial(parameters->sensorMaterial()); + const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters(); + m_material = m_materials->getMaterial(parameters->sensorMaterial()); m_thickness = parameters->sensorThickness(); m_length = 0; if (parameters->sensorNumWafers() == 2) { @@ -62,7 +64,7 @@ SCT_Sensor::preBuild() // Make the moduleside design for this sensor makeDesign(); - detectorManager()->addDesign(m_design); + m_detectorManager->addDesign(m_design); return sensorLog; } @@ -74,8 +76,8 @@ SCT_Sensor::makeDesign() //SiDetectorDesign::Axis etaAxis = SiDetectorDesign::zAxis; //SiDetectorDesign::Axis phiAxis = SiDetectorDesign::yAxis; //SiDetectorDesign::Axis depthAxis = SiDetectorDesign::xAxis; - - const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters(); + + const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters(); double stripPitch = parameters->sensorStripPitch(); double stripLength = parameters->sensorStripLength(); @@ -131,7 +133,7 @@ SCT_Sensor::makeDesign() GeoVPhysVol * -SCT_Sensor::build(SCT_Identifier id) const +SCT_Sensor::build(SCT_Identifier id) { GeoFullPhysVol * sensor = new GeoFullPhysVol(m_logVolume); @@ -140,7 +142,7 @@ SCT_Sensor::build(SCT_Identifier id) const //id.print(); // for debugging only - SiCommonItems* commonItems = geometryManager()->commonItems(); + const SiCommonItems* commonItems = m_geometryManager->commonItems(); if (commonItems->getIdHelper()) { @@ -152,14 +154,12 @@ SCT_Sensor::build(SCT_Identifier id) const commonItems); // Add the detector element. - detectorManager()->addDetectorElement(detElement); + m_detectorManager->addDetectorElement(detElement); } else { - - static bool noElementWarning = true; // So we don't get the message thousands of times. - if (noElementWarning) { + if (m_noElementWarning) { std::cout << "WARNING!!!!: No SCT id helper and so no elements being produced." << std::endl; - noElementWarning = false; + m_noElementWarning = false; } } return sensor; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx old mode 100755 new mode 100644 index bb7405a950f32a2e2742abbdcf79b4b5e43fa499..befcaff00241d42e38c98107e76ebbc56042b0c1 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Ski.h" @@ -35,11 +35,14 @@ #include <cmath> SCT_Ski::SCT_Ski(const std::string & name, - const SCT_Module * module, + SCT_Module * module, int stereoSign, double tilt, - double length) - : SCT_UniqueComponentFactory(name), + double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials), m_stereoSign(stereoSign), m_tilt(tilt), m_length(length), @@ -66,8 +69,8 @@ void SCT_Ski::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); + const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters(); m_safety = generalParameters->safety(); @@ -107,13 +110,11 @@ SCT_Ski::preBuild() // 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); + m_dogleg = new SCT_Dogleg(getName()+"Dogleg", m_detectorManager, m_geometryManager, m_materials); + m_coolingBlock = new SCT_CoolingBlock(getName()+"CoolingBlock", + m_detectorManager, m_geometryManager, m_materials); + m_coolingPipe = new SCT_CoolingPipe(getName()+"CoolingPipe", m_length, + m_detectorManager, m_geometryManager, m_materials); // We need the sign of the tilt in numerous places int tiltSign = (m_tilt < 0) ? -1 : +1; @@ -432,9 +433,7 @@ SCT_Ski::preBuild() add(*envelope2 << GeoTrf::Translate3D(xShift2, yShift2, 0)); skiEnvelopeShape = &tmpShape; - - SCT_MaterialManager materials; - GeoLogVol * skiLog = new GeoLogVol(getName(), skiEnvelopeShape, materials.gasMaterial()); + GeoLogVol * skiLog = new GeoLogVol(getName(), skiEnvelopeShape, m_materials->gasMaterial()); //GeoPhysVol * ski = new GeoPhysVol(skiLog); @@ -467,7 +466,7 @@ SCT_Ski::preBuild() GeoVPhysVol * -SCT_Ski::build(SCT_Identifier id) const +SCT_Ski::build(SCT_Identifier id) { GeoPhysVol * ski = new GeoPhysVol(m_logVolume); @@ -485,7 +484,7 @@ SCT_Ski::build(SCT_Identifier id) const ski->add(modulePV); // Store alignable transform - detectorManager()->addAlignableTransform(1, id.getWaferId(), moduleTransform, modulePV); + m_detectorManager->addAlignableTransform(1, id.getWaferId(), moduleTransform, modulePV); // Add dogleg ski->add(m_refPointTransform); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx old mode 100755 new mode 100644 index 3c3d51e8e56c9e44ed7d03c1a5a033830c420a33..1c3d5213f88c5dc4a867ec30ad6e0965fc32458e --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -38,17 +38,18 @@ calcMinMaxRatioS(double xCenter, double yCenter, 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, + SCT_Ski * ski, + SCT_Bracket * bracket, + SCT_Harness * harness, + SCT_SkiPowerTape * skiPowerTape, double innerRadius, double bracketPhiOffset, double powerTapePhiOffset, - double divisionAngle) : - SCT_SharedComponentFactory(name), + double divisionAngle, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) : + SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), m_innerRadius(innerRadius), m_bracketPhiOffset(bracketPhiOffset), m_powerTapePhiOffset(powerTapePhiOffset), @@ -169,12 +170,10 @@ SCT_SkiAux::build() // 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()); + new GeoLogVol(getName(), skiAuxShape, m_materials->gasMaterial()); GeoPhysVol * skiAux = new GeoPhysVol(skiAuxLog); // std::cout << "SCT_SkiAux: m_sectorStartAngle = " << m_sectorStartAngle // << ", m_sectorAngle = " << m_sectorAngle << std::endl; diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx old mode 100755 new mode 100644 index b28581610c0c471509cd2225b8835e9c4cc07699..a80601666bf24b1a988666369c6b332e49f52b01 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // @@ -33,8 +33,12 @@ SCT_SkiPowerTape::SCT_SkiPowerTape(const std::string & name, const SCT_Ski * ski, - double length) : - SCT_SharedComponentFactory(name), m_length(length), m_ski(ski) + double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) : + SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_length(length), m_ski(ski) { getParameters(); m_physVolume = build(); @@ -43,8 +47,8 @@ SCT_SkiPowerTape::SCT_SkiPowerTape(const std::string & name, void SCT_SkiPowerTape::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); - + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); + // Width is the same as the width of a single powertape. m_powerTapeThickness = parameters->powerTapeThickness(); m_width = parameters->powerTapeWidth(); @@ -70,10 +74,9 @@ SCT_SkiPowerTape::build() // 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()); + new GeoLogVol(getName(), skiPowerTapeShape, m_materials->gasMaterial()); GeoPhysVol * skiPowerTape = new GeoPhysVol(skiPowerTapeLog); // Loop over modules in ski as we need their z positions. @@ -141,9 +144,8 @@ SCT_SkiPowerTape::build() // 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); + SCT_PowerTape powerTape(getName()+"PowerTapeM"+intToString(iModule + 1), tapeLength, + m_detectorManager, m_geometryManager, m_materials); // Calculate x position of tape. This will depend on the module number. // The reference point is the middle of the stack. diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx old mode 100755 new mode 100644 index fc375224b9d69127e7f360237a781f3d254b47ca..9036d97e23f4e3ef17aaa5a741f4cf09e5c13125 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_Spider.h" @@ -15,8 +15,11 @@ #include "GeoModelKernel/Units.h" -SCT_Spider::SCT_Spider(const std::string & name) - : SCT_SharedComponentFactory(name) +SCT_Spider::SCT_Spider(const std::string & name, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials) { getParameters(); m_physVolume = build(); @@ -26,7 +29,7 @@ SCT_Spider::SCT_Spider(const std::string & name) void SCT_Spider::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); m_materialName = parameters->spiderMaterial(); m_length = parameters->spiderDeltaZ(); @@ -38,11 +41,9 @@ 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);} + m_material = m_materials->getMaterialForVolume(m_materialName, spiderShape->volume()); + if (!m_material) m_material = m_materials->getMaterial(m_materialName); const GeoLogVol * spiderLog = new GeoLogVol(getName(), spiderShape, m_material); GeoPhysVol * spider = new GeoPhysVol(spiderLog); diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx old mode 100755 new mode 100644 index a9a81399933d6348d8c07ccf6fe2970f952f50ea..fd26d5b3d23ad5116480b706de96c7ed399d37c9 --- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx +++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_GeoModel/SCT_SupportCyl.h" @@ -15,8 +15,12 @@ #include "GeoModelKernel/Units.h" -SCT_SupportCyl::SCT_SupportCyl(const std::string & name, int iLayer, double length) - : SCT_SharedComponentFactory(name), m_iLayer(iLayer), m_length(length) +SCT_SupportCyl::SCT_SupportCyl(const std::string & name, int iLayer, double length, + InDetDD::SCT_DetectorManager* detectorManager, + const SCT_GeometryManager* geometryManager, + SCT_MaterialManager* materials) + : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials), + m_iLayer(iLayer), m_length(length) { getParameters(); m_physVolume = build(); @@ -26,7 +30,7 @@ SCT_SupportCyl::SCT_SupportCyl(const std::string & name, int iLayer, double leng void SCT_SupportCyl::getParameters() { - const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters(); + const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters(); m_materialName = parameters->supportCylMaterial(m_iLayer); m_innerRadius = parameters->supportCylInnerRadius(m_iLayer); @@ -38,16 +42,12 @@ 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);} + m_material = m_materials->getMaterialForVolume(m_materialName, supportCylShape->volume()); + if (!m_material) m_material = m_materials->getMaterial(m_materialName); const GeoLogVol * supportCylLog = new GeoLogVol(getName(), supportCylShape, m_material); GeoPhysVol * supportCyl = new GeoPhysVol(supportCylLog); return supportCyl; } - -