159{
160
162 log << MSG::DEBUG <<
"createEnvelope() started" <<
endmsg;
163
164 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
166 throw std::runtime_error("Error in LArDetectorConstructionTBEC, cannot access DetectorStore");
167 }
168
169
170
171 StoredMaterialManager* materialManager = nullptr;
172 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS")))
return nullptr;
173
174 const GeoMaterial *Air = materialManager->
getMaterial(
"std::Air");
175 if (!Air) throw std::runtime_error("Error in LArDetectorConstructionTBEC, std::Air is not found.");
176
177 const GeoMaterial *Lead = materialManager->
getMaterial(
"std::Lead");
178 if (!Lead) throw std::runtime_error("Error in LArDetectorConstructionTBEC, std::Lead is not found.");
179
180
181
182
183 DecodeVersionKey larVersion("LAr");
184
185
187
189
190
191 std::string baseName = "LAr::TBEC";
192
193
194
195
196
197
198
199
200
201
202 std::string tbecMotherName = baseName + "::MotherVolume";
203 GeoBox* tbecMotherShape = new GeoBox( 5.*Gaudi::Units::m, 5.*Gaudi::Units::m, 15.*Gaudi::Units::m );
204 const GeoLogVol* tbecMotherLogical = new GeoLogVol( tbecMotherName, tbecMotherShape, Air );
205 GeoIntrusivePtr<GeoFullPhysVol> tbecMotherPhysical = new GeoFullPhysVol( tbecMotherLogical );
206
207 double xcent = -120.*Gaudi::Units::cm, zcent = 395.7*Gaudi::Units::cm;
208 double zfface = zcent - 60.09*Gaudi::Units::cm;
212 log <<
", positioning cryostat with angle " <<
m_eta_pos*(1./Gaudi::Units::deg) <<
" Gaudi::Units::deg";
214
215
216
218
219 double axisZHalfLength = 5*Gaudi::Units::m;
220
221 GeoTube* axisShape = new GeoTube( 0.*Gaudi::Units::cm, 1.*Gaudi::Units::cm, axisZHalfLength );
222
223
224 std::string XAxisName = baseName + "::XAxis";
225 const GeoLogVol* XAxisLogical = new GeoLogVol( XAxisName, axisShape, Air );
226 GeoIntrusivePtr<GeoPhysVol> XAxisPhysVol = new GeoPhysVol( XAxisLogical );
227
228 tbecMotherPhysical->add( new GeoIdentifierTag( 1 ) );
229 tbecMotherPhysical->add( new GeoTransform( GeoTrf::Transform3D( GeoTrf::Translation3D( axisZHalfLength, 0.*Gaudi::Units::m, 0.*Gaudi::Units::m ) *GeoTrf::RotateY3D( 90.*Gaudi::Units::deg )) ) );
230 tbecMotherPhysical->add( XAxisPhysVol );
231
232
233 std::string YAxisName = baseName + "::YAxis";
234 const GeoLogVol* YAxisLogical = new GeoLogVol( YAxisName, axisShape, Air );
235 GeoIntrusivePtr<GeoPhysVol> YAxisPhysVol = new GeoPhysVol( YAxisLogical );
236
237 tbecMotherPhysical->add( new GeoIdentifierTag( 1 ) );
238 tbecMotherPhysical->add( new GeoTransform( GeoTrf::Transform3D( GeoTrf::Translation3D( 0.*Gaudi::Units::m, axisZHalfLength, 0.*Gaudi::Units::m )*GeoTrf::RotateX3D( -90.*Gaudi::Units::deg ) ) ) );
239 tbecMotherPhysical->add( YAxisPhysVol );
240
241
242 std::string ZAxisName = baseName + "::ZAxis";
243 const GeoLogVol* ZAxisLogical = new GeoLogVol( ZAxisName, axisShape, Air );
244 GeoIntrusivePtr<GeoPhysVol> ZAxisPhysVol = new GeoPhysVol( ZAxisLogical );
245
246 tbecMotherPhysical->add( new GeoIdentifierTag( 1 ) );
247 tbecMotherPhysical->add( new GeoTransform( GeoTrf::TranslateZ3D( axisZHalfLength ) ) );
248 tbecMotherPhysical->add( ZAxisPhysVol );
249 }
250
251
252
254 std::string CompensatorName = baseName + "::LeadCompensator";
255 GeoBox* CompensatorShape = new GeoBox( 152.*Gaudi::Units::cm, 195.*Gaudi::Units::cm, 0.56*Gaudi::Units::cm );
256 const GeoLogVol* CompensatorLogical = new GeoLogVol( CompensatorName, CompensatorShape, Lead );
257 GeoIntrusivePtr<GeoPhysVol> CompensatorPhysical = new GeoPhysVol( CompensatorLogical );
258
259 tbecMotherPhysical->add( new GeoIdentifierTag( 1 ) );
260
261 GeoTrf::Vector3D tmpvec1(xcent, 0., 300.*Gaudi::Units::cm);
262 GeoTrf::Vector3D tmpvec1Rotated = GeoTrf::RotateY3D(
m_eta_pos)*tmpvec1;
263 GeoTrf::Translate3D tmpxf1(tmpvec1Rotated.x(),tmpvec1Rotated.y(),tmpvec1Rotated.z());
264 tbecMotherPhysical->add(
new GeoTransform( tmpxf1 * GeoTrf::RotateY3D(
m_eta_pos)));
265 tbecMotherPhysical->add( CompensatorPhysical );
266 }
267
268
269
270 CryostatConstructionTBEC cryoConstruction;
271 GeoIntrusivePtr<GeoVFullPhysVol> cryoPhys = cryoConstruction.GetEnvelope();
272 GeoIntrusivePtr<GeoPhysVol> LArPhysical = cryoConstruction.GetLArPhysical();
273
274 tbecMotherPhysical->add( new GeoIdentifierTag( 1 ) );
275 GeoTrf::Vector3D tmpvec2(xcent, 0., zcent);
276 GeoTrf::Vector3D tmpvec2Rotated = GeoTrf::RotateY3D(
m_eta_pos)*tmpvec2;
277 GeoTrf::Translate3D tmpxf2(tmpvec2Rotated.x(),tmpvec2Rotated.y(),tmpvec2Rotated.z());
278 tbecMotherPhysical->add(
new GeoTransform( tmpxf2 * GeoTrf::RotateY3D(
m_eta_pos)));
279 tbecMotherPhysical->add( cryoPhys );
280
281
282
283 log << MSG::VERBOSE <<
"Creating beam chambers ..." << std::endl;
284
285 const double beamCZ[ 4 ] = { 17.9*Gaudi::Units::m, 7.673*Gaudi::Units::m, 1.352*Gaudi::Units::m, .256*Gaudi::Units::m };
286 const double beamCSize = 11.*Gaudi::Units::cm, beamCTh = 28*Gaudi::Units::mm;
287
288 GeoBox* BeamCShape = new GeoBox( beamCSize, beamCSize, beamCTh );
289 for (
int i = 0;
i < 4;
i++ ) {
290 std::string BeamCName = baseName + "::BeamChamber";
291 BeamCName+=
char( i ) +
'0';
292 GeoLogVol* BeamCLogical = new GeoLogVol( BeamCName, BeamCShape, Air );
293 GeoIntrusivePtr<GeoPhysVol> BeamCPhysical = new GeoPhysVol( BeamCLogical );
294
295 tbecMotherPhysical->add( new GeoIdentifierTag( 1 ) );
296 tbecMotherPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, zfface - beamCZ[ i ] ) ) );
297 tbecMotherPhysical->add( BeamCPhysical );
298 }
299
300
301 log << MSG::DEBUG << std::endl
302 <<
"Module deviation: " <<
m_ModuleRotation * (1./Gaudi::Units::deg) <<
" Gaudi::Units::deg" << std::endl
303 <<
"Phi position: " <<
m_phi_pos * (1./Gaudi::Units::deg) <<
" Gaudi::Units::deg" << std::endl
304 <<
"Y shift: " <<
m_YShift * (1./Gaudi::Units::mm) <<
" Gaudi::Units::mm"
306
307
308
309 EMECConstruction emecModuleConstruction( true, true, true );
310 GeoIntrusivePtr<GeoFullPhysVol>emecEnvelope= (GeoIntrusivePtr<GeoFullPhysVol>) emecModuleConstruction.GetEnvelope();
311 StoredPhysVol *sPhysVol = new StoredPhysVol(emecEnvelope);
313 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store EMEC_POS");
314
316 GeoTrf::Vector3D
pos( -xcent,
m_YShift, -51.4/2*Gaudi::Units::cm );
317
318 if ( LArPhysical ) {
319
320 LArPhysical->add( new GeoIdentifierTag( 1 ) );
321 LArPhysical->add(
new GeoTransform( GeoTrf::Transform3D( GeoTrf::Translation3D(
pos(0),
pos(1),
pos(2)))*Mrot ) );
322 LArPhysical->add( emecEnvelope );
323 }
324
325 pos-= GeoTrf::Vector3D( 0.*Gaudi::Units::mm, 0.*Gaudi::Units::mm, 61.*Gaudi::Units::mm +2.*Gaudi::Units::mm +13.5*Gaudi::Units::mm );
326
328
329 EndcapPresamplerConstruction PresamplerConstruction( true );
330 GeoIntrusivePtr<GeoFullPhysVol> PresamplerEnvelope = PresamplerConstruction.Envelope();
331
332 StoredPhysVol *sPhysVol = new StoredPhysVol(PresamplerEnvelope);
334 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store PRESAMPLER_EC_POS");
335
336 if ( LArPhysical ) {
337
338 LArPhysical->add( new GeoIdentifierTag( 1 ) );
339 LArPhysical->add(
new GeoTransform( GeoTrf::Transform3D( GeoTrf::Translation3D(
pos(0),
pos(1),
pos(2)))*Mrot ) );
340 LArPhysical->add( PresamplerEnvelope );
341 }
342 }
343
344return tbecMotherPhysical;
345}
bool m_hasLeadCompensator
virtual const GeoMaterial * getMaterial(const std::string &name)=0
IMessageSvc * getMessageSvc(bool quiet=false)
::StatusCode StatusCode
StatusCode definition for legacy code.