Placing wires in the designated wireGroups for easy retrieval later, first and last are placed separately.
Stacking strip, wireGroup and pad layers Redefining the gasgap center for L3 (diamond) sector: Unlike the run 3 (legacy) code, we are NOT offsetting the gasgap center in the local y coordinate to match the base of the cutout. As a result, localToGlobal transformations and the local y coordinate of the pads, strips and wireGroups will not match the run 3. Additionally, the global y coordinate of the wireGroup is shifted by ~25 mm due to this center redefinition. The redefinition will not affect reconstruction and digitization, and will simplify the sTgc geometry code.
65 {
67 <<std::endl<<std::endl<<
m_geoUtilTool->dumpVolume(define.physVol));
68 const GeoShape* shape =
m_geoUtilTool->extractShape(define.physVol);
69 if (!shape) {
71 return StatusCode::FAILURE;
72 }
76
77 define.sHalfChamberLength = modPars.shortWidth;
78 define.lHalfChamberLength = modPars.longWidth;
79 define.halfChamberHeight = modPars.halfHeight;
80 define.halfChamberTck = modPars.thickness;
81 define.yCutout = modPars.yCutOut;
82
83 ATH_MSG_DEBUG(
"chamber length (L/S) is: " << 2*define.lHalfChamberLength <<
"/"
84 << 2*define.sHalfChamberLength << " chamber height is: "
85 << 2*define.halfChamberHeight << " chamber thickness is: " << 2*define.halfChamberTck << " yCutout value is: " << define.yCutout);
86
88 std::vector<physVolWithTrans> allGasGaps =
m_geoUtilTool->findAllLeafNodesByName(define.physVol,
"sTgcGas");
89 if (allGasGaps.empty()) {
92 return StatusCode::FAILURE;
93 }
94
96 define.numLayers = allGasGaps.size();
98 FactoryCache::ParamBookTable::const_iterator parBookItr = factoryCache.parameterBook.find(define.chambDesign);
99 if (parBookItr == factoryCache.parameterBook.end()) {
100 ATH_MSG_FATAL(
"The chamber "<<define.chambDesign<<
" is not part of the WSTGC table");
101 return StatusCode::FAILURE;
102 }
103
104 const wSTGCTable& paramBook{parBookItr->second};
105
106 define.
gasTck = paramBook.gasTck;
111 WireDesignPtr wireGroupDesign = std::make_unique<WireGroupDesign>();
113
115
117 double firstStripPos = -gapPars.halfHeight + paramBook.firstStripPitch[
gasGap] - 0.5 * paramBook.stripPitch;
118 define.firstStripPitch = paramBook.firstStripPitch;
119 ATH_MSG_DEBUG(
"FirstStripPos for stripPitch: " << paramBook.firstStripPitch[gasGap] <<
" is: " <<
Amg::toString(firstStripPos, 2) <<
" and the half height is: " << gapPars.halfHeight);
120
122 unsigned int numWireGroups = paramBook.numWireGroups[
gasGap];
124 double firstWirePos = paramBook.firstWirePos[
gasGap];
125
126 if(gapPars.yCutOut) {
128 stripDesign->defineDiamond(gapPars.shortWidth, gapPars.longWidth, gapPars.halfHeight + 0.001, paramBook.yCutoutCathode);
129 ATH_MSG_VERBOSE(
"The yCutout of the active area is: " << gapPars.yCutOut);
130 stripDesign->defineStripLayout(
Amg::Vector2D{firstStripPos, 0.},
131 paramBook.stripPitch, paramBook.stripWidth, paramBook.numStrips);
134 wireGroupDesign->defineDiamond(0.5*paramBook.sPadLength, 0.5*paramBook.lPadLength, gapPars.halfHeight, paramBook.yCutoutCathode);
135 wireGroupDesign->flipTrapezoid();
136 wireGroupDesign->defineStripLayout(
Amg::Vector2D{firstWirePos, 0.},
137 paramBook.wirePitch,
138 paramBook.wireWidth,
139 numWireGroups);
140 ATH_MSG_VERBOSE(
"Created new diamond wireGroup design "<<(*wireGroupDesign));
141
143 padDesign->defineDiamond(0.5*paramBook.sPadLength, 0.5*paramBook.lPadLength, gapPars.halfHeight, paramBook.yCutoutCathode);
144 padDesign->flipTrapezoid();
146 }
147 else if (!gapPars.yCutOut) {
149 stripDesign->defineTrapezoid(gapPars.shortWidth, gapPars.longWidth, gapPars.halfHeight + 0.01);
150 stripDesign->defineStripLayout(
Amg::Vector2D{firstStripPos, 0.},
151 paramBook.stripPitch, paramBook.stripWidth, paramBook.numStrips);
153
155 wireGroupDesign->defineTrapezoid(0.5*paramBook.sPadLength, 0.5*paramBook.lPadLength, gapPars.halfHeight);
156 wireGroupDesign->flipTrapezoid();
157 wireGroupDesign->defineStripLayout(
Amg::Vector2D{firstWirePos, 0.},
158 paramBook.wirePitch,
159 paramBook.wireWidth,
160 numWireGroups);
162
164 padDesign->defineTrapezoid(0.5*paramBook.sPadLength, 0.5*paramBook.lPadLength, gapPars.halfHeight);
165 padDesign->flipTrapezoid();
167 }
168
170 wireGroupDesign->declareGroup(paramBook.firstWireGroupWidth[gasGap]);
171 for (
uint wireGr=2; wireGr<numWireGroups; wireGr++){
172 wireGroupDesign->declareGroup(paramBook.wireGroupWidth);
173 }
174 unsigned int lastWireGroup = (paramBook.numWires[
gasGap] - wireGroupDesign->nAllWires());
175 wireGroupDesign->declareGroup(lastWireGroup);
176 wireGroupDesign->defineWireCutout(paramBook.wireCutout[gasGap]);
177
179 double beamlineRadius = (define.physVol->getAbsoluteTransform() * gapVol.transform).translation().perp();
180 padDesign->defineBeamlineRadius(beamlineRadius);
182 padDesign->definePadRow(paramBook.firstPadPhiDivision[gasGap],
183 paramBook.numPadPhi[gasGap],
184 paramBook.anglePadPhi,
185 paramBook.PadPhiShift[gasGap]);
186 padDesign->definePadColumn(paramBook.firstPadHeight[gasGap],
187 paramBook.numPadEta[gasGap],
188 paramBook.padHeight[gasGap]);
189
200 stripDesign = (*factoryCache.stripDesigns.emplace(stripDesign).first);
201 StripLayer stripLayer(factoryCache.trfNodeMaker.makeTransform(gapVol.transform
206 define.stripLayers.push_back(std::move(stripLayer));
207
209 wireGroupDesign = (*factoryCache.wireGroupDesigns.emplace(wireGroupDesign).first);
210 StripLayer wireGroupLayer(factoryCache.trfNodeMaker.makeTransform(gapVol.transform
214 ATH_MSG_VERBOSE(
"Added new diamond wireGroup layer at "<<wireGroupLayer);
215 define.wireGroupLayers.push_back(std::move(wireGroupLayer));
216
218 padDesign = (*factoryCache.padDesigns.emplace(padDesign).first);
219 StripLayer padLayer(factoryCache.trfNodeMaker.makeTransform(gapVol.transform
224 define.padLayers.push_back(std::move(padLayer));
225 }
226 return StatusCode::SUCCESS;
227}
static IdentifierHash createHash(const unsigned int gasGap, const unsigned int channelType, const unsigned int channel, const unsigned int wireInGrp=0)
Create a measurement hash from the Identifier fields.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Eigen::Matrix< double, 2, 1 > Vector2D
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
GeoModel::TransientConstSharedPtr< WireGroupDesign > WireDesignPtr
IMuonGeoUtilityTool::physVolWithTrans physVolWithTrans
GeoModel::TransientConstSharedPtr< StripDesign > StripDesignPtr
GeoModel::TransientConstSharedPtr< PadDesign > PadDesignPtr