diff --git a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/SolidStateDetectorElementBase.h b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/SolidStateDetectorElementBase.h index 8ac33b9402e059b3223f626c814ab74c3906ea87..cf13599a12835bfdb45af9223892d09876a7aedf 100644 --- a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/SolidStateDetectorElementBase.h +++ b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/SolidStateDetectorElementBase.h @@ -50,9 +50,8 @@ namespace InDetDD { * * @class SolidStateDetectorElementBase * - * Class to hold geometrical description of a silicon detector element. - * A detector element is a module in the pixels and one side of a module in the SCT. - * This class is shared between the Pixel and SCT detector since there is a lot of commonality. + * Class to hold geometrical description of a solid state detector element. + * This base class is shared between the InnerDetetector/ITk/HGTD since there is a lot of commonality. * * @par Coordinate Frames. * @@ -198,37 +197,6 @@ namespace InDetDD { void setCache(); //@} - /** - * @name Navigation setters - * Non-const methods. - * These are inline methods and set neighbours. - */ - //@{ - void setNextInEta(const SolidStateDetectorElementBase* element); - void setPrevInEta(const SolidStateDetectorElementBase* element); - void setNextInPhi(const SolidStateDetectorElementBase* element); - void setPrevInPhi(const SolidStateDetectorElementBase* element); - /** - * For SCT only - */ - void setOtherSide(const SolidStateDetectorElementBase* element); - //@} - - /** - * @name Navigation - * Inline methods to access neighbours. - */ - //@{ - const SolidStateDetectorElementBase* nextInEta() const; - const SolidStateDetectorElementBase* prevInEta() const; - const SolidStateDetectorElementBase* nextInPhi() const; - const SolidStateDetectorElementBase* prevInPhi() const; - /** - * Useful for SCT only - */ - const SolidStateDetectorElementBase* otherSide() const; - //@} - /** * @name Common items * Inline method @@ -246,11 +214,13 @@ namespace InDetDD { /** * identifier of this detector element (inline) */ + //do these need to be virtual? - they are in 21.9 but I don't see why Identifier identify() const; /** * identifier hash (inline) */ + //do these need to be virtual? - as above IdentifierHash identifyHash() const; /** @@ -283,13 +253,6 @@ namespace InDetDD { * TrkDetElementBase interface (inline) */ virtual const Trk::Surface& surface(const Identifier&) const; - - /** - * Returns the full list of surfaces associated to this detector element - */ - virtual const std::vector<const Trk::Surface*>& surfaces() const; - //@} - /** * @name Transformation */ @@ -322,59 +285,6 @@ namespace InDetDD { const HepGeom::Transform3D recoToHitTransform() const; //@} - /** - * @name Module Frame - * - * Methods to help work with the module frame. - * This is mainly of of use in the SCT where the module frame can - * in general be different from the element frame. It is actully - * defined as the frame of one of the sides (currently the axial - * side), but using these methods one does not need to make any - * assumptions about what the actual frame is. In the following - * methods the local element frame is the local reconstruction - * frame of this element. - */ - //@{ - /** - * Module to global frame transform. - * Includes misalignment. The module frame is defined to be the - * local reconstruction frame of the axial layer in the SCT. For - * the pixel it is the same as the element. - */ - //Not for base - //const Amg::Transform3D& moduleTransform() const; - - /** - * Default module to global frame transform, ie with no misalignment. - * The module frame is defined to be the - * local reconstruction frame of the axial layer in the SCT. For - * the pixel it is the same as the element. - */ - //Not for base - //Amg::Transform3D defModuleTransform() const; - - /** - * Take a transform of the local element frame and return its equivalent in the module frame. - */ - //No for base - //Amg::Transform3D localToModuleFrame(const Amg::Transform3D& localTransform) const; - - /** - * Transformation from local element to module frame. This can be - * used to take a local position in the element frame and transform - * it to a position in the module frame. If one is already in the - * module frame it will return the Identity transform. - */ - //Not for base - //Amg::Transform3D localToModuleTransform() const; - - /** - * Check if the element and module frame are the same. - */ - //Not for base - //bool isModuleFrame() const; - //@} - /** * @name Orientation */ @@ -479,57 +389,6 @@ namespace InDetDD { //@} - /** - * @name Angle - */ - //@{ - /** - * Compute sin(tilt angle) at a given position: - * at center - */ - //Not for base? - //double sinTilt() const; - /** - * at given local position - */ - //Not for base? - //double sinTilt(const Amg::Vector2D& localPos) const; - /** - * at given global position - */ - //Not for base? - //double sinTilt(const HepGeom::Point3D<double>& globalPosition) const; - - /** - * Compute sin(stereo angle) at a given position: at center - */ - //not for base class? - //double sinStereo() const; - /** - * at given local position - */ - //double sinStereo(const Amg::Vector2D& localPos) const; - /** - * at given global position - */ - //double sinStereo(const HepGeom::Point3D<double>& globalPosition) const; - - /** - * Angle of strip in local frame with respect to the etaAxis. - * Zero for all elements except trapezoidal detectors (ie SCT forward modules). - */ - //double sinStereoLocal(const Amg::Vector2D& localPos) const; - /** - * See previous method - */ - //double sinStereoLocal(const HepGeom::Point3D<double>& globalPos) const; - - /** - * Check if it is the stereo side (useful for SCT) - */ - //bool isStereo() const; - - //@} /** * @name Element Extent @@ -564,7 +423,8 @@ namespace InDetDD { /** * access to the local description (inline): */ - const DetectorDesign& design() const; + + virtual const DetectorDesign& design() const; virtual const Trk::SurfaceBounds& bounds() const; /** @@ -607,10 +467,6 @@ namespace InDetDD { */ double etaPitch() const; double phiPitch() const; - /** - * Useful for SCT Forward. - */ - double phiPitch(const Amg::Vector2D& localPosition) const; /** * carrier type for readout. ie holes for SCT and electrons for pixels. inline @@ -634,12 +490,6 @@ namespace InDetDD { * @name Intersection Tests */ //@{ - /** - * Test if near bond gap within tolerances - */ - //Not for base class - //bool nearBondGap(const Amg::Vector2D& localPosition, double etaTol) const; - //bool nearBondGap(const HepGeom::Point3D<double>& globalPosition, double etaTol) const; /** * Test that it is in the active region @@ -701,30 +551,6 @@ namespace InDetDD { */ SiCellId connectedCell(const SiCellId cellId, int number) const; - /** - * If cell is ganged return the id of the other cell which shares the readout - * for this cell, otherwise return an invalid id. - * This is a more convenient (and slightly faster) alternative than - * using the above two methods. - * Only relevant for pixel. For SCT always returns an invalid ID. (inline) - */ - //Not for base - //SiCellId gangedCell(const SiCellId& cellId) const; - - //@} - - /** - * @name Miscellaneous - */ - //@{ - /** - * Special method for SCT to retrieve the two ends of a "strip" - * Returned coordinates are in global frame. - */ - //Not wanted in base class? - //std::pair<Amg::Vector3D,Amg::Vector3D> endsOfStrip(const Amg::Vector2D& position) const; - //@} - private: /** * @name Private Methods @@ -740,13 +566,7 @@ namespace InDetDD { /** * Recalculate cached values. */ - void updateCache() const; - - /** - * Determine m_isStereo variable and m_stereoCacheValid variable. - */ - //Not for base? - //void determineStereo() const; + virtual void updateCache() const; /** * Calculate extent in r,z and phi. The values are cached and there @@ -777,16 +597,6 @@ namespace InDetDD { */ const HepGeom::Transform3D recoToHitTransformImpl() const; - /** - * Private implementation method with no lock at center - */ - //Not for base class - //double sinStereoImpl() const; - /** - * Private implementation method with no lock at given global position - */ - //double sinStereoImpl(const HepGeom::Point3D<double>& globalPosition) const; - /** * Declaring the Message method for further use (inline) */ @@ -820,17 +630,6 @@ namespace InDetDD { mutable std::atomic_bool m_firstTimeBase{true}; mutable std::atomic_bool m_firstTime{true}; - /** - * Since m_isStereo depends on m_otherSide->sinStereo(), a dedicated validity variable is needed. - */ - //Not for base class? - // mutable std::atomic_bool m_stereoCacheValid{false}; - /** - * Since m_surfaces depends on m_otherSide->surface(), a dedicated validity variable is needed. - */ - mutable std::atomic_bool m_surfacesValid{false}; - //@} - /** * @name Mutex guard to update mutable variables in const methods */ @@ -873,21 +672,6 @@ namespace InDetDD { * hash id of this detector element */ IdentifierHash m_idHash{}; - - //not for base class? - //bool m_isPixel{false}; - //bool m_isDBM{false}; - //@} - - /** - * @name Variables set by individual setter methods - */ - //@{ - const SolidStateDetectorElementBase* m_nextInEta{nullptr}; // set by setNextInEta - const SolidStateDetectorElementBase* m_prevInEta{nullptr}; // set by setPrevInEta - const SolidStateDetectorElementBase* m_nextInPhi{nullptr}; // set by setNextInPhi - const SolidStateDetectorElementBase* m_prevInPhi{nullptr}; // set by setPrevInPhi - const SolidStateDetectorElementBase* m_otherSide{nullptr}; // set by setOtherSide //@} /** diff --git a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/SolidStateDetectorElementBase.icc b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/SolidStateDetectorElementBase.icc index 8fbad55c62f4daff882593c3413fc21b8c743054..b5a6d4587b0be2e3876d13587ce498c174755ff3 100644 --- a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/SolidStateDetectorElementBase.icc +++ b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/SolidStateDetectorElementBase.icc @@ -21,56 +21,6 @@ namespace InDetDD { { updateCache(); } - - inline void SolidStateDetectorElementBase::setNextInEta(const SolidStateDetectorElementBase* element) - { - m_nextInEta = element; - } - - inline void SolidStateDetectorElementBase::setPrevInEta(const SolidStateDetectorElementBase* element) - { - m_prevInEta = element; - } - - inline void SolidStateDetectorElementBase::setNextInPhi(const SolidStateDetectorElementBase* element) - { - m_nextInPhi = element; - } - - inline void SolidStateDetectorElementBase::setPrevInPhi(const SolidStateDetectorElementBase* element) - { - m_prevInPhi = element; - } - - inline void SolidStateDetectorElementBase::setOtherSide(const SolidStateDetectorElementBase* element) // For SCT only - { - m_otherSide = element; - } - - inline const SolidStateDetectorElementBase * SolidStateDetectorElementBase::nextInEta() const - { - return m_nextInEta; - } - - inline const SolidStateDetectorElementBase * SolidStateDetectorElementBase::prevInEta() const - { - return m_prevInEta; - } - - inline const SolidStateDetectorElementBase * SolidStateDetectorElementBase::nextInPhi() const - { - return m_nextInPhi; - } - - inline const SolidStateDetectorElementBase * SolidStateDetectorElementBase::prevInPhi() const - { - return m_prevInPhi; - } - - inline const SolidStateDetectorElementBase * SolidStateDetectorElementBase::otherSide() const - { - return m_otherSide; - } inline const SiCommonItems* SolidStateDetectorElementBase::getCommonItems() const { @@ -309,11 +259,6 @@ namespace InDetDD { return m_design->phiPitch(); } - inline double SolidStateDetectorElementBase::phiPitch(const Amg::Vector2D& localPosition) const - { - return m_design->phiPitch(localPosition); - } - inline InDetDD::CarrierType SolidStateDetectorElementBase::carrierType() const { return m_design->carrierType(); diff --git a/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx b/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx index 5747aa12c61acfa3505079acc4b67149f991db3a..12a66908fe430dad6cb702d024fe34801efdcbfc 100644 --- a/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx +++ b/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx @@ -55,26 +55,6 @@ using Trk::distDepth; return *m_surface; } - const std::vector<const Trk::Surface*>& - SolidStateDetectorElementBase::surfaces() const - { - if (!m_surfacesValid) { - std::lock_guard<std::mutex> lock(m_mutex); - if (!m_surfacesValid) { - // get this surface - m_surfaces.push_back(&surface()); - // get the other side surface - if (otherSide()) { - m_surfaces.push_back(&(otherSide()->surface())); - } - } - m_surfacesValid.store(true); - } - - // return the surfaces - return m_surfaces; - } - const GeoTrf::Transform3D& SolidStateDetectorElementBase::transformHit() const { diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt index a3abb437c41332f6858edfc23146fee9c452f1b1..91ba12d0695e5fe6b9e740a11f2e34f9c0767423 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt @@ -13,5 +13,5 @@ atlas_add_library( InDetReadoutGeometry PUBLIC_HEADERS InDetReadoutGeometry INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaKernel AtlasDetDescr CxxUtils GeoPrimitives Identifier GaudiKernel InDetIdentifier TrkDetElementBase TrkSurfaces TrkEventPrimitives StoreGateLib DetDescrConditions InDetCondTools + LINK_LIBRARIES ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaKernel AtlasDetDescr CxxUtils GeoPrimitives Identifier GaudiKernel InDetIdentifier TrkDetElementBase TrkSurfaces TrkEventPrimitives StoreGateLib DetDescrConditions InDetCondTools ReadoutGeometryBase PRIVATE_LINK_LIBRARIES AthenaBaseComps AthenaPoolUtilities IdDictDetDescr GeoModelUtilities ) diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h deleted file mode 100755 index 1ef3a759fa9366e546effdf145a81be318562509..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * SiCommonItems.h - */ - -#ifndef INDETREADOUTGEOMETRY_SICOMMONITEMS_H -#define INDETREADOUTGEOMETRY_SICOMMONITEMS_H - -class AtlasDetectorID; - -/** - * Message Stream Member - */ -#include "AthenaKernel/MsgStreamMember.h" -#include "CxxUtils/checker_macros.h" -#include "InDetCondTools/ISiLorentzAngleTool.h" -#include "GeoPrimitives/GeoPrimitives.h" - - -#include "GaudiKernel/ServiceHandle.h" -#include "CLHEP/Geometry/Transform3D.h" - -#include <mutex> - -namespace InDetDD { - - /** - * @class SiCommonItems - * - * Helper class to concentrate common items, such as the pointer to the IdHelper, - * the lorentzAngle tool or the information about the solenoidal frame. - * - * To be used for Pixel and SCT. - * - * SiCommonItems is owned by SiDetectorManager. - * - * @author: Grant Gorfine - * mondified & maintained: Nick Styles, Andreas Salzburger - */ - - class SiCommonItems - { - - public: - - /** - * Constructor - */ - SiCommonItems(const AtlasDetectorID* const idHelper); - - /** - * @name Getter methods - */ - //@{ - const AtlasDetectorID* getIdHelper() const; - const HepGeom::Transform3D& solenoidFrame() const; - const ISiLorentzAngleTool* lorentzAngleTool() const; - //@} - - /** - * @name Setter methods - */ - //@{ - void setSolenoidFrame(const HepGeom::Transform3D& transform) const; - void setLorentzAngleTool(const ISiLorentzAngleTool* lorentzAngleTool); - //@} - - /** - * @name Message methods - */ - //@{ - /** - * The message method for further use - */ - MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; } - /** - * The method providing Verbosity Level - */ - bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; } - //@} - - private: - - /** - * Message stream member - */ - mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; - - /** - * IdHelper - */ - const AtlasDetectorID* m_idHelper; - - /** - * LorentzAngle tool - */ - const ISiLorentzAngleTool* m_lorentzAngleTool; - - /** - * Solenoidal frame. Guarded by m_mutex - */ - mutable HepGeom::Transform3D m_solenoidFrame ATLAS_THREAD_SAFE; - - /** - * To guard m_solenoidFrame in solenoidFrame() - */ - mutable std::mutex m_mutex; - }; - - - inline const AtlasDetectorID* SiCommonItems::getIdHelper() const - { - return m_idHelper; - } - - - inline const HepGeom::Transform3D & SiCommonItems::solenoidFrame() const - { - std::lock_guard<std::mutex> lock{m_mutex}; - return m_solenoidFrame; - // This reference might be changed by setSolenoidFrame. - // However, it occurrs very rarely. - } - - -} // End namespace InDetDD - -#endif // INDETREADOUTGEOMETRY_SICOMMONITEMSS_H diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorDesign.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorDesign.h index e2c0b26f27a7aa8d45c3f38a1a40ec4b3c950685..fa3279f1f6e8d00ad3f9eab8def66c5e676243ef 100755 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorDesign.h +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorDesign.h @@ -9,14 +9,16 @@ #ifndef INDETREADOUTGEOMETRY_SIDETECTORDESIGN_H #define INDETREADOUTGEOMETRY_SIDETECTORDESIGN_H +//Base class +#include "ReadoutGeometryBase/DetectorDesign.h" // Input/output classes -#include "InDetReadoutGeometry/SiDiodesParameters.h" -#include "InDetReadoutGeometry/InDetDD_Defs.h" +#include "ReadoutGeometryBase/SiDiodesParameters.h" +#include "ReadoutGeometryBase/InDetDD_Defs.h" #include "CLHEP/Geometry/Point3D.h" #include "CLHEP/Geometry/Vector3D.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "GeoPrimitives/GeoPrimitives.h" -#include "InDetDD_Defs.h" +//#include "InDetDD_Defs.h" #include <list> #include <vector> @@ -36,10 +38,6 @@ class SiReadoutCell; class SiLocalPosition; class SiIntersect; -enum DetectorShape { - Box=0, Trapezoid, Annulus,Other -}; - /** @class SiDetectorDesign Base class for the detector design classes for Pixel and SCT. @@ -50,12 +48,7 @@ enum DetectorShape { @author A. Calvet, Grant Gorfine */ -class SiDetectorDesign { -public: - enum Axis { - xAxis=0, yAxis, zAxis - }; - + class SiDetectorDesign : public DetectorDesign { /////////////////////////////////////////////////////////////////// // Public methods: @@ -94,48 +87,20 @@ public: /////////////////////////////////////////////////////////////////// // Const methods: /////////////////////////////////////////////////////////////////// - - /** Test if point is in the active part of the detector with specified tolerances */ - SiIntersect inDetector(const SiLocalPosition &localPosition, double phiTol, - double etaTol) const; + /** Give strip angle in the reco frame */ + virtual double sinStripAngleReco(double phiCoord, double etaCoord) const; /** Test if near bond gap within tolerances, only relevant for SCT. */ virtual bool nearBondGap(const SiLocalPosition &localPosition, double etaTol) const = 0; - /** local axis corresponding to eta direction: */ - Axis etaAxis() const; - - /** local axis corresponding to phi direction: */ - Axis phiAxis() const; - - /** local axis corresponding to depth direction: */ - Axis depthAxis() const; - - bool phiSymmetric() const; - bool etaSymmetric() const; - bool depthSymmetric() const; - - /** ReadoutSide. +1 = postive depth side, -1 = negative depth side. */ - int readoutSide() const; - - /** Override default symmetries to prevent swapping of axes. - NB. Flags can be changed from true to false but not false to true. */ - void setSymmetry(bool phiSymmetric, bool etaSymmetric, bool depthSymmetric); - + /** only relevant for SCT. Return strip1Dim(int strip, int row) if SCT; otherwise -1 */ + virtual int strip1Dim(int strip, int row) const; + /////////////////////////////////////////////////////////////////// // Pure virtual methods: /////////////////////////////////////////////////////////////////// - - /** Returns distance to nearest detector active edge - +ve = inside - -ve = outside */ - virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, - double &etaDist, double &phiDist) const = 0; - - - /** Helper method for stereo angle computation, DEPRECATED */ virtual HepGeom::Vector3D<double> phiMeasureSegment(const SiLocalPosition &position) const = 0; @@ -144,93 +109,10 @@ public: virtual std::pair<SiLocalPosition, SiLocalPosition> endsOfStrip( const SiLocalPosition &position) const = 0; - /** Method to calculate length of a module */ - virtual double length() const = 0; - - /** Method to calculate average width of a module */ - virtual double width() const = 0; - - /** Method to calculate minimum width of a module */ - virtual double minWidth() const = 0; - - /** Method to calculate maximum width of a module */ - virtual double maxWidth() const = 0; - - /** Method which returns thickness of the silicon wafer */ - double thickness() const; - - /** Pitch in phi direction */ - virtual double phiPitch() const = 0; - - /** Pitch in phi direction */ - virtual double phiPitch(const SiLocalPosition &localPosition) const = 0; - - // ** Pitch in eta direction */ - virtual double etaPitch() const = 0; - - /** Return carrier type (ie electrons or holes) */ - InDetDD::CarrierType carrierType() const; - - /** Return true if hit local direction is the same as readout direction. */ - virtual bool swapHitPhiReadoutDirection() const = 0; - virtual bool swapHitEtaReadoutDirection() const = 0; - - /** Shape of element */ - virtual DetectorShape shape() const; - - /** Element boundary */ - virtual const Trk::SurfaceBounds &bounds() const = 0; - - - /////////////////////////////////////////////////////////// - // - // The following will replace existing methods but are not all implemented yet - // - - /** readout or diode id -> position, size */ - virtual SiDiodesParameters parameters(const SiCellId &cellId) const = 0; - - /** readout or diode id -> position. */ - virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const = 0; - - /** number of connected cells. Generally 1 except for ganged pixels which will be 2. - */ - virtual int numberOfConnectedCells(const SiReadoutCellId &readoutId) const = 0; - - /** readout id -> id of connected diodes. - parameter number = 0 will refer to the primary diode and in general the - cell number will be the same. - NB. SiCellId cellId = connectedCell(readoutId, 0) will in general be equivalent to - SiCellId cellId = readoutId */ - virtual SiCellId connectedCell(const SiReadoutCellId &readoutId, - int number) const = 0; - /** If cell is ganged return the id of the other cell which shares the readout for this cell, otherwise return an invalid id. */ virtual SiCellId gangedCell(const SiCellId &cellId) const = 0; - /** diode id -> readout id - NB assignment of a SiReadoutCellId to a SiCellId is allowed so you are can - pass SiReadoutCellId variables to functions expecting a SiCellId. */ - virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const = 0; - - /** position -> id */ - virtual SiReadoutCellId readoutIdOfPosition(const SiLocalPosition &localPos) const = - 0; - - /** position -> id */ - virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const = 0; - - /** Get the neighbouring diodes of a given diode: - Cell for which the neighbours must be found - List of cells which are neighbours of the given one */ - virtual void neighboursOfCell(const SiCellId &cellId, - std::vector<SiCellId> &neighbours) const = 0; - - /** Check if cell is in range. Returns the original cellId if it is in range, - otherwise it returns an invalid id. */ - virtual SiCellId cellIdInRange(const SiCellId &cellId) const = 0; - /////////////////////////////////////////////////////////////////// // Private methods: @@ -238,66 +120,23 @@ public: private: SiDetectorDesign(); - /////////////////////////////////////////////////////////////////// - // Private data: - /////////////////////////////////////////////////////////////////// -private: - Axis m_etaAxis; // !< local axis corresponding to eta direction - Axis m_phiAxis; // !< local axis corresponding to phi direction - Axis m_depthAxis; // !< local axis corresponding to depth direction - double m_thickness; // !< thickness of silicon sensor - InDetDD::CarrierType m_carrierType; // !< carrier type that drifts towards readout - // !< (ie holes fro SCT and electrons for pixel) - bool m_phiSymmetric; - bool m_etaSymmetric; - bool m_depthSymmetric; - - bool m_readoutSidePosDepth; // !< Control which side readout is on. - // !< true = positive Depth Side, false = negative Depth - // Side - // Disallow Copy and assignment; SiDetectorDesign(const SiDetectorDesign &design); SiDetectorDesign &operator = (const SiDetectorDesign &design); + }; /////////////////////////////////////////////////////////////////// // Inline methods: /////////////////////////////////////////////////////////////////// -inline SiDetectorDesign::Axis SiDetectorDesign::etaAxis() const { - return m_etaAxis; -} -inline SiDetectorDesign::Axis SiDetectorDesign::phiAxis() const { - return m_phiAxis; -} - -inline SiDetectorDesign::Axis SiDetectorDesign::depthAxis() const { - return m_depthAxis; -} - -inline double SiDetectorDesign::thickness() const { - return m_thickness; -} - -inline InDetDD::CarrierType SiDetectorDesign::carrierType() const { - return m_carrierType; -} - -inline bool SiDetectorDesign::phiSymmetric() const { - return m_phiSymmetric; -} - -inline bool SiDetectorDesign::etaSymmetric() const { - return m_etaSymmetric; -} - -inline bool SiDetectorDesign::depthSymmetric() const { - return m_depthSymmetric; -} - -inline int SiDetectorDesign::readoutSide() const { - return (m_readoutSidePosDepth) ? +1 : -1; -} + inline double SiDetectorDesign::sinStripAngleReco(double /* x */, double /* y */) const { + return 0.0; // pixel and barrel strip sensors always zero + } + + inline int SiDetectorDesign::strip1Dim(int, int) const{ + return -1.0; + } + } // namespace InDetDD #endif // INDETREADOUTGEOMETRY_SIDETECTORDESIGN_H diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h index 7b143f53de7b84c8bf5184f893186993ab43a66c..f0f0cddd03ca07a5ca913ec96e5d8c81f9d6bc49 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @@ -12,19 +12,19 @@ /** * Base class. */ -#include "TrkDetElementBase/TrkDetElementBase.h" +#include "ReadoutGeometryBase/SolidStateDetectorElementBase.h" #include "GeoModelKernel/GeoDefinitions.h" #include "GeoPrimitives/CLHEPtoEigenConverter.h" #include "GeoPrimitives/GeoPrimitives.h" #include "Identifier/Identifier.h" #include "Identifier/IdentifierHash.h" -#include "InDetReadoutGeometry/InDetDD_Defs.h" -#include "InDetReadoutGeometry/SiCellId.h" -#include "InDetReadoutGeometry/SiCommonItems.h" +#include "ReadoutGeometryBase/InDetDD_Defs.h" +#include "ReadoutGeometryBase/SiCellId.h" +#include "ReadoutGeometryBase/SiCommonItems.h" #include "InDetReadoutGeometry/SiDetectorDesign.h" -#include "InDetReadoutGeometry/SiIntersect.h" -#include "InDetReadoutGeometry/SiLocalPosition.h" +#include "ReadoutGeometryBase/SiIntersect.h" +#include "ReadoutGeometryBase/SiLocalPosition.h" #include "TrkEventPrimitives/ParamDefs.h" #include "CLHEP/Geometry/Point3D.h" @@ -137,7 +137,7 @@ namespace InDetDD { */ - class SiDetectorElement : public Trk::TrkDetElementBase { + class SiDetectorElement : public InDetDD::SolidStateDetectorElementBase { public: diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx deleted file mode 100755 index 46e095a29d9649716d3692343a8904fa109a7aa8..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#include "InDetReadoutGeometry/SiCommonItems.h" - -namespace InDetDD { - -SiCommonItems::SiCommonItems(const AtlasDetectorID* const idHelper) - : m_msg("SiDetectorElement"), - m_idHelper(idHelper), - m_lorentzAngleTool(nullptr), - m_mutex{} -{} - -void -SiCommonItems::setSolenoidFrame(const HepGeom::Transform3D & transform) const -{ - std::lock_guard<std::mutex> lock{m_mutex}; - m_solenoidFrame = transform; -} - -void SiCommonItems::setLorentzAngleTool(const ISiLorentzAngleTool* lorentzAngleTool) { - m_lorentzAngleTool = lorentzAngleTool; -} - -const ISiLorentzAngleTool* SiCommonItems::lorentzAngleTool() const { - return m_lorentzAngleTool; -} - -} // End namespace InDetDD diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorDesign.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorDesign.cxx index 75f991c061a8c6fe88488c4bb1ee43bdc906103d..915fdb7550ae4b7f19b27320a66318db160a790b 100755 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorDesign.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorDesign.cxx @@ -23,15 +23,12 @@ SiDetectorDesign::SiDetectorDesign(double thickness, bool depthSymmetric, InDetDD::CarrierType carrierType, int readoutSide): - m_etaAxis(zAxis), - m_phiAxis(yAxis), - m_depthAxis(xAxis), - m_thickness(thickness), - m_carrierType(carrierType), - m_phiSymmetric(phiSymmetric), - m_etaSymmetric(etaSymmetric), - m_depthSymmetric(depthSymmetric), - m_readoutSidePosDepth(readoutSide > 0) { + DetectorDesign(thickness, + phiSymmetric, + etaSymmetric, + depthSymmetric, + carrierType, + readoutSide) { } // Constructor with axis parameters: @@ -43,83 +40,17 @@ SiDetectorDesign::SiDetectorDesign(double thickness, int readoutSide, Axis stripDirection, Axis thicknessDirection): - m_etaAxis(stripDirection), - m_depthAxis(thicknessDirection), - m_thickness(thickness), - m_carrierType(carrierType), - m_phiSymmetric(phiSymmetric), - m_etaSymmetric(etaSymmetric), - m_depthSymmetric(depthSymmetric), - m_readoutSidePosDepth(readoutSide > 0) { - if (stripDirection == thicknessDirection) { - throw std::runtime_error( - "ERROR: SiDetectorDesign called with phi and thickness directions equal"); - } - // phiAxis is "the other one" - m_phiAxis = static_cast<Axis> ((xAxis + yAxis + zAxis) - (stripDirection + thicknessDirection)); + DetectorDesign(thickness, + phiSymmetric, + etaSymmetric, + depthSymmetric, + carrierType, + readoutSide, + stripDirection, + thicknessDirection){ } - // Destructor: SiDetectorDesign::~SiDetectorDesign() { } -SiIntersect SiDetectorDesign::inDetector(const SiLocalPosition &localPosition, - double phiTol, double etaTol) const { - double etaDist = 0; - double phiDist = 0; - - distanceToDetectorEdge(localPosition, etaDist, phiDist); - - SiIntersect state; - - if (phiDist < -phiTol || etaDist < -etaTol) { - state.setOut(); - return state; - } - - if (phiDist > phiTol && etaDist > etaTol) { - state.setIn(); - return state; - } - - // Near boundary. - state.setNearBoundary(); - return state; -} - -void SiDetectorDesign::setSymmetry(bool phiSymmetric, bool etaSymmetric, - bool depthSymmetric) { - // Flags can be changed from true to false but not false to true. - if (m_phiSymmetric) { - m_phiSymmetric = phiSymmetric; - } - else if (phiSymmetric) { - std::cout << - "SiDetectorDesign: WARNING! Attempt to allow swapping of xPhi axis direction ignored." - << std::endl; - } - - if (m_etaSymmetric) { - m_etaSymmetric = etaSymmetric; - } - else if (etaSymmetric) { - std::cout << - "SiDetectorDesign: WARNING! Attempt to allow swapping of xEta axis direction ignored." - << std::endl; - } - - if (m_depthSymmetric) { - m_depthSymmetric = depthSymmetric; - } - else if (depthSymmetric) { - std::cout << - "SiDetectorDesign: WARNING! Attempt to allow swapping of xDepth axis direction ignored." - << std::endl; - } -} - -DetectorShape SiDetectorDesign::shape() const { - // Default is Box. - return InDetDD::Box; -} } // namespace InDetDD diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx index 2df1dec48750210329d8f2d4061fcd8aa5c72585..af0641ebd8054f05d41f8ecade54f338789cc6be 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @@ -39,17 +39,7 @@ namespace InDetDD { const GeoVFullPhysVol* geophysvol, const SiCommonItems* commonItems, const GeoAlignmentStore* geoAlignStore) : - TrkDetElementBase(geophysvol), - m_id(id), - m_design(design), - m_commonItems(commonItems), - m_surface(), - m_geoAlignStore(geoAlignStore) - { - m_hitEta = m_design->etaAxis(); - m_hitPhi = m_design->phiAxis(); - m_hitDepth = m_design->depthAxis(); - + SolidStateDetectorElementBase(id,design,geophysvol,commonItems,geoAlignStore) { commonConstructor(); } diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorManager.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorManager.cxx index c9615b82e5749e468c45b8a2dc3134f1b9120078..195f4580bcc3d8d06fb404ea0e8008af9e6ac593 100755 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorManager.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorManager.cxx @@ -14,7 +14,7 @@ #include "GeoGenericFunctions/Variable.h" #include "GeoModelKernel/GeoAlignableTransform.h" #include "DetDescrConditions/AlignableTransformContainer.h" -#include "InDetReadoutGeometry/SiCommonItems.h" +#include "ReadoutGeometryBase/SiCommonItems.h" #include "InDetReadoutGeometry/SiDetectorElementCollection.h" #include "InDetReadoutGeometry/SiDetectorElement.h" #include "InDetReadoutGeometry/ExtendedAlignableTransform.h" diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripAnnulusDesign.h b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripAnnulusDesign.h index d557e662d20bc18e6a05aa17debb665627280899..1320dd32d9496d140272dfa677ed05060d16f79c 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripAnnulusDesign.h +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripAnnulusDesign.h @@ -27,7 +27,7 @@ // Base class #include "SCT_ReadoutGeometry/SCT_ModuleSideDesign.h" -#include "InDetReadoutGeometry/SiCellId.h" +#include "ReadoutGeometryBase/SiCellId.h" #include "CLHEP/Geometry/Vector3D.h" // For unused phiMeasureSegment #include "CLHEP/Geometry/Transform3D.h" @@ -56,7 +56,7 @@ public: ~StripAnnulusDesign() = default; - HepGeom::Point3D<double> sensorCenter() const; + Amg::Vector3D sensorCenter() const; // Copy constructor and assignment: StripAnnulusDesign(const StripAnnulusDesign &design); @@ -139,7 +139,7 @@ public: // Transform from SiHit to GeoModel frame - const HepGeom::Transform3D SiHitToGeoModel() const; + const Amg::Transform3D SiHitToGeoModel() const; // ------------------------------------------------------------------------------------------ diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h index 8178d2418b4ed1dc3c1536361c7438f9926ae30f..551b3805010cd8d51bdeff2e7f6b328a3eca20ed 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h @@ -63,7 +63,7 @@ public: ~StripStereoAnnulusDesign() = default; - HepGeom::Point3D<double> sensorCenter() const; + Amg::Vector3D sensorCenter() const; // Copy constructor and assignment: StripStereoAnnulusDesign(const StripStereoAnnulusDesign &design); @@ -170,7 +170,7 @@ public: virtual DetectorShape shape() const; // Transform from SiHit to GeoModel frame - const HepGeom::Transform3D SiHitToGeoModel() const; + const Amg::Transform3D SiHitToGeoModel() const; double sinStripAngleReco(double phiCoord, double etaCoord) const; diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripAnnulusDesign.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripAnnulusDesign.cxx index 8d924b9434ef735be47f0962a1e2e438e7f1ea16..52bdc1b8aecd2ad43772c1eb112d8502496de1cb 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripAnnulusDesign.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripAnnulusDesign.cxx @@ -9,6 +9,7 @@ #include "SCT_ReadoutGeometry/StripAnnulusDesign.h" #include "Identifier/Identifier.h" #include "TrkSurfaces/RectangleBounds.h" +#include "GeoPrimitives/GeoPrimitivesHelpers.h" namespace InDetDD { StripAnnulusDesign::StripAnnulusDesign(const SiDetectorDesign::Axis &stripDirection, @@ -35,9 +36,9 @@ StripAnnulusDesign::StripAnnulusDesign(const SiDetectorDesign::Axis &stripDirect std::unique_ptr<Trk::SurfaceBounds> m_bounds = std::make_unique<Trk::RectangleBounds>(width / 2.0, length / 2.0); // Awaiting new boundclass for Annulus shape } -HepGeom::Point3D<double> StripAnnulusDesign::sensorCenter() const { +Amg::Vector3D StripAnnulusDesign::sensorCenter() const { double centerR = (m_stripStartRadius + m_stripEndRadius) * 0.5; - return HepGeom::Point3D<double>(centerR, 0., 0.); + return Amg::Vector3D(centerR, 0., 0.); } void StripAnnulusDesign::neighboursOfCell(const SiCellId &cellId, std::vector<SiCellId> &neighbours) const { @@ -190,8 +191,8 @@ double StripAnnulusDesign::etaPitch() const { // DEPRECATED return length(); } -const HepGeom::Transform3D StripAnnulusDesign::SiHitToGeoModel() const { - return HepGeom::RotateY3D(90.*CLHEP::deg) ; +const Amg::Transform3D StripAnnulusDesign::SiHitToGeoModel() const { + return Amg::getRotateY3D(90.*CLHEP::deg); } } // namespace InDetDD diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx index 0a357abdd34adb78903257b684bae64617a2937c..1ef6f164563b88fb1c229807cc80ce65d8bd0909 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx @@ -4,6 +4,7 @@ #include "SCT_ReadoutGeometry/StripStereoAnnulusDesign.h" #include "Identifier/Identifier.h" +#include "GeoPrimitives/GeoPrimitivesHelpers.h" #include <stdexcept> #include <algorithm> // For upper_bound @@ -72,8 +73,8 @@ StripStereoAnnulusDesign::StripStereoAnnulusDesign(const SiDetectorDesign::Axis } -HepGeom::Point3D<double> StripStereoAnnulusDesign::sensorCenter() const { - return HepGeom::Point3D<double>(m_R, 0., 0.); +Amg::Vector3D StripStereoAnnulusDesign::sensorCenter() const { + return Amg::Vector3D(m_R, 0., 0.); } double StripStereoAnnulusDesign::sinStripAngleReco(double phiCoord, double etaCoord) const { @@ -407,8 +408,8 @@ DetectorShape StripStereoAnnulusDesign::shape() const return InDetDD::Annulus; } -const HepGeom::Transform3D StripStereoAnnulusDesign::SiHitToGeoModel() const { - return HepGeom::RotateY3D(90.*CLHEP::deg) ; +const Amg::Transform3D StripStereoAnnulusDesign::SiHitToGeoModel() const { + return Amg::getRotateY3D(90.*CLHEP::deg) ; } double StripStereoAnnulusDesign::stripLength(const InDetDD::SiCellId &cellId) const