58 GeoModelIO::ReadGeoModel* sqliteReader,
59 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
60 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
123 double divisionAngle = 360. * Gaudi::Units::degree /
m_skisPerLayer;
129 m_skiPhiStart = divisionAngle * (moduleCount - floor(moduleCount +0.5 -0.0001));
165 int tiltSign = (
m_tilt < 0) ? -1 : +1;
168 double powerTapeOffset = bracketOffset - tiltSign * 0.5*divisionAngle;
193 double coolingInnerRadius =
m_clamp->outerRadius();
194 double clearance = 1*Gaudi::Units::mm;
208 double rMinActive, rMaxActive;
218 rMinActive =
m_skiAux->outerRadius();
242 GeoLogVol * layerLog =
new GeoLogVol(
getName(), layerEnvelopeTube,
m_materials->gasMaterial());
245 if (
m_skiAux->outerRadius() > rMinActive) {
246 std::cout <<
"----> WARNING: SCT_Layer: Overlap between active layer and aux layer." << std::endl;
256 double divisionAngle = 360 * Gaudi::Units::degree /
m_skisPerLayer;
260 id.setPhiModule(iSki);
269 GeoFullPhysVol * layer =
new GeoFullPhysVol(
m_logVolume);
278 GeoLogVol * activeLayerLog =
new GeoLogVol(
getName()+
"Active", activeLayerEnvelopeShape,
m_materials->gasMaterial());
279 GeoPhysVol * activeLayer =
new GeoPhysVol(activeLayerLog);
282 std::ostringstream name; name <<
"Ski#" << iSki;
286 GeoTrf::Vector3D pos(
m_radius, 0, 0);
287 pos = GeoTrf::RotateZ3D(
phi)*pos;
288 GeoTrf::Transform3D rot = GeoTrf::RotateZ3D(
m_tilt)*GeoTrf::RotateZ3D(
phi);
292 GeoTrf::Transform3D trans(GeoTrf::Transform3D(GeoTrf::Translate3D(pos.x(),pos.y(),pos.z())*rot) *
m_ski->getRefPointTransform()->getTransform().inverse());
294 activeLayer->add(
new GeoAlignableTransform(trans));
295 activeLayer->add(
new GeoNameTag(name.str()));
296 activeLayer->add(
new GeoIdentifierTag(iSki));
297 id.setPhiModule(iSki);
298 activeLayer->add(
m_ski->build(
id));
303 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(clampZPos)));
304 activeLayer->add(
m_clamp->getVolume());
305 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-clampZPos)));
306 activeLayer->add(
m_clamp->getVolume());
309 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(coolingZPos)));
311 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-coolingZPos)));
318 const GeoTube * auxLayerEnvelopeShape =
new GeoTube(
m_skiAux->innerRadius(),
m_skiAux->outerRadius(),
320 GeoLogVol * auxLayerLog =
new GeoLogVol(
getName()+
"Aux", auxLayerEnvelopeShape,
m_materials->gasMaterial());
321 GeoPhysVol * auxLayer =
new GeoPhysVol(auxLayerLog);
326 auxLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(
phi)));
327 auxLayer->add(
m_skiAux->getVolume());
339 GeoLogVol * supportLayerLog =
new GeoLogVol(
getName()+
"Support", supportLayerTube,
341 GeoPhysVol * supportLayer =
new GeoPhysVol(supportLayerLog);
345 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(flangeZPos)));
346 supportLayer->add(
m_flange->getVolume());
347 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-flangeZPos)));
348 supportLayer->add(
m_flange->getVolume());
356 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(fibreMaskZPos)));
358 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-fibreMaskZPos)));
365 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(jewelAngle)*GeoTrf::TranslateX3D(jewelRadius)*GeoTrf::TranslateZ3D(
m_zEndJewel)));
367 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(jewelAngle)*GeoTrf::TranslateX3D(jewelRadius)*GeoTrf::TranslateZ3D(-
m_zEndJewel)));
375 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(scorpionAngle)*GeoTrf::TranslateX3D(scorpionRadius)*GeoTrf::TranslateZ3D(
m_zScorpion)));
377 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(scorpionAngle)*GeoTrf::TranslateX3D(scorpionRadius)*GeoTrf::TranslateZ3D(-
m_zScorpion)));
384 xMat.
add(supportLayer, std::format(
"SCTLayer{}",
m_iLayer));
387 layer->add(activeLayer);
388 layer->add(auxLayer);
389 layer->add(supportLayer);
401 GeoTrf::Vector3D c1(-(
m_ski->env1RefPointVector()->x()) - 0.5*(
m_ski->env1Thickness()),
402 -(
m_ski->env1RefPointVector()->y()) + 0.5*(
m_ski->env1Width()),
404 GeoTrf::Vector3D c2(-(
m_ski->env2RefPointVector()->x()) - 0.5*(
m_ski->env2Thickness()),
405 -(
m_ski->env2RefPointVector()->y()) + 0.5*(
m_ski->env2Width()),
407 GeoTrf::Vector3D c4(-(
m_ski->env1RefPointVector()->x()) + 0.5*(
m_ski->env1Thickness()),
408 -(
m_ski->env1RefPointVector()->y()) - 0.5*(
m_ski->env1Width()),
411 c1 = GeoTrf::RotateZ3D(
m_tilt)*c1;
412 c2 = GeoTrf::RotateZ3D(
m_tilt)*c2;
413 c4 = GeoTrf::RotateZ3D(
m_tilt)*c4;
415 GeoTrf::Vector3D vxmax = std::move(c4);
416 GeoTrf::Vector3D vxmin;
417 if (c1.x() < c2.x()) {
418 vxmin = std::move(c1);
421 vxmin = std::move(c2);
424 double xmax = vxmax.x();
425 double xmin = vxmin.x();
426 double ymax = vxmax.y();
427 double ymin = vxmin.y();
442 double divisionAngle = 360 * Gaudi::Units::degree /
m_skisPerLayer;
446 double activeHalfWidth = 0.5 *
m_module->activeWidth();
447 double moduleHalfThickness = 0.5 *
m_module->thickness();
450 double ctilt = std::abs(cos(
m_tilt));
451 double stilt = std::abs(sin(
m_tilt));
453 - ctilt * moduleHalfThickness - stilt * activeHalfWidth;
454 double yin = - stilt * moduleHalfThickness + ctilt * activeHalfWidth;
456 + ctilt * moduleHalfThickness - stilt * activeHalfWidth;
457 double yout = stilt * moduleHalfThickness + ctilt * activeHalfWidth;
458 double alpha_in = atan(yin/xin);
459 double alpha_out = atan(yout/xout);
460 double alpha = std::max(alpha_in, alpha_out);
462 int tiltSign = (
m_tilt < 0) ? -1 : 1;
465 double skiPhiOffset = tiltSign * (0.5 * divisionAngle - alpha);
SCT_Layer(const std::string &name, int iLayer, SCT_Module *module, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX)
SCT_UniqueComponentFactory(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials=nullptr, GeoModelIO::ReadGeoModel *sqliteReader=nullptr, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV=nullptr, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX=nullptr)