diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx index 6599398cbd94703276043ec3a01845b6c7509688..79fb6e121898da60168ee849251e7c40a6fe7321 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx @@ -26,6 +26,7 @@ #include "TrkSurfaces/RotatedTrapezoidBounds.h" #include "TrkSurfaces/TrapezoidBounds.h" #include "TrkSurfaces/DiamondBounds.h" +#include "TrkSurfaces/RotatedDiamondBounds.h" #include "GeoPrimitives/CLHEPtoEigenConverter.h" #include "MuonAGDDDescription/sTGCDetectorDescription.h" #include "MuonAGDDDescription/sTGCDetectorHelper.h" @@ -314,9 +315,7 @@ namespace MuonGM { } // These values depend on local geometry. When using DiamondBounds for QL3, the origin (0,0) is not at the center of the gas volume, but rather where the yCutout begins. - // The following line must be uncommented when we start using RotatedDiamond for QL3 - //if (m_sTGC_type == 3) m_etaDesign[il].firstPos = -(m_etaDesign[il].xSize -yCutout) + m_etaDesign[il].firstPitch; - if (m_sTGC_type == 3) m_etaDesign[il].firstPos = -0.5*m_etaDesign[il].xSize + m_etaDesign[il].firstPitch; + if (m_sTGC_type == 3) m_etaDesign[il].firstPos = -(m_etaDesign[il].xSize -yCutout) + m_etaDesign[il].firstPitch; else m_etaDesign[il].firstPos = -0.5*m_etaDesign[il].xSize + m_etaDesign[il].firstPitch; reLog() << MSG::INFO @@ -458,10 +457,7 @@ reLog() << MSG::INFO<<"initDesign Sum Height Check: "<<stgc->GetName()<<" stgc- /* Here we define the geometry for the strips followed by pad/wire plane / If QL3, a cutoff trapezoid, we use diamondBounds. Otherwise, Trapezoid */ if (m_sTGC_type == 3) { - // should use RotatedDiamondBounds and something like - // m_surfaceData->m_surfBounds.push_back( new Trk::RotatedDiamondBounds(m_minHalfX[layer],m_maxHalfX[layer],m_maxHalfX[layer],m_halfY[layer] - m_etaDesign[layer].xCutout/2,m_etaDesign[layer].xCutout/2) ); // strips - // Let's use temporarily RotatedTrapezoidBounds in stead of RotatedDiamondBounds - m_surfaceData->m_surfBounds.push_back( new Trk::RotatedTrapezoidBounds( m_halfX[layer], m_minHalfY[layer], (m_maxHalfY[layer] + (m_maxHalfY[layer] - m_minHalfY[layer])*(m_padDesign[layer].yCutout/2)/(m_PadhalfX[layer] - m_padDesign[layer].yCutout/2)) )); // strips, extended trapezoid bounds that includes whole diamond bounds + m_surfaceData->m_surfBounds.push_back( new Trk::RotatedDiamondBounds(m_minHalfY[layer],m_maxHalfY[layer],m_maxHalfY[layer],m_halfX[layer] - m_etaDesign[layer].yCutout/2,m_etaDesign[layer].yCutout/2) ); // strips m_surfaceData->m_surfBounds.push_back( new Trk::DiamondBounds(m_PadminHalfY[layer],m_PadmaxHalfY[layer],m_PadmaxHalfY[layer],m_PadhalfX[layer] - m_padDesign[layer].yCutout/2,m_padDesign[layer].yCutout/2) ); // pad and wires } else { @@ -496,7 +492,10 @@ reLog() << MSG::INFO<<"initDesign Sum Height Check: "<<stgc->GetName()<<" stgc- //std::cerr<<"center of wire plane, layer:"<<layer<<","<< m_surfaceData->m_layerCenters.back().perp()<< std::endl; // strip plane moved along normal, pad plane in the opposite direction - double shift = 0.5*m_etaDesign[layer].thickness; + // We no longer want the readout elements to be seperated by the gas gas volume + // We place all 3 readouts at the center of the gas gap in z, with a 10 micron offset to seperate them + // Alexandre Laurier 2018-02-28 + double shift = 0.01; if (layer%2) shift = -shift; // In layers indexed 1 and 3, order is reversed // identifier of the first channel - strip plane @@ -506,24 +505,13 @@ reLog() << MSG::INFO<<"initDesign Sum Height Check: "<<stgc->GetName()<<" stgc- m_surfaceData->m_layerSurfaces.push_back( new Trk::PlaneSurface(*this, id) ); if (m_sTGC_type == 1 || m_sTGC_type == 2) -// wrong -// m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* -// Amg::Translation3D(shift,0.,-offset)* -// Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.))* -// Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,0.,1.)) ); -// we have RotatedTrapezoid for the strips m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* Amg::Translation3D(shift,0.,-offset)* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.))); else if (m_sTGC_type == 3) // if QL3, diamond. have to shift geometry to account for origin not being in center -// m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* -// Amg::Translation3D(shift,0.,-offset + m_halfX[layer] - m_etaDesign[layer].yCutout)* -// Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.))* -// Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,0.,1.)) ); -// we have RotatedTrapezoid for the strips m_surfaceData->m_layerTransforms.push_back(absTransform()*m_Xlg[layer]* - Amg::Translation3D(shift,0.,-offset)* + Amg::Translation3D(shift,0.,-offset + m_halfX[layer] - m_etaDesign[layer].yCutout)* Amg::AngleAxis3D(-90*CLHEP::deg,Amg::Vector3D(0.,1.,0.)) ); else reLog()<<MSG::ERROR << "sTGC_type : " << m_sTGC_type << " is not valid! Strip Geometry not Created!" << endmsg; diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx index 50759ce02955aa39146a8764f32c20d0ebc8fb5a..620535fbbffc6fa1b6bc2fb441868e47c5677274 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx @@ -41,6 +41,7 @@ #include "TrkVolumes/BoundarySurfaceFace.h" #include "TrkSurfaces/DiscBounds.h" #include "TrkSurfaces/DiamondBounds.h" +#include "TrkSurfaces/RotatedDiamondBounds.h" #include "TrkSurfaces/RectangleBounds.h" #include "TrkSurfaces/TrapezoidBounds.h" #include "TrkSurfaces/RotatedTrapezoidBounds.h" @@ -222,12 +223,14 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: const Trk::RotatedTrapezoidBounds* rtrd=nullptr; const Trk::TrapezoidBounds* trd=nullptr; const Trk::DiamondBounds* dia=nullptr; + const Trk::RotatedDiamondBounds* rdia=nullptr; Amg::Transform3D layTransf(Trk::s_idTransform); if (m_muonMgr->stgcIdHelper()->is_stgc(nswId)) { const MuonGM::sTgcReadoutElement* stgc=m_muonMgr->getsTgcReadoutElement(nswId); if (stgc) rtrd = dynamic_cast<const Trk::RotatedTrapezoidBounds*> (&stgc->bounds(nswId)); if (stgc) trd = dynamic_cast<const Trk::TrapezoidBounds*> (&stgc->bounds(nswId)); if (stgc) dia = dynamic_cast<const Trk::DiamondBounds*> (&stgc->bounds(nswId)); + if (stgc) rdia = dynamic_cast<const Trk::RotatedDiamondBounds*> (&stgc->bounds(nswId)); if (stgc) layTransf = stgc->transform(nswId); if(stgc) ATH_MSG_DEBUG( " STGC readout element " ); if(!stgc) ATH_MSG_DEBUG( " STGC and NO readout element " ); @@ -247,7 +250,7 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: const Trk::Layer* layer=0; - if (!rtrd && !dia && !trd) { // translate from GeoModel ( spacer & non-identified stuff ) + if (!rtrd && !dia && !trd && !rdia) { // translate from GeoModel ( spacer & non-identified stuff ) // This used to be a !rtrd check as we either had a rotatedTrap or nothing // Now we included trapezoid and diamond shape for the sTGC ATH_MSG_DEBUG( " translate from GeoModel " << protoName ); @@ -269,6 +272,14 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: double thickness=(mat.fullMaterial(layTransf.translation()))->thickness(); layer = new Trk::PlaneLayer(new Amg::Transform3D(layTransf*Amg::AngleAxis3D(-0.5*M_PI,Amg::Vector3D(0.,0.,1.))), bounds, mat,thickness, od, 1 ); + } else if (rdia) { + // create active layer for diamond shape of NSW-sTGC QL3 + Trk::DiamondBounds* tbounds = new Trk::DiamondBounds(rdia->minHalflengthX(),rdia->medHalflengthX(),rdia->maxHalflengthX(),rdia->halflengthY1(),rdia->halflengthY2()); + Trk::SharedObject<const Trk::SurfaceBounds> bounds(tbounds); + Trk::OverlapDescriptor* od=0; + double thickness=(mat.fullMaterial(layTransf.translation()))->thickness(); + layer = new Trk::PlaneLayer(new Amg::Transform3D(layTransf*Amg::AngleAxis3D(-0.5*M_PI,Amg::Vector3D(0.,0.,1.))), + bounds, mat,thickness, od, 1 ); } else if (trd) { // create active layer for trapezoid shape of rest of NSW-sTGC Trk::TrapezoidBounds* tbounds = new Trk::TrapezoidBounds(trd->minHalflengthX(),trd->maxHalflengthX(),trd->halflengthY());