32 #include "GeoModelRead/ReadGeoModel.h"
33 #include "GeoModelKernel/GeoTube.h"
34 #include "GeoModelKernel/GeoLogVol.h"
35 #include "GeoModelKernel/GeoPhysVol.h"
36 #include "GeoModelKernel/GeoFullPhysVol.h"
37 #include "GeoModelKernel/GeoNameTag.h"
38 #include "GeoModelKernel/GeoIdentifierTag.h"
39 #include "GeoModelKernel/GeoTransform.h"
40 #include "GeoModelKernel/GeoAlignableTransform.h"
41 #include "GeoModelKernel/GeoMaterial.h"
42 #include "GeoModelKernel/GeoShapeSubtraction.h"
43 #include "GeoModelKernel/GeoDefinitions.h"
44 #include "GaudiKernel/SystemOfUnits.h"
50 inline double sqr(
double x) {
return x *
x;}
58 GeoModelIO::ReadGeoModel* sqliteReader,
59 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
60 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
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();
198 m_coolingEnd = std::make_unique<SCT_CoolingEnd>(
"CoolingEnd"+layerNumStr,
m_iLayer, coolingInnerRadius, coolingLength,
210 double rMinActive, rMaxActive;
220 rMinActive =
m_skiAux->outerRadius();
247 if (
m_skiAux->outerRadius() > rMinActive) {
248 std::cout <<
"----> WARNING: SCT_Layer: Overlap between active layer and aux layer." << std::endl;
262 id.setPhiModule(iSki);
281 GeoPhysVol * activeLayer =
new GeoPhysVol(activeLayerLog);
284 std::ostringstream
name;
name <<
"Ski#" << iSki;
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(),
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);
406 -(
m_ski->env1RefPointVector()->y()) + 0.5*(
m_ski->env1Width()),
409 -(
m_ski->env2RefPointVector()->y()) + 0.5*(
m_ski->env2Width()),
413 -(
m_ski->env1RefPointVector()->y()) - 0.5*(
m_ski->env1Width()),
420 c4 = GeoTrf::RotateZ3D(
m_tilt)*c4;
424 if (
c1.x() <
c2.x()) {
431 double xmax = vxmax.x();
432 double xmin = vxmin.x();
433 double ymax = vxmax.y();
434 double ymin = vxmin.y();
460 - ctilt * moduleHalfThickness - stilt * activeHalfWidth;
461 double yin = - stilt * moduleHalfThickness + ctilt * activeHalfWidth;
463 + ctilt * moduleHalfThickness - stilt * activeHalfWidth;
464 double yout = stilt * moduleHalfThickness + ctilt * activeHalfWidth;
465 double alpha_in =
atan(yin/xin);
466 double alpha_out =
atan(yout/xout);
467 double alpha =
std::max(alpha_in, alpha_out);
469 int tiltSign = (
m_tilt < 0) ? -1 : 1;
472 double skiPhiOffset = tiltSign * (0.5 * divisionAngle - alpha);