58 GeoModelIO::ReadGeoModel* sqliteReader,
59 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
60 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
125 double divisionAngle = 360. * Gaudi::Units::degree /
m_skisPerLayer;
131 m_skiPhiStart = divisionAngle * (moduleCount - floor(moduleCount +0.5 -0.0001));
148 m_fibreMask = std::make_unique<SCT_FSIFibreMask>(
"FSIFibreMask"+layerNumStr,
m_iLayer, length_mask,
167 int tiltSign = (
m_tilt < 0) ? -1 : +1;
170 double powerTapeOffset = bracketOffset - tiltSign * 0.5*divisionAngle;
176 m_skiAux = std::make_unique<SCT_SkiAux>(
"SkiAux"+layerNumStr,
195 double coolingInnerRadius =
m_clamp->outerRadius();
196 double clearance = 1*Gaudi::Units::mm;
198 m_coolingEnd = std::make_unique<SCT_CoolingEnd>(
"CoolingEnd"+layerNumStr,
m_iLayer, coolingInnerRadius, coolingLength,
210 double rMinActive, rMaxActive;
220 rMinActive =
m_skiAux->outerRadius();
244 GeoLogVol * layerLog =
new GeoLogVol(
getName(), layerEnvelopeTube,
m_materials->gasMaterial());
247 if (
m_skiAux->outerRadius() > rMinActive) {
248 std::cout <<
"----> WARNING: SCT_Layer: Overlap between active layer and aux layer." << std::endl;
258 double divisionAngle = 360 * Gaudi::Units::degree /
m_skisPerLayer;
262 id.setPhiModule(iSki);
271 GeoFullPhysVol * layer =
new GeoFullPhysVol(
m_logVolume);
280 GeoLogVol * activeLayerLog =
new GeoLogVol(
getName()+
"Active", activeLayerEnvelopeShape,
m_materials->gasMaterial());
281 GeoPhysVol * activeLayer =
new GeoPhysVol(activeLayerLog);
284 std::ostringstream name; name <<
"Ski#" << iSki;
288 GeoTrf::Vector3D pos(
m_radius, 0, 0);
289 pos = GeoTrf::RotateZ3D(
phi)*pos;
290 GeoTrf::Transform3D rot = GeoTrf::RotateZ3D(
m_tilt)*GeoTrf::RotateZ3D(
phi);
294 GeoTrf::Transform3D trans(GeoTrf::Transform3D(GeoTrf::Translate3D(pos.x(),pos.y(),pos.z())*rot) *
m_ski->getRefPointTransform()->getTransform().inverse());
296 activeLayer->add(
new GeoAlignableTransform(trans));
297 activeLayer->add(
new GeoNameTag(name.str()));
298 activeLayer->add(
new GeoIdentifierTag(iSki));
299 id.setPhiModule(iSki);
300 activeLayer->add(
m_ski->build(
id));
305 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(clampZPos)));
306 activeLayer->add(
m_clamp->getVolume());
307 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-clampZPos)));
308 activeLayer->add(
m_clamp->getVolume());
311 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(coolingZPos)));
313 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-coolingZPos)));
320 const GeoTube * auxLayerEnvelopeShape =
new GeoTube(
m_skiAux->innerRadius(),
m_skiAux->outerRadius(),
322 GeoLogVol * auxLayerLog =
new GeoLogVol(
getName()+
"Aux", auxLayerEnvelopeShape,
m_materials->gasMaterial());
323 GeoPhysVol * auxLayer =
new GeoPhysVol(auxLayerLog);
328 auxLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(
phi)));
329 auxLayer->add(
m_skiAux->getVolume());
341 GeoLogVol * supportLayerLog =
new GeoLogVol(
getName()+
"Support", supportLayerTube,
343 GeoPhysVol * supportLayer =
new GeoPhysVol(supportLayerLog);
347 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(flangeZPos)));
348 supportLayer->add(
m_flange->getVolume());
349 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-flangeZPos)));
350 supportLayer->add(
m_flange->getVolume());
358 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(fibreMaskZPos)));
360 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-fibreMaskZPos)));
367 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(jewelAngle)*GeoTrf::TranslateX3D(jewelRadius)*GeoTrf::TranslateZ3D(
m_zEndJewel)));
369 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(jewelAngle)*GeoTrf::TranslateX3D(jewelRadius)*GeoTrf::TranslateZ3D(-
m_zEndJewel)));
377 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(scorpionAngle)*GeoTrf::TranslateX3D(scorpionRadius)*GeoTrf::TranslateZ3D(
m_zScorpion)));
379 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(scorpionAngle)*GeoTrf::TranslateX3D(scorpionRadius)*GeoTrf::TranslateZ3D(-
m_zScorpion)));
390 layer->add(activeLayer);
391 layer->add(auxLayer);
392 layer->add(supportLayer);
404 GeoTrf::Vector3D c1(-(
m_ski->env1RefPointVector()->x()) - 0.5*(
m_ski->env1Thickness()),
405 -(
m_ski->env1RefPointVector()->y()) + 0.5*(
m_ski->env1Width()),
407 GeoTrf::Vector3D c2(-(
m_ski->env2RefPointVector()->x()) - 0.5*(
m_ski->env2Thickness()),
408 -(
m_ski->env2RefPointVector()->y()) + 0.5*(
m_ski->env2Width()),
410 GeoTrf::Vector3D c4(-(
m_ski->env1RefPointVector()->x()) + 0.5*(
m_ski->env1Thickness()),
411 -(
m_ski->env1RefPointVector()->y()) - 0.5*(
m_ski->env1Width()),
414 c1 = GeoTrf::RotateZ3D(
m_tilt)*c1;
415 c2 = GeoTrf::RotateZ3D(
m_tilt)*c2;
416 c4 = GeoTrf::RotateZ3D(
m_tilt)*c4;
418 GeoTrf::Vector3D vxmax = std::move(c4);
419 GeoTrf::Vector3D vxmin;
420 if (c1.x() < c2.x()) {
421 vxmin = std::move(c1);
424 vxmin = std::move(c2);
427 double xmax = vxmax.x();
428 double xmin = vxmin.x();
429 double ymax = vxmax.y();
430 double ymin = vxmin.y();
445 double divisionAngle = 360 * Gaudi::Units::degree /
m_skisPerLayer;
449 double activeHalfWidth = 0.5 *
m_module->activeWidth();
450 double moduleHalfThickness = 0.5 *
m_module->thickness();
453 double ctilt = std::abs(cos(
m_tilt));
454 double stilt = std::abs(sin(
m_tilt));
456 - ctilt * moduleHalfThickness - stilt * activeHalfWidth;
457 double yin = - stilt * moduleHalfThickness + ctilt * activeHalfWidth;
459 + ctilt * moduleHalfThickness - stilt * activeHalfWidth;
460 double yout = stilt * moduleHalfThickness + ctilt * activeHalfWidth;
461 double alpha_in = atan(yin/xin);
462 double alpha_out = atan(yout/xout);
463 double alpha = std::max(alpha_in, alpha_out);
465 int tiltSign = (
m_tilt < 0) ? -1 : 1;
468 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)