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"
49 inline double sqr(
double x) {
return x *
x;}
57 GeoModelIO::ReadGeoModel* sqliteReader,
58 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
59 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
130 m_skiPhiStart = divisionAngle * (moduleCount - floor(moduleCount +0.5 -0.0001));
147 m_fibreMask = std::make_unique<SCT_FSIFibreMask>(
"FSIFibreMask"+layerNumStr,
m_iLayer, length_mask,
166 int tiltSign = (
m_tilt < 0) ? -1 : +1;
169 double powerTapeOffset = bracketOffset - tiltSign * 0.5*divisionAngle;
175 m_skiAux = std::make_unique<SCT_SkiAux>(
"SkiAux"+layerNumStr,
194 double coolingInnerRadius =
m_clamp->outerRadius();
197 m_coolingEnd = std::make_unique<SCT_CoolingEnd>(
"CoolingEnd"+layerNumStr,
m_iLayer, coolingInnerRadius, coolingLength,
209 double rMinActive, rMaxActive;
219 rMinActive =
m_skiAux->outerRadius();
246 if (
m_skiAux->outerRadius() > rMinActive) {
247 std::cout <<
"----> WARNING: SCT_Layer: Overlap between active layer and aux layer." << std::endl;
261 id.setPhiModule(iSki);
280 GeoPhysVol * activeLayer =
new GeoPhysVol(activeLayerLog);
283 std::ostringstream
name;
name <<
"Ski#" << iSki;
295 activeLayer->add(
new GeoAlignableTransform(trans));
296 activeLayer->add(
new GeoNameTag(
name.str()));
297 activeLayer->add(
new GeoIdentifierTag(iSki));
298 id.setPhiModule(iSki);
299 activeLayer->add(
m_ski->build(
id));
304 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(clampZPos)));
305 activeLayer->add(
m_clamp->getVolume());
306 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-clampZPos)));
307 activeLayer->add(
m_clamp->getVolume());
310 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(coolingZPos)));
312 activeLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-coolingZPos)));
319 const GeoTube * auxLayerEnvelopeShape =
new GeoTube(
m_skiAux->innerRadius(),
m_skiAux->outerRadius(),
322 GeoPhysVol * auxLayer =
new GeoPhysVol(auxLayerLog);
327 auxLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(
phi)));
328 auxLayer->add(
m_skiAux->getVolume());
340 GeoLogVol * supportLayerLog =
new GeoLogVol(
getName()+
"Support", supportLayerTube,
342 GeoPhysVol * supportLayer =
new GeoPhysVol(supportLayerLog);
346 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(flangeZPos)));
347 supportLayer->add(
m_flange->getVolume());
348 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-flangeZPos)));
349 supportLayer->add(
m_flange->getVolume());
357 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(fibreMaskZPos)));
359 supportLayer->add(
new GeoTransform(GeoTrf::TranslateZ3D(-fibreMaskZPos)));
366 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(jewelAngle)*GeoTrf::TranslateX3D(jewelRadius)*GeoTrf::TranslateZ3D(
m_zEndJewel)));
368 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(jewelAngle)*GeoTrf::TranslateX3D(jewelRadius)*GeoTrf::TranslateZ3D(-
m_zEndJewel)));
376 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(scorpionAngle)*GeoTrf::TranslateX3D(scorpionRadius)*GeoTrf::TranslateZ3D(
m_zScorpion)));
378 supportLayer->add(
new GeoTransform(GeoTrf::RotateZ3D(scorpionAngle)*GeoTrf::TranslateX3D(scorpionRadius)*GeoTrf::TranslateZ3D(-
m_zScorpion)));
389 layer->add(activeLayer);
390 layer->add(auxLayer);
391 layer->add(supportLayer);
405 -(
m_ski->env1RefPointVector()->y()) + 0.5*(
m_ski->env1Width()),
408 -(
m_ski->env2RefPointVector()->y()) + 0.5*(
m_ski->env2Width()),
412 -(
m_ski->env1RefPointVector()->y()) - 0.5*(
m_ski->env1Width()),
419 c4 = GeoTrf::RotateZ3D(
m_tilt)*c4;
423 if (
c1.x() <
c2.x()) {
430 double xmax = vxmax.x();
431 double xmin = vxmin.x();
432 double ymax = vxmax.y();
433 double ymin = vxmin.y();
459 - ctilt * moduleHalfThickness - stilt * activeHalfWidth;
460 double yin = - stilt * moduleHalfThickness + ctilt * activeHalfWidth;
462 + ctilt * moduleHalfThickness - stilt * activeHalfWidth;
463 double yout = stilt * moduleHalfThickness + ctilt * activeHalfWidth;
464 double alpha_in =
atan(yin/xin);
465 double alpha_out =
atan(yout/xout);
466 double alpha =
std::max(alpha_in, alpha_out);
468 int tiltSign = (
m_tilt < 0) ? -1 : 1;
471 double skiPhiOffset = tiltSign * (0.5 * divisionAngle - alpha);