diff --git a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h index 1f2d5bea7fbad4285af5b70b47f46800ebbc2d6a..7a97ff6d3a32ff50ccfab1b19329e4ea56d259b2 100644 --- a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h +++ b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h @@ -171,6 +171,9 @@ public: //virtual const HepGeom::Transform3D SiHitToGeoModel() const; virtual const Amg::Transform3D SiHitToGeoModel() const; + //Transform for "split" modules + virtual const Amg::Transform3D moduleShift() const; + /////////////////////////////////////////////////////////// // // The following will replace existing methods but are not all implemented yet diff --git a/DetectorDescription/ReadoutGeometryBase/src/DetectorDesign.cxx b/DetectorDescription/ReadoutGeometryBase/src/DetectorDesign.cxx index 790a62824371cb6fab90aa927d04d16040c217c6..4f1e044f80dbef0c38d42ba9f5044010d72129ba 100644 --- a/DetectorDescription/ReadoutGeometryBase/src/DetectorDesign.cxx +++ b/DetectorDescription/ReadoutGeometryBase/src/DetectorDesign.cxx @@ -126,4 +126,8 @@ SiIntersect DetectorDesign::inDetector(const SiLocalPosition &localPosition, return Amg::Transform3D::Identity(); } + const Amg::Transform3D DetectorDesign::moduleShift() const { + return Amg::Transform3D::Identity(); + } + } // namespace InDetDD diff --git a/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx b/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx index 7437aed2f749eac0faf0a8eff03000a235719c90..7de50399230890aacbe7ed995edaaef3788fabbc 100644 --- a/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx +++ b/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx @@ -374,12 +374,12 @@ using Trk::distDepth; ptrXf = m_geoAlignStore->getAbsPosition(getMaterialGeom()); if (ptrXf) { m_transformHit = (*ptrXf) * m_design->SiHitToGeoModel(); //need .linear()? - geotrf = (*ptrXf); + geotrf = (*ptrXf) * m_design->moduleShift(); } } else{ m_transformHit = (getMaterialGeom()->getAbsoluteTransform() * m_design->SiHitToGeoModel()); //need .linear()? - geotrf = getMaterialGeom()->getAbsoluteTransform(); + geotrf = getMaterialGeom()->getAbsoluteTransform() * m_design->moduleShift(); } const GeoTrf::Transform3D& geoTransform = geotrf; diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripBoxDesign.h b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripBoxDesign.h index 7b1c6070f9fb9d2ada3c9a8999e9d2c9ce31aa4d..3c7fe6c915292409696fbec8b5ddda59d9eab234 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripBoxDesign.h +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripBoxDesign.h @@ -40,7 +40,8 @@ public: const int nRows, const int nStrips, const double pitch, - const double length); + const double length, + const double zShift=0.0); ~StripBoxDesign() = default; @@ -110,6 +111,8 @@ public: // For Strip sensors, readout cell == diode cell. Overload the SCT_ModuleSideDesign // member SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const; + + const Amg::Transform3D moduleShift() const final; // --------------------------------------------------------------------------------------- // DEPRECATED at least for Strips @@ -156,6 +159,7 @@ private: int m_nStrips; double m_pitch; double m_length; + double m_zShift; Trk::RectangleBounds m_bounds; }; @@ -217,7 +221,6 @@ inline int StripBoxDesign::strip(int stripId1Dim) const { return stripId1Dim % m_nStrips; } - /// DEPRECATED for StripBoxDesign; no dead area double StripBoxDesign::deadAreaUpperBoundary() const { return 0.; diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripBoxDesign.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripBoxDesign.cxx index d15c9d71dfffbc5eb713be60202693839d54ec00..e7043070fdf8954db9afb07517b08f6e9e0f5e90 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripBoxDesign.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripBoxDesign.cxx @@ -19,7 +19,8 @@ StripBoxDesign::StripBoxDesign(const SiDetectorDesign::Axis stripDirection, const int nRows, const int nStrips, const double pitch, - const double length) : + const double length, + const double zShift) : SCT_ModuleSideDesign(thickness, true, true, true, 1, nRows * nStrips, nRows * nStrips, 0, false, carrier, readoutSide, stripDirection, thicknessDirection) { if (nRows <= 0) { @@ -31,6 +32,7 @@ StripBoxDesign::StripBoxDesign(const SiDetectorDesign::Axis stripDirection, m_nStrips = nStrips; m_pitch = pitch; m_length = length; + m_zShift = zShift; double width = m_nStrips * m_pitch; double fullLength = m_nRows * m_length; @@ -246,6 +248,11 @@ void StripBoxDesign::distanceToDetectorEdge(SiLocalPosition const & pos, const GeoTrf::Transform3D StripBoxDesign::SiHitToGeoModel() const { return GeoTrf::RotateY3D(90.*GeoModelKernelUnits::deg); -} + } + const Amg::Transform3D StripBoxDesign::moduleShift() const{ + //local x is global Z (along strip) + return Amg::Translation3D(m_zShift,0.0, 0.0) * Amg::RotationMatrix3D::Identity(); + } + } // namespace InDetDD diff --git a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx index 97fabbd73e2018ec6d29d7dc655a0b019c08321e..6e9b90e614485df6caa0679105242011437c7386 100644 --- a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx +++ b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx @@ -190,13 +190,22 @@ double length(25.0); int split = 0; if(checkparm(typeName, "splitLevel", par, split)){ + + //start from middle of first strip row + double initZShift = length * ( -(double)split*0.5 + 0.5 ) ; + for(int i = 0;i<split;i++){ - //do we need some kind of shift for e.g. the corners and centre? - std::unique_ptr<InDetDD::StripBoxDesign> design=std::make_unique<InDetDD::StripBoxDesign>(stripDirection, fieldDirection, - thickness, readoutSide,carrier, 1, nStrips, pitch,length);//single row - m_detectorManager->addDesign(std::move(design)); - std::string splitName = typeName+"_"+std::to_string(i); + for(int side:{0,1}){//need different additional shift transform per side... + int sign = (side==0) ? 1:-1;//...because shift in different direction per side + double zShift = sign*(initZShift + (i*length)); + + std::unique_ptr<InDetDD::StripBoxDesign> design=std::make_unique<InDetDD::StripBoxDesign>(stripDirection, fieldDirection, + thickness, readoutSide,carrier, 1, nStrips, pitch,length,zShift);//single row + + m_detectorManager->addDesign(std::move(design)); + std::string splitName = typeName+"_"+std::to_string(i)+"_"+std::to_string(side); m_geometryMap[splitName] = m_detectorManager->numDesigns() -1; + } } } @@ -383,7 +392,6 @@ void StripGmxInterface::addSplitSensor(string typeName, map<string, int> &index, map<string, int> updatedIndex; splitSensorId(index,extraIndex,updatedIndex); int splitIndex = extraIndex.second; - //TODO - implement!! // // Get the ATLAS "Offline" wafer identifier // @@ -410,7 +418,13 @@ void StripGmxInterface::addSplitSensor(string typeName, map<string, int> &index, // Create the detector element and add to the DetectorManager // + + string splitTypeName = typeName + "_" + std::to_string(splitIndex); + if(updatedIndex["barrel_endcap"]==0){//only barrel-type have side dependence + splitTypeName += "_" + std::to_string(updatedIndex["side"]); + } + const InDetDD::SiDetectorDesign *design = m_detectorManager->getDesign(m_geometryMap[splitTypeName]); if (!design) {