The stereo angle is defined clock-wise from the y-axis. So we need to input it with a minus when defining the trapezoid
40 <<std::endl<<std::endl<<
m_geoUtilTool->dumpVolume(define.physVol->getParent()));
41 const GeoShape* shape =
m_geoUtilTool->extractShape(define.physVol);
44 return StatusCode::FAILURE;
48 if (shape->typeID() != GeoTrd::getClassTypeID()) {
50 return StatusCode::FAILURE;
53 const GeoTrd* trapezoid =
static_cast<const GeoTrd*
>(shape);
60 <<
", halfThickness: "<<define.halfThickness<<
"/"
61 <<
", halfShortWidth : "<<define.halfShortWidth<<
"/"
62 <<
", halfLongWidth : "<<define.halfLongWidth<<
"/"
63 <<
", halfHeight : "<<define.halfHeight);
66 std::vector<physVolWithTrans> allGasGaps =
m_geoUtilTool->findAllLeafNodesByName(define.physVol,
"actMicroMegaGas");
67 if (allGasGaps.empty()) {
69 return StatusCode::FAILURE;
73 define.nGasGaps = allGasGaps.size();
76 FactoryCache::ParamBookTable::const_iterator parBookItr = factoryCache.parameterBook.find(define.chambDesign);
77 if (parBookItr == factoryCache.parameterBook.end()) {
78 ATH_MSG_FATAL(
"The chamber "<<define.chambDesign<<
" is not part of the WMM table");
79 return StatusCode::FAILURE;
82 const wMMTable& paramBook{parBookItr->second};
84 define.readoutSide = paramBook.readoutSide;
87 for (std::size_t
gap = 0;
gap < allGasGaps.size(); ++
gap) {
89 auto& gapVol = allGasGaps[
gap];
94 ATH_MSG_DEBUG(
"quadruplet " << define.chambDesign.substr(6,7) <<
" stereoAngle : " << paramBook.stereoAngle.at(
gap) <<
" totalStrips " << paramBook.totalActiveStrips.at(
gap) <<
" GasGAP POS X : " << posGapI.x() );
96 const GeoShape* gapShape =
m_geoUtilTool->extractShape(gapVol.volume);
97 if (gapShape->typeID() != GeoTrd::getClassTypeID()) {
99 return StatusCode::FAILURE;
102 bool isStereo =
static_cast<bool>(paramBook.stereoAngle.at(
gap));
104 const GeoTrd* gapTrd =
static_cast<const GeoTrd*
>(gapShape);
106 double gapHalfHeight = gapTrd->getZHalfLength();
107 double gapHalfShortY =
std::min(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
108 double gapHalfLongY =
std::max(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
110 double firstStripPos{0.};
111 int firstActiveStrip{0};
113 firstActiveStrip = paramBook.nMissedBottomStereo + 1;
114 firstStripPos = -gapHalfHeight + (1.*(firstActiveStrip - paramBook.nMissedBottomEta) -0.5)* paramBook.stripPitch;
116 firstActiveStrip = paramBook.nMissedBottomEta + 1;
117 firstStripPos = -gapHalfHeight + 0.5*paramBook.stripPitch;
124 stripDesign->defineStripLayout(firstStripPos * Amg::Vector2D::UnitX(),
125 paramBook.stripPitch,
126 paramBook.stripWidth,
127 paramBook.totalActiveStrips.at(
gap),
131 stripDesign->defineTrapezoid(gapHalfShortY, gapHalfLongY, gapHalfHeight, paramBook.stereoAngle.at(
gap));
139 stripDesign = (*factoryCache.stripDesigns.emplace(stripDesign).first);
140 auto stripLayer = std::make_unique<StripLayer>(stripLayerRotation, stripDesign,
141 IdentifierHash{
static_cast<unsigned int>(
gap)});
142 define.layers.push_back(*factoryCache.stripLayers.emplace(std::move(stripLayer)).first);
144 return StatusCode::SUCCESS;