The stereo angle is defined clock-wise from the y-axis. So we need to input it with a minus when defining the trapezoid
44 <<std::endl<<std::endl<<
m_geoUtilTool->dumpVolume(define.physVol->getParent()));
45 const GeoShape* shape =
m_geoUtilTool->extractShape(define.physVol);
48 return StatusCode::FAILURE;
52 if (shape->typeID() != GeoTrd::getClassTypeID()) {
54 return StatusCode::FAILURE;
57 const GeoTrd* trapezoid =
static_cast<const GeoTrd*
>(shape);
64 <<
", halfThickness: "<<define.halfThickness<<
"/"
65 <<
", halfShortWidth : "<<define.halfShortWidth<<
"/"
66 <<
", halfLongWidth : "<<define.halfLongWidth<<
"/"
67 <<
", halfHeight : "<<define.halfHeight);
70 std::vector<physVolWithTrans> allGasGaps =
m_geoUtilTool->findAllLeafNodesByName(define.physVol,
"actMicroMegaGas");
71 if (allGasGaps.empty()) {
73 return StatusCode::FAILURE;
77 define.nGasGaps = allGasGaps.size();
80 FactoryCache::ParamBookTable::const_iterator parBookItr = factoryCache.parameterBook.find(define.chambDesign);
81 if (parBookItr == factoryCache.parameterBook.end()) {
82 ATH_MSG_FATAL(
"The chamber "<<define.chambDesign<<
" is not part of the WMM table");
83 return StatusCode::FAILURE;
86 const wMMTable& paramBook{parBookItr->second};
88 define.readoutSide = paramBook.readoutSide;
98 std::sort(allGasGaps.begin(), allGasGaps.end(),
100 const Amg::Vector3D posGapI = gapI.transform.translation();
101 const Amg::Vector3D posGapJ = gapJ.transform.translation();
102 return posGapI.x() < posGapJ.x();
105 for (std::size_t
gap = 0;
gap < allGasGaps.size(); ++
gap) {
107 auto& gapVol = allGasGaps[
gap];
108 const Amg::Vector3D posGapI = gapVol.transform.translation();
112 ATH_MSG_DEBUG(
"quadruplet " << define.chambDesign.substr(6,7) <<
" stereoAngle : " << paramBook.stereoAngle.at(
gap) <<
" totalStrips " << paramBook.totalActiveStrips.at(
gap) <<
" GasGAP POS X : " << posGapI.x() );
114 const GeoShape* gapShape =
m_geoUtilTool->extractShape(gapVol.volume);
115 if (gapShape->typeID() != GeoTrd::getClassTypeID()) {
117 return StatusCode::FAILURE;
120 bool isStereo =
static_cast<bool>(paramBook.stereoAngle.at(
gap));
122 const GeoTrd* gapTrd =
static_cast<const GeoTrd*
>(gapShape);
124 double gapHalfHeight = gapTrd->getZHalfLength();
125 double gapHalfShortY =
std::min(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
126 double gapHalfLongY =
std::max(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
128 double firstStripPos{0.};
129 int firstActiveStrip{0};
131 firstActiveStrip = paramBook.nMissedBottomStereo + 1;
132 firstStripPos = -gapHalfHeight + (1.*(firstActiveStrip - paramBook.nMissedTopEta) + 2.5)* paramBook.stripPitch;
134 firstActiveStrip = paramBook.nMissedBottomEta + 1;
135 firstStripPos = -gapHalfHeight + 1.5 *paramBook.stripPitch;
145 stripDesign->defineStripLayout(firstStripPos * Amg::Vector2D::UnitX(),
146 paramBook.stripPitch,
147 paramBook.stripWidth,
148 paramBook.totalActiveStrips.at(
gap),
152 stripDesign->defineTrapezoid(gapHalfShortY, gapHalfLongY, gapHalfHeight, paramBook.stereoAngle.at(
gap));
161 stripDesign = (*factoryCache.stripDesigns.emplace(stripDesign).first);
162 auto stripLayer = std::make_unique<StripLayer>(stripLayerRotation, stripDesign,
163 IdentifierHash{
static_cast<unsigned int>(
gap)});
164 define.layers.push_back(*factoryCache.stripLayers.emplace(std::move(stripLayer)).first);
166 return StatusCode::SUCCESS;