135{
136
137 msg(MSG::INFO) <<
"Building SCT Detector." <<
endmsg;
139
140
141 int oldPrecision = std::cout.precision(6);
142
143
144 GeoPhysVol *indet = world;
145
146 const SCT_GeneralParameters * sctGeneral =
m_geometryManager->generalParameters();
147
148 GeoTrf::Transform3D sctTransform = sctGeneral->
partTransform(
"SCT");
149
150 std::string barrelLabel = "Barrel";
151 std::string forwardPlusLabel = "EndcapA";
152 std::string forwardMinusLabel = "EndcapC";
153
154 bool barrelPresent = sctGeneral->
partPresent(barrelLabel);
155 bool forwardPlusPresent = sctGeneral->
partPresent(forwardPlusLabel);
156 bool forwardMinusPresent = sctGeneral->
partPresent(forwardMinusLabel);
157
158
159
160
161
162
163 if (barrelPresent) {
164
165 msg(MSG::DEBUG) <<
"Building the SCT Barrel." <<
endmsg;
166
168
169
171
173 id.setBarrelEC(0);
174 GeoVPhysVol * barrelPV = sctBarrel.build(id);
175 GeoAlignableTransform * barrelTransform =
new GeoAlignableTransform(sctTransform * sctGeneral->
partTransform(barrelLabel));
176
177
178
179 GeoNameTag *topLevelNameTag = new GeoNameTag("SCT");
180 indet->add(topLevelNameTag);
181 indet->add(new GeoIdentifierTag(0));
182 indet->add(barrelTransform);
183 indet->add(barrelPV);
185
186
187 m_detectorManager->addAlignableTransform(3,
id.getWaferId(), barrelTransform, barrelPV);
188
189 }
190
191
192
193
194 if (forwardPlusPresent) {
195
196 msg(MSG::DEBUG) <<
"Building the SCT Endcap A (positive z)." <<
endmsg;
197
199
200
202
205 GeoVPhysVol * forwardPlusPV = sctForwardPlus.build(idFwdPlus);
206 GeoTrf::Transform3D fwdTransformPlus(sctTransform
208 * GeoTrf::TranslateZ3D(sctForwardPlus.zCenter()));
209 GeoAlignableTransform * fwdGeoTransformPlus = new GeoAlignableTransform(fwdTransformPlus);
210
211
212
213 GeoNameTag *topLevelNameTag = new GeoNameTag("SCT");
214 indet->add(topLevelNameTag);
215 indet->add(new GeoIdentifierTag(2));
216 indet->add(fwdGeoTransformPlus);
217 indet->add(forwardPlusPV);
219
220
222 }
223
224
225
226
227
228 if (forwardMinusPresent) {
229
230 msg(MSG::DEBUG) <<
"Building the SCT Endcap C (negative z)." <<
endmsg;
231
233
235
238 GeoVPhysVol * forwardMinusPV = sctForwardMinus.build(idFwdMinus);
239
240 GeoTrf::Transform3D rot;
241 rot = GeoTrf::RotateY3D(180 * Gaudi::Units::degree);
242
243 GeoTrf::Transform3D fwdTransformMinus(sctTransform
245 * rot
246 * GeoTrf::TranslateZ3D(sctForwardMinus.zCenter()));
247 GeoAlignableTransform * fwdGeoTransformMinus = new GeoAlignableTransform(fwdTransformMinus);
248
249
250
251 GeoNameTag *topLevelNameTag = new GeoNameTag("SCT");
252 indet->add(topLevelNameTag);
253 indet->add(new GeoIdentifierTag(-2));
254 indet->add(fwdGeoTransformMinus);
255 indet->add(forwardMinusPV);
257
258
259
261 }
262
263
265
266
269 }
270
271
272
273
274
275
277
282
283 if (barrelPresent) {
288 }
289 if (forwardPlusPresent) {
299 }
300 if (forwardMinusPresent) {
310 }
311 }
312
313 else {
320
321 if (barrelPresent) {
326 }
327 if (forwardPlusPresent) {
337 }
338 if (forwardMinusPresent) {
348 }
349 }
350
351
352 std::cout.precision(oldPrecision);
353
354}
const GeoTrf::Transform3D & partTransform(const std::string &partName) const
bool partPresent(const std::string &partName) const